{"_id":"@adaptivemcp/routing","_rev":"4-2fbb305752297b40c29a0a2e01ba0e81","name":"@adaptivemcp/routing","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@adaptivemcp/routing","version":"0.2.0","license":"MIT","_id":"@adaptivemcp/routing@0.2.0","maintainers":[{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"}],"dist":{"shasum":"bd6a45fc3cec00ad31eca4cab7063a66fbd97973","tarball":"https://registry.npmjs.org/@adaptivemcp/routing/-/routing-0.2.0.tgz","fileCount":10,"integrity":"sha512-sC6Ys7+O6fzlrhpFFcigVFzd1RpecWKwBBKS7X5luNmkYuBLMZ5Y4p8oYBfSE+zD7go5Rve+DrVrG6k1H39YYA==","signatures":[{"sig":"MEUCIAhRwVUyovJSa0Sy2IbaEvtMzH7uyoGdrGtupmCfP5zAAiEA8SRGTv7ELt7xjGd/KkHy9yQeJHxx8Gbtiqrt1kA+xSU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12642},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"72b57ab2c6e3a08fc0a5446bb57e8bd75dd51477","scripts":{"test":"vitest run --config ../../vitest.config.ts","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"},"_npmVersion":"12.0.1","description":"Model selection and cost optimization for Adaptive MCP.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"@adaptivemcp/spec":"workspace:*","@adaptivemcp/memory":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/routing_0.2.0_1784448385825_0.6598691272802475","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@adaptivemcp/routing","version":"0.2.1","license":"MIT","_id":"@adaptivemcp/routing@0.2.1","maintainers":[{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"}],"dist":{"shasum":"05549f3697bfce29a482c55aa8f4f79ef1c7ad25","tarball":"https://registry.npmjs.org/@adaptivemcp/routing/-/routing-0.2.1.tgz","fileCount":10,"integrity":"sha512-ti1Qxu3ITZJE5e5DVsphnHUZ0mrFqBTRCFyIhtpuVTz+kJgDTmzNUTBvlAsVZ4N6kTKUsGcQUTu2WppvEXIRBA==","signatures":[{"sig":"MEUCIQDCGrZ8XDGfLsOa/PdDrKmodDsaaJPxTxCwqAYgm5sFcQIgOAL4ElizQ+WIh+bCaMDJrhf/aEU44qMHHXvKdQrAUfw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12979},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"67875dd46c157fcfce32192c63201c00105202d5","scripts":{"test":"vitest run --config ../../vitest.config.ts","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"},"_npmVersion":"12.0.1","description":"Model selection and cost optimization for Adaptive MCP.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"@adaptivemcp/spec":"workspace:*","@adaptivemcp/memory":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/routing_0.2.1_1784454875616_0.8276226629880568","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@adaptivemcp/routing","version":"0.2.2","license":"MIT","_id":"@adaptivemcp/routing@0.2.2","maintainers":[{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"}],"dist":{"shasum":"419ea9de42dace0dcd08343d684d53ce827ddd27","tarball":"https://registry.npmjs.org/@adaptivemcp/routing/-/routing-0.2.2.tgz","fileCount":10,"integrity":"sha512-1Oz19qx6yxwXk+eXnkUC/PFL7LNK+6J1I9gYAn3xnZE8LL2fsMEH0GKml1wwu9cPLf6oRPQ3pnWL5YB6LKx3Fw==","signatures":[{"sig":"MEQCIGhvt8KutkpM5Qz5ar9vrbD1hropjHJw93N+Rzb8Vqc3AiBcf8jLu00b1dpp6+AL48IPqIeCiRZzNhY0BlOlYS1cgQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13371},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"00b51e676ad298a079f5de73e5cbea411fae39f2","scripts":{"test":"vitest run --config ../../vitest.config.ts","build":"tsc -p tsconfig.json"},"_npmUser":{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"},"_npmVersion":"12.0.1","description":"Model selection and cost optimization for Adaptive MCP.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"@adaptivemcp/spec":"workspace:*","@adaptivemcp/memory":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"tmp":"tmp/routing_0.2.2_1784457353785_0.6505553294768487","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@adaptivemcp/routing@0.3.0","dist":{"shasum":"5f594602c9c3ee82e02da3baa69a79003eb32181","tarball":"https://registry.npmjs.org/@adaptivemcp/routing/-/routing-0.3.0.tgz","fileCount":22,"integrity":"sha512-kJOPf+A8+bBcUco6A3uQNqu1wl73E/LVkPAVArx5iOmebzfH/DLTneCIO9YLidBTruA9ybSYs6tLnVM0IDSujg==","signatures":[{"sig":"MEUCIFwoBXtiAxo7r5F74tLOw2VLs+V7g/hyeP/JzztVndF+AiEAkCauv72rOCrXO5aMuGQOmLhMi0AKQBuccrhtgzmNhAc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCrqMjpGorszTybtCjqyK2jfplRJZfPBoyXskXSgi630QIhAJj9iHv/97UEa4lTHoKnYvyMU80NOW3us1sfbgC03gkx"}],"unpackedSize":45474},"main":"./dist/index.js","name":"@adaptivemcp/routing","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"9ee97159d0137dc23b6a02008def6faa0f857092","license":"MIT","scripts":{"test":"vitest run --config ../../vitest.config.ts","build":"tsc -p tsconfig.json"},"version":"0.3.0","_npmUser":{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"},"_npmVersion":"12.1.0","description":"Model selection and cost optimization for Adaptive MCP.","directories":{},"maintainers":[{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"}],"_nodeVersion":"26.10.0","dependencies":{"@adaptivemcp/spec":"workspace:*","@adaptivemcp/memory":"workspace:*","@adaptivemcp/graph-analysis":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.0","typescript":"^5.6.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/routing_0.3.0_1790580002144_0.6685476573143534"}}},"time":{"created":"2026-07-19T08:06:25.653Z","modified":"2026-09-28T07:20:03.254Z","0.2.0":"2026-07-19T08:06:25.940Z","0.2.1":"2026-07-19T09:54:35.749Z","0.2.2":"2026-07-19T10:35:53.910Z","0.3.0":"2026-09-28T07:20:02.220Z"},"license":"MIT","description":"Model selection and cost optimization for Adaptive MCP.","maintainers":[{"name":"kemalelmizan","email":"kemalelmizan@gmail.com"}],"readme":"# @adaptivemcp/routing\n\nModel selection and cost optimization for Adaptive MCP.\n\n> **Status:** published to npm as `@adaptivemcp/routing`. It is the client-side\n> **executor** of policy the server governs.\n\n`routing` reads learned stats from the store (`@adaptivemcp/memory`) and emits\n`model` and `routing` recommendations. For example, steer a flaky or expensive tool\ntoward a cheaper/faster model once the evidence supports it.\n\n## Usage\n\n```ts\nimport { MemoryStore } from \"@adaptivemcp/memory\";\nimport { Router } from \"@adaptivemcp/routing\";\n\nconst memory = new MemoryStore();\nconst router = new Router({\n  memory,\n  models: [\n    { id: \"gpt-5-mini\", costWeight: 1, latencyWeight: 1 },\n    { id: \"gpt-5\", costWeight: 4, latencyWeight: 0.6 },\n  ],\n  budget: { perToolLimit: 0.05 },\n});\n\nrouter.routeAll(); // writes `model` + `routing` recommendations into the store\n```\n\n## What it does\n\n- `routeAll()` / `routeTool(toolName)`: derive routing recommendations from observed stats.\n- Emits `model` and `routing` recommendations into the store.\n- Warns when projected cost crosses ~80% of a configured budget.\n\n### Defaults\n\n| Option | Default |\n| --- | --- |\n| `minInvocations` | `10` |\n\n## License\n\nReleased under the [MIT License](../../LICENSE). Copyright (c) 2026 Kemal Elmizan.\n","readmeFilename":"README.md"}