Check out the newest way to compare different models for a task/agent harness: AutoEvals

Coding Agents

Coding Agents

Route Claude Code, Codex, Grok, OpenCode, and Pi through the Inference.net gateway from the CLI.

Use inf claude, inf codex, inf grok, inf opencode, or inf pi to route a local coding agent through Inference.net. Use off to restore its previous configuration.

These commands change the coding agent's model traffic. inf instrument changes an application's LLM clients for observability.

Quick start

Install or update the CLI

npm install -g @inference/cli

Sign in

inf auth login

Connect one agent

inf claude on

How it works

on writes the gateway URL, key, and model selection to the agent's config. It also records which fields inf owns.

status reports whether the agent is routed through Inference.net and whether you changed any owned field since on.

off restores owned fields unless you changed them after on.

Model mapping

The CLI writes one of three catalog aliases. Every alias supports tool calling.

AliasContext windowMax output tokensUsed for
kimi-k3-fast1,048,576131,072long-context default, main driver
glm-5.2-fast262,144128,000shorter-context Fast-tier alternative
deepseek-v4-flash-07311,048,575384,000cheap and fast slots

Claude Code maps six slots to Anthropic tier names.

SlotFlagDefault
Main--mainkimi-k3-fast
Opus--opuskimi-k3-fast
Sonnet--sonnetkimi-k3-fast
Haiku--haikudeepseek-v4-flash-0731
Fable--fablekimi-k3-fast
Subagents--subagentsdeepseek-v4-flash-0731

Codex, Grok, OpenCode, and Pi have no tier system. They default to kimi-k3-fast and take a single --model <alias> flag. OpenCode and Pi register all three aliases in their provider registry, so you can switch models inside the harness without re-running on. Grok registers one section per alias (inference-glm-5.2-fast, inference-kimi-k3-fast, inference-deepseek-v4-flash-0731). Codex sets the root model key.

The gateway serves Claude Code on its native Anthropic surface (/v1/messages). It serves the other agents on the OpenAI-compatible surface (https://api.inference.net/v1): Responses for Codex, chat completions for Grok, OpenCode, and Pi.

Gateway key and authentication

inf <agent> on needs a gateway key. It resolves one in this order:

  1. INFERENCE_API_KEY environment variable (never persisted).
  2. The project key stored by inf auth set-key.
  3. A coding-agent key minted on a previous run (stored in ~/.inf/config.json).
  4. If none of the above, an authenticated session mints one project-scoped key.

One key is shared by all five agents. Before it changes an agent config, inf saves a minted key to ~/.inf/config.json. This prevents an interrupted on from losing the key. The server stores only its hash, so the local file is the only copy of the raw value.

Coding-agent commands do not take an --api-key flag. Secrets never travel through argv, shell history, or process listings. --json and human output show only a masked preview (inf_sk_a...9f2c), never the raw key.

See Authentication for session and API key details. See Troubleshooting to revoke a key.

Safe reversal

inf owns specific fields, not the whole config file. On the first on, it records each original value. off restores a field only when its current value matches a value that inf wrote. It leaves your later edits in place.

status reports drift per field:

  • active: the field matches what inf wrote.
  • modified: you changed it since on.
  • missing: you deleted it.

Run inf <agent> off to revert. Restart the agent after on or off.

An upgrade does not change an existing connection. Re-run inf <agent> on to apply new defaults. off can still restore the values from before your first on.

See Troubleshooting for the full conflict table and the moved-config-directory case.

Choose an agent

On this page