Guide3 min read

Run Claude Code on Fast Inference

Connect Claude Code to Fast Inference with one reversible command, choose an open model, and verify live usage.

Fast Inference

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.

Install and authenticate the CLI

  1. Install fast

    Use the package manager already installed on your machine.

    bash
    npm install -g @inference/fast
  2. Sign in through the dashboard

    bash
    fast login

    Approve the browser flow. The CLI selects the same first project used by the Fast Inference dashboard.

  3. Confirm the session

    bash
    fast status

    Status 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:

bash
fast claude on

The 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.

SlotClaude Code settingDefault
MainANTHROPIC_MODELglm-5.2
OpusANTHROPIC_DEFAULT_OPUS_MODELglm-5.2
SonnetANTHROPIC_DEFAULT_SONNET_MODELglm-5.2
HaikuANTHROPIC_DEFAULT_HAIKU_MODELglm-5.2
FableANTHROPIC_DEFAULT_FABLE_MODELglm-5.2
SubagentsCLAUDE_CODE_SUBAGENT_MODELglm-5.2

Choose a different model

Copy a callable ID from the model catalog, then run the adapter again with --model:

bash
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:

bash
fast claude status

Start 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:

bash
fast claude off

The command restores the original settings.json snapshot and removes the backup. Restart Claude Code once more after restoring.

Troubleshooting

  • If status says off, rerun fast claude on and restart Claude Code.
  • If requests return 401, run fast status and 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.json before reconnecting.

For exact file paths and adapter behavior, keep the Claude Code reference guide nearby.

npm install openaibaseURL: "https://api.inference.net/v1"ship it