{"slug": "per-task-model-routing-for-native-codex", "title": "Per-task model routing for native Codex", "summary": "ModelRudder released v0.1.0-preview.4, an MIT-licensed experimental per-task model routing tool that adds a native Mods adapter to Codex and Claude Code, letting users route each turn to Haiku, Sonnet or Opus with one decision held through each tool loop. The free local community preview requires Node 24+, a supported Codex version, and Claude Code 2.1.293 or newer within the 2.1.x line, and uses the user's own provider account plus a TypeSafe Jev API key with no ModelRudder account or subscription. The installer bundles smart-codex and smart-claude, and the project states native Claude effort, model availability and safety fallback remain authoritative, no subscription limit is bypassed, and savings are not guaranteed.", "body_md": "Spend your strongest model on the tasks that need it. ModelRudder adds experimental model routing to native coding tools, while they retain their tools, approvals and workspace permissions.\n\n**Free local community preview · MIT licensed · macOS, Linux/WSL and Windows preview**\n\nUse your own native provider account and your own TypeSafe Jev API key. This preview requires no ModelRudder account or subscription. Provider charges and usage limits still apply. Clef support is not included.\n\n**Experimental Claude preview:** Claude Code now has a native Mods adapter for per-user-turn Haiku/Sonnet/Opus routing, with one decision held through each tool loop. The preview.4 installer bundles `smart-claude` alongside `smart-codex`; read [Claude support, installation and verification limits](https://github.com/cybrking/modelrudder/blob/main/docs/CLAUDE_CODE.md) first. Native Claude effort, model availability and safety fallback remain authoritative. No subscription limit is bypassed, and savings are not guaranteed.\n\nCopy this entire prompt into Codex. It will install ModelRudder and open the local configuration file; you enter your Jev key privately in the editor.\n\n```\nInstall ModelRudder on this computer so I can use model routing in Codex.\nUse the official release: https://github.com/cybrking/modelrudder/releases/tag/v0.1.0-preview.4\nRead the README and docs/AGENT_INSTALL.md at that release tag and follow them.\n\nDetect my OS and check Node.js and Codex. Install missing prerequisites using\nthe official instructions; ModelRudder requires Node 24+ and a supported Codex\nversion. Preserve existing credentials and configuration, and explain any\nincompatible Codex version before changing it.\n\nDownload the release installer and SHA256SUMS, verify the checksum, install\nfor my user account, and add its launcher directory to my user PATH without\nremoving existing entries. Verify smart-codex --help.\n\nRun smart-codex setup to open my private Jev configuration in a local editor.\nShow me https://console.typesafe.ai/keys so I can sign up and get my own key.\nNever read or print the key file or ask me to paste a key into chat. Leave new\nclassification disabled until I enter the key and explicitly enable it.\n\nCheck my Codex login without replacing it. If login is needed, guide me through\nthe official codex login flow. Run smart-codex doctor, explain anything still\nneeded, and give me the command to start in a fresh terminal. Do not submit\npaid model tasks automatically.\n```\n\nIf an editor cannot open, Codex can give you the file path to open manually. [Detailed agent instructions](https://github.com/cybrking/modelrudder/blob/main/docs/AGENT_INSTALL.md) cover Windows, Linux/WSL and macOS.\n\nCopy this entire prompt into Claude Code. It will install ModelRudder and open the local configuration file; you enter your Jev key privately in the editor.\n\n```\nInstall ModelRudder on this computer so I can use model routing in Claude Code.\nUse the official release: https://github.com/cybrking/modelrudder/releases/tag/v0.1.0-preview.4\nRead the current Claude installation guides before continuing:\nhttps://github.com/cybrking/modelrudder/blob/main/docs/AGENT_INSTALL.md\nhttps://github.com/cybrking/modelrudder/blob/main/docs/CLAUDE_CODE.md\n\nDetect my OS and check Node.js and Claude Code. Install missing prerequisites\nusing official instructions; ModelRudder requires Node 24+ and Claude Code\n2.1.293 or newer within the 2.1.x line. Preserve existing credentials,\nconfiguration and permissions. Explain any incompatible version or login\nbefore changing it. Codex is not required to use smart-claude.\n\nDownload the release installer and SHA256SUMS, verify the checksum, install\nfor my user account, and add its launcher directory to my user PATH without\nremoving existing entries. The smart-codex-named preview.4 installer bundles\nboth smart-codex and smart-claude; no source build is needed. Verify\nsmart-claude --help. Do not replace plain claude or an unmanaged launcher.\n\nRun smart-claude setup to open my private Jev configuration in a local editor.\nShow me https://console.typesafe.ai/keys so I can sign up and get my own key.\nNever read or print the key file or ask me to paste a key into chat. Leave new\nclassification disabled until I enter the key and explicitly enable it.\nExplain that observe/auto sends eligible task text and bounded earlier task\nexcerpts to TypeSafe, and requires the direct Jev classifier.\n\nCheck my native Claude login without replacing it. If login is needed, guide\nme through the official claude auth login flow. Run smart-claude doctor and\nexplain anything still needed. Preserve native plugin trust and organization\npolicy; do not bypass either. Give me smart-claude --routing observe to run\nin a fresh terminal after setup. Do not submit model tasks or classifier\nrequests automatically.\n```\n\nIf an editor cannot open, Claude Code can give you the file path to open manually. Once you have checked observe mode, try `smart-claude --routing auto`, or use `smart-claude --model sonnet` for pinned mode without Jev classification. See [Claude support and verification limits](https://github.com/cybrking/modelrudder/blob/main/docs/CLAUDE_CODE.md); live task quality and full cross-platform TUI behavior remain unverified.\n\n- Node.js 24 or newer, installed separately. The installer does not bundle Node, Codex or Claude Code.\n- macOS, Linux/WSL, or Windows 11 with PowerShell. Native Windows support is a preview; ModelRudder's full Windows TUI has not been validated. WSL is an alternative if your native setup fails; install and sign in separately inside WSL. See [OpenAI's Windows guidance](https://learn.chatgpt.com/docs/windows/windows-sandbox) .\n- For `smart-codex` , an independently installed Codex CLI. Exactly versions**0.159.3, 0.160.1 and 0.161.0** have recorded protocol evidence and are accepted by this preview. Full interactive TUI compatibility is not certified; other versions are rejected. See the[release-readiness results](https://github.com/cybrking/modelrudder/blob/main/docs/RELEASE_READINESS.md) for completed checks and remaining gaps. Claude's separate requirements are in[CLAUDE_CODE.md](https://github.com/cybrking/modelrudder/blob/main/docs/CLAUDE_CODE.md) .\n- For `smart-codex` , native ChatGPT login through`codex login` . For`smart-claude` , an independently installed Claude Code 2.1.293+ within 2.1.x and native`claude.ai` login; Codex is not required.\n- Your own TypeSafe Jev API key for observe/auto modes. Pinned mode works without classification.\n\nOpenAI describes continuation of existing local/open-source app-server applications separately from commercial/hosted authentication. This release does not establish permission to operate a paid subscription-auth service. See [OpenAI guidance](https://learn.chatgpt.com/docs/app-server#auth-endpoints). ModelRudder is an independent project, with no claimed provider endorsement.\n\nDownload the installer and `SHA256SUMS` from [Releases](https://github.com/cybrking/modelrudder/releases). Keep them in the same directory and verify the checksum before running the installer filename shown on that release:\n\n```\nshasum -a 256 -c SHA256SUMS\nnode -- ./smart-codex-RELEASE_ID-install.mjs\n```\n\nReplace `RELEASE_ID` with the actual release ID in the downloaded filename. Obtain both files from this project's trusted release page; a checksum alone does not authenticate a publisher. The installer needs no checkout or npm download and includes the ws dependency and license. On macOS/Linux, it installs versioned runtime files under `~/.local/share/smart-codex` and a launcher under `~/.local/bin`; add that bin directory to PATH. It does not replace plain `codex` or an unmanaged launcher.\n\nOn Windows, use PowerShell's `Get-FileHash -Algorithm SHA256` and compare the installer hash to its exact filename in `SHA256SUMS`, then run `node -- .\\smart-codex-RELEASE_ID-install.mjs`. The default runtime, launcher and configuration are under `%LOCALAPPDATA%\\ModelRudder\\runtime`, `\\bin` and `\\config\\env`, respectively. Use the paths printed by the installer and add its launcher directory to your **user** PATH. Agent-assisted installation instructions are in [AGENT_INSTALL.md](https://github.com/cybrking/modelrudder/blob/main/docs/AGENT_INSTALL.md).\n\nAlternatively, build from a trusted source checkout:\n\n```\nnpm ci --ignore-scripts\nnpm test\nnpm run typecheck\nnpm run install-cli\n```\n\nCreate and open your private Jev configuration in a local editor:\n\n```\nsmart-codex setup\n```\n\nSetup preserves an existing file. Agents and terminals without a desktop can use `smart-codex setup --no-open` to create the template and print its path without opening an editor. The configuration starts with three editable settings and classification disabled:\n\n```\nTYPESAFE_API_KEY=\nALLOW_JEV_CLASSIFICATION=false\nSMART_CODEX_CLASSIFIER=direct\n```\n\nIf needed, sign up and create your key at the [official TypeSafe dashboard](https://console.typesafe.ai/keys), linked by the [Jev quickstart](https://docs.typesafe.ai/introduction/quickstart). Enter your key privately in the local editor and change `ALLOW_JEV_CLASSIFICATION` from `false` to `true` after reviewing the data flow below. Keep credentials out of agent chat, command arguments and source control. Existing exported environment variables take precedence over the configuration file. Leaving `ALLOW_JEV_CLASSIFICATION=false` keeps Jev disabled; pinned mode remains available.\n\n```\nsmart-codex doctor\nsmart-codex --routing observe --effort-mode fixed\n```\n\nObserve mode gets route recommendations while Sol executes the task. Inspect your results before trying experimental automatic routing:\n\n```\nsmart-codex --routing auto --effort-mode auto\n```\n\nAutomatic mode chooses among Luna, Sol and Astra at each eligible new user turn and keeps that choice throughout its tool loop. Uncertain or unavailable classification keeps the fallback. Media, native references and unobserved history can prevent downgrading. The next auto/observe turn overrides native model-picker choices. An explicit `--model` selects pinned mode unless `--routing` is also supplied.\n\nTo use a pinned model without sending tasks to Jev:\n\n```\nsmart-codex --routing pinned --model gpt-6.1-sol\n```\n\nIn auto/observe mode, direct classification sends the current eligible text task and up to two bounded earlier task excerpts to TypeSafe. Anything pasted into that text, including source code or secrets, is included. The adapters do not automatically send repository files, assistant output or attachments to the classifier. Native Codex and Claude Code send their normal model inputs to their providers under your own account terms. Claude requires the direct classifier; the current hosted gateway has only a Codex rubric.\n\nThe child process does not receive the Jev key from ModelRudder's classifier environment. Each native tool manages its own login. Claude's mod contacts a launcher-local authenticated loopback bridge; it does not proxy Claude model requests or obtain Claude credentials. Local reports contain routing/usage metadata rather than task text; configuration and logs remain on your machine. Review provider policies before sending confidential content. The community client has no ModelRudder telemetry or hosted billing requirement.\n\n```\nsmart-codex report\nsmart-codex outcome --result accepted\nsmart-codex logs cleanup --older-than-days 30\n```\n\nOutcome markers are your own assessment, not independent validation. Cleanup is a preview unless `--apply` is supplied. Tokens and reference-price comparisons are estimates; they do not establish savings on a subscription bill or verified task quality.\n\nFor source users, upgrade by pulling an approved release, running `npm ci --ignore-scripts`, and rerunning `npm run install-cli`. Standalone users can install the next trusted release installer. Restart active launchers after an upgrade. Use the installed maintenance command:\n\n```\nnode -- ~/.local/share/smart-codex/current/src/install-cli.ts --list\nnode -- ~/.local/share/smart-codex/current/src/install-cli.ts --rollback RELEASE_ID\nnode -- ~/.local/share/smart-codex/current/src/install-cli.ts --uninstall\n```\n\nOn Windows, retain the verified installer and use `node -- .\\smart-codex-RELEASE_ID-install.mjs --list`, `--rollback RELEASE_ID` or `--uninstall` instead. Repeat any custom install-path flags used originally.\n\nUninstall retains your private configuration and local state. Remove those manually if you intend to discard them.\n\nAutomatic routing is experimental: classifier confidence is not a coding success probability. Full native TUI behavior, task quality and a general Codex compatibility range remain unqualified. Start with observe mode, inspect changes and run your own tests. The preview is not a production SLA or a guaranteed savings claim. See [release evidence](https://github.com/cybrking/modelrudder/blob/main/docs/RELEASE_EVIDENCE.md).\n\n```\nnpm ci --ignore-scripts\nnpm test\nnpm run typecheck\nnpm run package:pilot -- dist/delivery\n```\n\nClient CI runs offline fixtures and a no-inference native Codex protocol probe on Windows, Linux and macOS with Node 24 and 26; check the [workflow](https://github.com/cybrking/modelrudder/blob/main/.github/workflows/client.yml) and individual results for the operating systems tested. It makes no paid inference calls. `npm run test:native-protocol` is an optional installed-Codex check; it submits no model turn and does not certify the TUI, including on Windows.\n\nRead [contributing](https://github.com/cybrking/modelrudder/blob/main/CONTRIBUTING.md) and [security reporting](https://github.com/cybrking/modelrudder/blob/main/SECURITY.md). Licensed under [MIT](https://github.com/cybrking/modelrudder/blob/main/LICENSE); ws retains its [upstream MIT notice](https://github.com/cybrking/modelrudder/blob/main/THIRD_PARTY_NOTICES/ws-LICENSE).\n\n[Daily upstream checks](https://github.com/cybrking/modelrudder/blob/main/docs/UPSTREAM_UPDATES.md) detect new stable Codex and Claude Code releases once a day and run isolated candidate checks on macOS, Linux and Windows. Review the workflow reports before changing supported versions.", "url": "https://wpnews.pro/news/per-task-model-routing-for-native-codex", "canonical_source": "https://github.com/cybrking/modelrudder", "published_at": "2026-10-09 04:40:49+00:00", "updated_at": "2026-10-09 04:47:24.061440+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools", "large-language-models"], "entities": ["ModelRudder", "Codex", "Claude Code", "TypeSafe Jev", "Anthropic", "OpenAI", "smart-codex", "smart-claude"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/per-task-model-routing-for-native-codex", "markdown": "https://wpnews.pro/news/per-task-model-routing-for-native-codex.md", "text": "https://wpnews.pro/news/per-task-model-routing-for-native-codex.txt", "jsonld": "https://wpnews.pro/news/per-task-model-routing-for-native-codex.jsonld"}}