{"_id":"@ast-ai-model-router/cli","_rev":"7-29fda7241d864c46f496c3b8b853e496","name":"@ast-ai-model-router/cli","dist-tags":{"latest":"2.0.3"},"versions":{"0.1.1":{"name":"@ast-ai-model-router/cli","version":"0.1.1","keywords":["llm","token-economics","model-router","claude-code","codex","ast","prompt-cost"],"author":{"url":"https://github.com/faraa2m","name":"Faraazuddin Mohammed"},"license":"MIT","_id":"@ast-ai-model-router/cli@0.1.1","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"bin":{"model-router":"bin/ast-ai-model-router.js","ast-ai-model-router":"bin/ast-ai-model-router.js"},"dist":{"shasum":"d895445abfaae5136a2759494a20a476881c27fe","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-0.1.1.tgz","fileCount":13,"integrity":"sha512-dG3NmDktPNg5Sa6iDU5GGDx6qsO3Um0hp2MAioM4WCCJvVWdbnQ5Utg4eRd+Fey4T20pKLUhTWOJT5bXwlKeHg==","signatures":[{"sig":"MEUCIQD9KTl5YqmgCUYIBjDIIIi8b3uab1GuXbgaF+vJynyF/gIgXpRVI2xMVA8PgL8L/+gl89VwODzqXyLbL5F74sMGiCY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":25430},"type":"module","engines":{"node":">=20"},"gitHead":"4df3f1209b95dade1508d79ce5651547f2bada0f","scripts":{"lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","test":"node --test","changeset":"changeset","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public","changeset:publish":"changeset publish","changeset:version":"changeset version"},"_npmUser":{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"},"repository":{"url":"git+https://github.com/faraa2m/ast-ai-model-router.git","type":"git"},"_npmVersion":"10.8.2","description":"AST-aware Claude and Codex model router for cost-conscious coding tasks.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@babel/parser":"^7.28.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@changesets/cli":"^2.31.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_0.1.1_1779112783485_0.10445496068188387","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@ast-ai-model-router/cli","version":"1.0.0","keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"author":{"url":"https://github.com/faraa2m","name":"Faraazuddin Mohammed"},"license":"MIT","_id":"@ast-ai-model-router/cli@1.0.0","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"bin":{"model-router":"bin/ast-ai-model-router.js","ast-ai-model-router":"bin/ast-ai-model-router.js"},"dist":{"shasum":"cbd6ca773aa7b2a249246b4632bb741f96c810e6","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-1.0.0.tgz","fileCount":16,"integrity":"sha512-v/HyWXoSRhNDHHtgvbC5dyOmOT2d5z06nFOyEgZT3gRkCIC5gc7CsZb6+c4PqRzTUP3HiwaAHww/PMU8aKQ65w==","signatures":[{"sig":"MEUCIBKw4htgq6BvR3tX3rHzpEL3vvRoQYVfS2yUNgC5xl4hAiEAvqEv9fNhfo4C2bEAgixcEe2ZDEefhXcRlTgNnLlhsgY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":41418},"type":"module","engines":{"node":">=20"},"gitHead":"7c27c15ab803f1584e0e2863efbf969cc8ea4215","scripts":{"lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","test":"node --test","changeset":"changeset","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public","changeset:publish":"changeset publish","changeset:version":"changeset version"},"_npmUser":{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"},"repository":{"url":"git+https://github.com/faraa2m/ast-ai-model-router.git","type":"git"},"_npmVersion":"10.8.2","description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@babel/parser":"^7.28.5","@tokenometer/core":"^1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@changesets/cli":"^2.31.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_1.0.0_1779116093020_0.7601526022374245","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ast-ai-model-router/cli","version":"1.1.0","keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"author":{"url":"https://github.com/faraa2m","name":"Faraazuddin Mohammed"},"license":"MIT","_id":"@ast-ai-model-router/cli@1.1.0","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"bin":{"model-router":"bin/ast-ai-model-router.js","ast-ai-model-router":"bin/ast-ai-model-router.js"},"dist":{"shasum":"e56a30b80779ab063982918be674998493ea39e5","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-1.1.0.tgz","fileCount":18,"integrity":"sha512-He8OKAPw2R1AcA4/Xq4XkT3Fm6OL570yCJLxToyNPMK6P3rD2BzXBIN9cBg4xAcvw3145Ntz8xIbPmtg1DLfFw==","signatures":[{"sig":"MEUCIQD1eKD2m7MSrkfAQkFGXk0wjHpxf//rGpHjg4mEH4S76QIgVT8e4ExSzYTt8DaHOt3MJzp5c+SrUObW1TK+aZ9E7Bo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49742},"type":"module","engines":{"node":">=20"},"gitHead":"39d2bc8663db5e7ef5f48608062e02cb8da56f47","scripts":{"lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","test":"node --test","changeset":"changeset","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public","changeset:publish":"changeset publish","changeset:version":"changeset version"},"_npmUser":{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"},"repository":{"url":"git+https://github.com/faraa2m/ast-ai-model-router.git","type":"git"},"_npmVersion":"10.8.2","description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@babel/parser":"^7.28.5","@tokenometer/core":"^1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@changesets/cli":"^2.31.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_1.1.0_1779195732490_0.08096953502794402","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@ast-ai-model-router/cli","version":"2.0.0","keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"author":{"url":"https://github.com/faraa2m","name":"Faraazuddin Mohammed"},"license":"MIT","_id":"@ast-ai-model-router/cli@2.0.0","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"bin":{"model-router":"bin/ast-ai-model-router.js","ast-ai-model-router":"bin/ast-ai-model-router.js"},"dist":{"shasum":"9d3d925728e6a0c2893ecf253e49323651111dcb","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-2.0.0.tgz","fileCount":18,"integrity":"sha512-oD3IVceaE/Nou+6+cozcGqhQ4tLQm9dAoTZ1CKJ3Rne2hKLgs82FVatjqm8Jbh3cpqO+nOj/hjIMt7O3qM0JnQ==","signatures":[{"sig":"MEYCIQCEcwIs/X35d2ztkcP6bt80yLIR/X2HHHYq+738w+3isgIhAMScORK6fxQB+/393eoEiqkiaXAliWT4mvtkMelIBgOi","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49742},"type":"module","engines":{"node":">=26"},"gitHead":"0ddf45ca48a3a611391bc80e75ac0ee8ba0d8fcf","scripts":{"lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","test":"node --test","changeset":"changeset","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public","changeset:publish":"changeset publish","changeset:version":"changeset version"},"_npmUser":{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"},"repository":{"url":"git+https://github.com/faraa2m/ast-ai-model-router.git","type":"git"},"_npmVersion":"11.13.0","description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@babel/parser":"^7.28.5","@tokenometer/core":"^1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@changesets/cli":"^2.31.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_2.0.0_1779200254811_0.3324184315150225","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@ast-ai-model-router/cli","version":"2.0.1","keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"author":{"url":"https://github.com/faraa2m","name":"Faraazuddin Mohammed"},"license":"MIT","_id":"@ast-ai-model-router/cli@2.0.1","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"bin":{"model-router":"bin/ast-ai-model-router.js","ast-ai-model-router":"bin/ast-ai-model-router.js"},"dist":{"shasum":"a3cf6d5b65fb4033b05b24394fb775ff0ccdffb0","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-2.0.1.tgz","fileCount":18,"integrity":"sha512-PJxE6cESs/mJ4VtgsaQ7IVuC8brFygHPkV+z9qLboL6/9qSHiK+9dPYqU6GuZyuM/DB3DvRa6dT6O0UM4EDAlg==","signatures":[{"sig":"MEUCIDj3JCDywd7xzKAoTZ66Qgnxm3jIefcwAWxukbLA0kBCAiEAylv5oy5m0GGw/o6ZgBpUB2u5JbWtG1f1/+hDa7hYaeg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":49911},"type":"module","engines":{"node":">=26"},"gitHead":"5311ac7720df1d6a0ce8ac828555352e5120947d","scripts":{"lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","test":"node --test","changeset":"changeset","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public","changeset:publish":"changeset publish","changeset:version":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:33d7afca-195c-4586-a078-c4c176b13e12"}},"repository":{"url":"git+https://github.com/faraa2m/ast-ai-model-router.git","type":"git"},"_npmVersion":"11.14.1","description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","directories":{},"_nodeVersion":"26.1.0","dependencies":{"@babel/parser":"^7.28.5","@tokenometer/core":"^1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@changesets/cli":"^2.31.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_2.0.1_1779290328590_0.32229303721933245","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@ast-ai-model-router/cli","version":"2.0.2","keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"author":{"url":"https://github.com/faraa2m","name":"Faraazuddin Mohammed"},"license":"MIT","_id":"@ast-ai-model-router/cli@2.0.2","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"bin":{"model-router":"bin/ast-ai-model-router.js","ast-ai-model-router":"bin/ast-ai-model-router.js"},"dist":{"shasum":"34072cc92a59db4fd6705517884fe762bb333bf8","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-2.0.2.tgz","fileCount":18,"integrity":"sha512-TciEw7zBJCZG5L0LmAPxc+q98XJdK4vEXmBrIL0t4nDiRVwVLKpB4lOEAQTG0msayGN/zzKJdLNkRFUtBu4EkQ==","signatures":[{"sig":"MEUCIFZ0kd8BINRwCUF9vnk99b5VaDlr0n0qRaC7WHkq+tFjAiEA882O4YCg/pZ7uMfJvVoSfQ5eeFzi1R4CGmp6w42ywCI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@2.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50363},"type":"module","engines":{"node":">=26"},"gitHead":"040f9095a3a6ae13bb34381367dcb5b71504cf2f","scripts":{"lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","test":"node --test","changeset":"changeset","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public","changeset:publish":"changeset publish","changeset:version":"changeset version"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:33d7afca-195c-4586-a078-c4c176b13e12"}},"repository":{"url":"git+https://github.com/faraa2m/ast-ai-model-router.git","type":"git"},"_npmVersion":"11.15.0","description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","directories":{},"_nodeVersion":"26.2.0","dependencies":{"@babel/parser":"^7.28.5","@tokenometer/core":"^1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@changesets/cli":"^2.31.0"},"_npmOperationalInternal":{"tmp":"tmp/cli_2.0.2_1779677005260_0.15817958324474568","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@ast-ai-model-router/cli","version":"2.0.3","description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","type":"module","bin":{"ast-ai-model-router":"bin/ast-ai-model-router.js","model-router":"bin/ast-ai-model-router.js"},"scripts":{"test":"node --test","lint":"node --check bin/ast-ai-model-router.js && node --check lib/*.js && node --check lib/parsers/*.js","changeset":"changeset","changeset:version":"changeset version","changeset:publish":"changeset publish","pack:dry-run":"npm publish --dry-run --registry=https://registry.npmjs.org --cache=.npm-cache","publish:local":"npm publish --registry=https://registry.npmjs.org --cache=.npm-cache --provenance --access public"},"keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"author":{"name":"Faraazuddin Mohammed","url":"https://github.com/faraa2m"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/faraa2m/ast-ai-model-router.git"},"homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","publishConfig":{"registry":"https://registry.npmjs.org","access":"public","provenance":true},"dependencies":{"@babel/parser":"^7.28.5","@tokenometer/core":"^2.1.0"},"devDependencies":{"@changesets/cli":"^2.31.0"},"engines":{"node":">=26"},"gitHead":"15d45f760bd86d3319f86237e8c6a7294bdc3543","_id":"@ast-ai-model-router/cli@2.0.3","bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"_nodeVersion":"26.4.0","_npmVersion":"11.18.0","dist":{"integrity":"sha512-prwE5GrCixNzhWJBxKOXJTBwZCcd8d8mt2pvSHVbt8YO608Lue9z528ATx/3Pi1Y3P3eJdezh4iSes4OvKUI1Q==","shasum":"91b7045aa8942d2a014a35f2d6c1615eb39babd4","tarball":"https://registry.npmjs.org/@ast-ai-model-router/cli/-/cli-2.0.3.tgz","fileCount":18,"unpackedSize":50398,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ast-ai-model-router%2fcli@2.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIG39kr7dhCisQ5YkqqLnhQ2JBYQrKs/DAFcPtVyJGODIAiBLZwTABj4nciNWwd6ufnjtV1+OhdVObjhzMmi2Xg0niQ=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:33d7afca-195c-4586-a078-c4c176b13e12"}},"directories":{},"maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cli_2.0.3_1783275486548_0.6658619198450872"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T13:59:43.392Z","modified":"2026-07-05T18:18:07.009Z","0.1.1":"2026-05-18T13:59:43.625Z","1.0.0":"2026-05-18T14:54:53.197Z","1.1.0":"2026-05-19T13:02:12.676Z","2.0.0":"2026-05-19T14:17:34.936Z","2.0.1":"2026-05-20T15:18:48.732Z","2.0.2":"2026-05-25T02:43:25.404Z","2.0.3":"2026-07-05T18:18:06.685Z"},"bugs":{"url":"https://github.com/faraa2m/ast-ai-model-router/issues"},"author":{"name":"Faraazuddin Mohammed","url":"https://github.com/faraa2m"},"license":"MIT","homepage":"https://github.com/faraa2m/ast-ai-model-router#readme","keywords":["llm","ai-coding-agent","token-economics","llm-cost-optimization","model-router","model-selection","claude-code","claude-code-model-router","codex","codex-cli","codex-model-router","ast","prompt-cost","developer-tools","ci"],"repository":{"type":"git","url":"git+https://github.com/faraa2m/ast-ai-model-router.git"},"description":"AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.","maintainers":[{"name":"faraa2m","email":"mohdfaraaz1@gmail.com"}],"readme":"# AST AI Model Router\n\n[![npm](https://img.shields.io/npm/v/@ast-ai-model-router/cli.svg?label=%40ast-ai-model-router%2Fcli)](https://www.npmjs.com/package/@ast-ai-model-router/cli)\n[![CI](https://github.com/faraa2m/ast-ai-model-router/actions/workflows/ci.yml/badge.svg)](https://github.com/faraa2m/ast-ai-model-router/actions/workflows/ci.yml)\n[![npm smoke](https://github.com/faraa2m/ast-ai-model-router/actions/workflows/npm-smoke.yml/badge.svg)](https://github.com/faraa2m/ast-ai-model-router/actions/workflows/npm-smoke.yml)\n[![License: MIT](https://img.shields.io/github/license/faraa2m/ast-ai-model-router.svg)](LICENSE)\n[![GitHub stars](https://img.shields.io/github/stars/faraa2m/ast-ai-model-router.svg?style=social)](https://github.com/faraa2m/ast-ai-model-router/stargazers)\n\nAST-based Claude Code and Codex model router for developers who want explainable AI coding-agent model selection, token-cost visibility, and CI policy checks.\n\n`ast-ai-model-router` inspects the current task, JavaScript/TypeScript ASTs, Python ASTs, and repo shape, then recommends or launches Claude Code / Codex with the right model tier. It is deterministic, local-first, and designed for both personal coding workflows and production team guardrails.\n\n## Why Use It\n\n- Avoid defaulting every coding-agent task to the strongest model.\n- Keep simple documentation and explanation tasks on cheaper/faster models.\n- Escalate refactors, migrations, security, auth, database, and architecture work.\n- Get a readable rationale for every model decision.\n- Add CI checks for max model tier and estimated prompt cost.\n- Connect local coding-agent routing to the same token-economics stack as Tokenometer and RouterLab.\n\n## Install\n\n```bash\nnpm install -g @ast-ai-model-router/cli\n```\n\nRun without installing:\n\n```bash\nnpx --yes --package @ast-ai-model-router/cli ast-ai-model-router --help\nnpx --yes @ast-ai-model-router/cli --version\n```\n\n## Quick Start\n\nInitialize config in a repo:\n\n```bash\nast-ai-model-router init\n```\n\nAnalyze a Claude Code task:\n\n```bash\nast-ai-model-router analyze --agent claude --task \"write docs for the parser\" \n```\n\nExplain the decision:\n\n```bash\nast-ai-model-router explain --agent codex --task \"refactor auth middleware and add regression tests\"\n```\n\nPreview a launch command without starting an agent:\n\n```bash\nast-ai-model-router run codex --task \"fix failing Python AST tests\" --dry-run -- --cd .\n```\n\nLaunch Codex with the selected model:\n\n```bash\nast-ai-model-router run codex --task \"fix failing Python AST tests\" -- --cd .\n```\n\nLaunch Claude Code with the selected alias:\n\n```bash\nast-ai-model-router run claude --task \"plan a cross-module database migration\" -- --permission-mode plan\n```\n\nRoute each prompt through a gateway session:\n\n```bash\nast-ai-model-router gateway codex -- --sandbox workspace-write\n```\n\nPreview one gateway turn without launching an agent:\n\n```bash\nast-ai-model-router gateway claude --once --task \"write docs for this repo\" --dry-run -- --permission-mode plan\n```\n\n## CI And Team Policy\n\nFail if a task would exceed the allowed tier:\n\n```bash\nast-ai-model-router ci \\\n  --agent claude \\\n  --task \"plan a production database migration\" \\\n  --max-tier complex\n```\n\nFail if Tokenometer can estimate the task prompt above your budget:\n\n```bash\nast-ai-model-router ci \\\n  --agent codex \\\n  --task \"review this large auth refactor\" \\\n  --max-cost-usd 0.001\n```\n\nMachine-readable decision output:\n\n```bash\nast-ai-model-router analyze --agent codex --task \"write tests\" --json\n```\n\nThe JSON includes `selectedModel`, `tier`, `confidence`, `signals`, `rationale`, `warnings`, `costEstimate`, `policy`, and `commandPreview`.\n\n## Per-Turn Gateway\n\n`run` chooses one model before launching a Claude Code or Codex session. `gateway` is different: it keeps a small router prompt open, scores every message you type, then invokes the selected agent model for that turn.\n\n```bash\nast-ai-model-router gateway claude -- --permission-mode plan\nast-ai-model-router gateway codex -- --sandbox workspace-write\n```\n\nInside the gateway, type a prompt and press Enter. Use `/exit` or `/quit` to stop.\n\nFor single-turn automation or CI smoke tests:\n\n```bash\nast-ai-model-router gateway codex --once --task \"add regression tests for parser errors\" --dry-run\n```\n\nThe gateway uses non-interactive agent execution:\n\n- Claude Code: `claude --print --model <selected-model> ... <prompt>`\n- Codex: `codex exec --model <selected-model> ... <prompt>`\n\nThis is not an invisible hook inside an already-running Claude Code or Codex TUI. To route every turn, enter prompts through `ast-ai-model-router gateway ...`.\n\n## How Routing Works\n\nThe router scores four groups of signals:\n\n- Prompt intent: docs, tests, debugging, refactors, architecture, security, migrations.\n- Repo shape: file count, AST file count, package/build/config files.\n- AST complexity: functions, classes, branches, imports, and language mix.\n- Agent model catalog: Codex models are discovered through `codex debug models`; Claude Code uses dynamic aliases.\n\nClaude Code targets are aliases, not dated model names:\n\n- `simple` -> `haiku`\n- `balanced` -> `sonnet`\n- `complex` -> `opus`\n- `planning` -> `opusplan`\n\nCodex targets are selected from the installed Codex model catalog. If discovery fails, the router falls back to configured defaults.\n\n## Token-Cost Estimates\n\nCost estimates use [`@tokenometer/core`](https://github.com/faraa2m/tokenometer) when the selected model maps to a known provider model.\n\nExamples:\n\n- Claude alias `haiku` maps to `claude-haiku-4-5`.\n- Claude alias `sonnet` maps to `claude-sonnet-4-6`.\n- Codex `gpt-5.4-mini`, `gpt-5.4`, and `gpt-5.5` map to the matching Tokenometer model IDs.\n\nIf a model cannot be mapped, routing still works and the decision includes a warning:\n\n```text\nCost estimate unavailable: No Tokenometer model mapping for codex model \"...\"\n```\n\nCost estimates are for the task prompt text, not source-file contents. This keeps the tool privacy-preserving and fast by default.\n\n## Configuration\n\n`ast-ai-model-router init` writes `model-router.config.json`:\n\n```json\n{\n  \"thresholds\": {\n    \"simpleMax\": 34,\n    \"balancedMax\": 74\n  },\n  \"claude\": {\n    \"aliases\": {\n      \"simple\": \"haiku\",\n      \"balanced\": \"sonnet\",\n      \"complex\": \"opus\",\n      \"planning\": \"opusplan\"\n    }\n  },\n  \"codex\": {\n    \"discoveryCommand\": \"codex debug models\",\n    \"fallbackModels\": {\n      \"simple\": \"gpt-5.4-mini\",\n      \"balanced\": \"gpt-5.4\",\n      \"complex\": \"gpt-5.5\",\n      \"planning\": \"gpt-5.5\"\n    }\n  },\n  \"policy\": {\n    \"maxTier\": \"planning\",\n    \"maxCostUsd\": null\n  },\n  \"logging\": {\n    \"enabled\": false,\n    \"path\": \".model-router/decisions.jsonl\"\n  }\n}\n```\n\nDecision logging is disabled by default. When enabled with config or `--log`, logs store model decisions and scores, not source code.\n\n## Exit Codes\n\n- `0`: success\n- `1`: runtime failure\n- `2`: invalid input or config\n- `3`: policy failure\n\n## Plugin Support\n\nThis repo includes:\n\n- `.codex-plugin/plugin.json`\n- `.claude-plugin/plugin.json`\n- `skills/model-router/SKILL.md`\n\nUse the plugin locally:\n\n```bash\nclaude --plugin-dir .\ncodex plugin marketplace add .\n```\n\n## Token Economics Stack\n\nThis project is part of the [`faraa2m`](https://github.com/faraa2m) token-economics ecosystem:\n\n- [`tokenometer`](https://github.com/faraa2m/tokenometer): token counts, USD cost, latency benchmarks, and CI prompt-cost guardrails.\n- [`llm-tokens-atlas`](https://github.com/faraa2m/llm-tokens-atlas): empirical tokenizer calibration dataset.\n- [`routerlab`](https://github.com/faraa2m/routerlab): cost-quality routing frontiers for LLM APIs.\n- [`promptc`](https://github.com/faraa2m/promptc): deterministic prompt compiler for cost reduction.\n- `ast-ai-model-router`: model routing for local coding agents.\n\n## Privacy\n\nThe router reads local source files to compute AST complexity and launches the local `claude` or `codex` CLI. It does not run a separate network service and does not upload source code. Any model traffic comes from the Claude Code or Codex CLI you choose to run.\n\n## Project Health\n\n- [Contributing guide](./CONTRIBUTING.md)\n- [Security policy](./SECURITY.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n- [Changelog](./CHANGELOG.md)\n\n## Status\n\nThis is an explainable heuristic router. It is production-usable for policy and workflow guardrails, but it does not claim empirically proven model-quality optimization yet. Future releases can add outcome logging and calibration against real task success.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}