Long coding-agent runs amplify every second of model latency. The Inference Fast CLI lets Claude Code call a fast hosted open model through a native Anthropic-compatible endpoint, while preserving a byte-for-byte snapshot of your original configuration.
Before you connect
You need Node.js, Claude Code, and a Fast Inference account. The connection flow uses browser approval, selects the first project in your personal workspace, and creates one machine-scoped API key when needed.
The CLI creates and stores its machine key itself. Raw credentials stay out of your command history and are reused across supported coding-agent adapters.
Install and authenticate the CLI
Install fast
Use the package manager already installed on your machine.
npm install -g @inference/fastSign in through the dashboard
fast loginApprove the browser flow. The CLI selects the same first project used by the Fast Inference dashboard.
Confirm the session
fast statusStatus shows the account, project, endpoints, machine key, and connection state for each supported coding agent.
Route Claude Code through Fast Inference
Enable the adapter with the default model:
fast claude onThe command writes the endpoint and model map to ~/.claude/settings.json and
saves the original file under ~/.inference-fast/backups. Restart Claude Code
after it completes.
Claude Code uses six named model slots. Fast points every slot at the selected catalog model so main prompts, tool use, and subagents stay on the same route.
| Slot | Claude Code setting | Default |
|---|---|---|
| Main | ANTHROPIC_MODEL | glm-5.2 |
| Opus | ANTHROPIC_DEFAULT_OPUS_MODEL | glm-5.2 |
| Sonnet | ANTHROPIC_DEFAULT_SONNET_MODEL | glm-5.2 |
| Haiku | ANTHROPIC_DEFAULT_HAIKU_MODEL | glm-5.2 |
| Fable | ANTHROPIC_DEFAULT_FABLE_MODEL | glm-5.2 |
| Subagents | CLAUDE_CODE_SUBAGENT_MODEL | glm-5.2 |
Choose a different model
Copy a callable ID from the model catalog, then run the adapter again
with --model:
fast claude on --model <catalog-id>Running on again updates the managed settings while retaining the original
restoration snapshot. This makes model comparisons quick without losing your
pre-Fast configuration.
Verify the live route
Check the adapter state:
fast claude statusStart a new Claude Code session and send a short prompt. Then open Usage. The request should appear with the selected Fast Inference model, token counts, and spend.
Restore your original settings
Disconnect Claude Code with:
fast claude offThe command restores the original settings.json snapshot and removes the
backup. Restart Claude Code once more after restoring.
The adapter restores its saved snapshot byte-for-byte. If you intentionally
edited settings.json after running on, preserve those changes before
running off.
Troubleshooting
- If status says
off, rerunfast claude onand restart Claude Code. - If requests return 401, run
fast statusand reconnect the agent. - If a model is rejected, choose a currently callable ID from the model catalog.
- If the configuration cannot be parsed, repair
settings.jsonbefore reconnecting.
For exact file paths and adapter behavior, keep the Claude Code reference guide nearby.