{
  "markdown": "# SLM Agent by ScaleDown\n\nAn MCP server + Claude Code plugin that scans your codebase for AI API calls and shows you exactly where and how to integrate [ScaleDown](https://scaledown.ai) SLMs to cut costs by up to 95%.\n\n> **Privacy**: This plugin analyzes your code locally. No source code or codebase data is ever sent to ScaleDown servers. The only network calls are to ScaleDown's API endpoints at runtime, when *your application* calls them with the `SCALEDOWN_API_KEY` you provide.\n\n## What it does\n\n1. **Evaluates** — scans your project for OpenAI, Anthropic, LangChain, LlamaIndex, Cohere, and other AI API calls\n2. **Plans** — generates a structured migration plan showing which ScaleDown SLM fits each call site:\n   - `sd_compress` — reduce context tokens 50–70% before calling your LLM (for RAG, long docs)\n   - `sd_classify` — replace frontier LLM classification calls (~95% cheaper)\n   - `sd_extract` — replace frontier LLM entity extraction calls (~95% cheaper)\n   - `sd_summarize` — replace frontier LLM summarization calls (~90% cheaper)\n3. **Migrates** — applies the changes to your code with your approval, adapting to your real variable names\n4. **Optimizes** — tunes the prompt you pass to a ScaleDown SLM against your own sample data and benchmarks it against the frontier-model output it replaced, with a reproducible eval\n\n## Installation\n\n### Claude Code (recommended)\n\nFirst add the ScaleDown marketplace:\n\n```\n/plugin marketplace add scaledown-team/SLM_Agent\n```\n\nThen install the plugin:\n```\n/plugin install slm-agent@scaledown\n```\n\nFinally, reload your plugins:\n```\n/reload-plugins\n```\n\nYou are now ready to use the SLM Agent. Go to any project and run:\n\n```\n/slm-agent:evaluate    # find & migrate AI calls to ScaleDown SLMs\n/slm-agent:optimize    # tune a ScaleDown prompt against your own data\n```\n\nThe plugin automatically configures the MCP server and registers the `/slm-agent:evaluate` and `/slm-agent:optimize` skills. No further setup needed.\n\n### Cursor\n\nAdd to your project's `.cursor/mcp.json` (or `~/.cursor/mcp.json` for global):\n\n```json\n{\n  \"mcpServers\": {\n    \"scaledown-slm-agent\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@scaledown/migration-agent\"]\n    }\n  }\n}\n```\n\nThen ask Cursor: *\"Use the scaledown-slm-agent tools to evaluate this codebase for ScaleDown integration opportunities.\"*\n\n### VS Code (Copilot / any MCP-compatible extension)\n\nAdd to your workspace `.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"scaledown-slm-agent\": {\n      \"type\": \"stdio\",\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@scaledown/migration-agent\"]\n    }\n  }\n}\n```\n\n### Manual (any MCP client)\n\n```bash\nnpm install -g @scaledown/migration-agent\n```\n\nThen configure your MCP client to run: `scaledown-agent`\n\n## MCP Tools\n\nThe server exposes four tools that any MCP-compatible AI assistant can call:\n\n| Tool | Description |\n|---|---|\n| `get_ai_detection_patterns` | Returns grep-compatible regex patterns for all supported AI providers |\n| `get_integration_template` | Returns before/after code showing exactly how to integrate ScaleDown |\n| `generate_migration_plan` | Generates a full structured markdown migration plan from a list of findings |\n| `save_migration_report` | Writes the migration plan markdown to `scaledown-report.md` in the user's project root |\n\n## Migration report\n\nAfter evaluation, a file named **`scaledown-report.md`** is saved in your project root. It follows a fixed schema (version `\"1\"`) and contains:\n\n| Section | Content |\n|---|---|\n| **Summary table** | Files scanned, files with AI calls, total opportunities, providers detected |\n| **Complexity breakdown** | Count of calls at each complexity level (trivial → highly_complex) |\n| **Per-opportunity sections** | Files, line numbers, complexity score, confidence level, and action for each of `sd_classify` / `sd_extract` / `sd_summarize` / `sd_compress` |\n| **Complex call decompositions** | For calls scoring 3+/5, a step-by-step breakdown showing which sub-tasks can move to a ScaleDown SLM and which still need a frontier LLM |\n| **HTTP API reference** | Exact request/response shapes for all four ScaleDown endpoints (`/classify`, `/extract`, `/summarization/abstractive`, `/compress/raw/`) |\n\nThe report header looks like:\n\n```markdown\n# ScaleDown Migration Plan — my-app\n\n> Generated: 2025-05-19T10:00:00.000Z\n> Report version: 1\n\n## Summary\n| Metric | Value |\n|---|---|\n| Files scanned | 42 |\n| Files with AI API calls | 7 |\n| Total integration opportunities | 11 |\n| Providers detected | openai, langchain |\n\n### Call Complexity Breakdown\n| Complexity | Count |\n|---|---|\n| simple | 4 |\n| moderate | 2 |\n| complex | 1 |\n```\n\n## Prompt optimization (`/slm-agent:optimize`)\n\nMigrating a call to `sd_extract` / `sd_classify` / `sd_summarize` / `sd_compress`\nis step one. Step two is making the SLM's output match — or beat — the frontier\nmodel it replaced, on **your** data. The `optimize` skill runs that loop. It is\ngeneral: it adapts the eval metric to your task type (Macro-F1 + confusion matrix\nfor classification, per-field precision/recall for extraction, ROUGE/faithfulness\nfor summarization, ratio + downstream correctness for compression) and to your own\nsuccess criterion.\n\n1. **Collects** your ScaleDown API key (read from the environment, never written\n   to disk) and a small set of labeled samples.\n2. **Creates samples if you have none** — it finds representative inputs in your\n   project, agrees a field/label schema with you, and records a baseline answer\n   per sample (from your original model call, or your confirmed ground truth),\n   then validates the set.\n3. **Runs a reproducible eval** (`scaledown-eval/run_eval.py`) with a metric that\n   fits the task — one that can't be gamed by a degenerate strategy (e.g. Macro-F1\n   so a rare class can't be ignored; a per-field real-vs-empty split so a field\n   can't look accurate just by returning empty).\n4. **Iterates the prompt** one scoped change at a time, always re-running the\n   current best in the same batch and **twice**, so it can separate a real\n   improvement from API run-to-run noise, and always scores the whole task so a\n   win on one class/field that quietly regresses another is caught.\n\nEverything it produces lives under `scaledown-eval/` — the samples, each prompt\nversion, per-round metrics, and an `optimization-report.md` with the winning\nprompt and the exact command to reproduce it. Your sample data is only ever sent\nto the ScaleDown endpoint you provide a key for.\n\n```\nexport SCALEDOWN_API_KEY=...\n/slm-agent:optimize\n```\n\n## Supported providers\n\n| Provider | Language |\n|---|---|\n| OpenAI (v0 and v1) | Python, TypeScript/JS |\n| Anthropic | Python, TypeScript/JS |\n| LangChain | Python, TypeScript/JS |\n| LlamaIndex | Python |\n| Cohere | Python |\n| Google Generative AI | Python |\n| Vercel AI SDK | TypeScript/JS |\n\n## Example output\n\n```\n## ScaleDown Migration Plan — my-app\n\n| Metric | Value |\n|---|---|\n| Files with AI API calls | 7 |\n| Total integration opportunities | 11 |\n| Providers detected | openai, langchain |\n\n## 1. Replace Classification Calls with `sd_classify`\nEstimated savings: ~95% per call\n\n| File | Line |\n|---|---|\n| `src/triage.py` | 42 |\n| `src/router.py` | 88 |\n\n## 2. Add Context Compression with `sd_compress`\nEstimated savings: 50-70% on context tokens\n\n| File | Line |\n|---|---|\n| `src/rag_pipeline.py` | 117 |\n| `src/chat.py` | 55 |\n```\n\n## Development\n\n```bash\ngit clone https://github.com/scaledown-team/SLM_Agent\ncd SLM_Agent\nnpm install\nnpm run build       # compile TypeScript → dist/\nnpm run dev         # run without compiling (via tsx)\n```\n\n## Get a ScaleDown API key\n\nSign up at [scaledown.ai/dashboard](https://scaledown.ai/dashboard) — **50 million free tokens** included.\n\n## Extending to other IDEs\n\n- **Codex (OpenAI)**: Add to `mcp_servers` in your Codex config once MCP support is available\n- **JetBrains**: Use any MCP proxy plugin and point it at `npx @scaledown/migration-agent`\n- **Neovim / Emacs**: Use any MCP client plugin with the same npx command\n",
  "bytes": 8033,
  "sha": "e8711b7b086d1e0123095e752ad2bb2efb6dacee1dc83f1cf641242687d71118",
  "repo_slug": "scaledown-team/slm_agent",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_scaledown_team_slm_agent_slm_agent_50e3d2aa/readme"
}