All docs pages

DocsHow-to guides

Configure agents

Point Codex, Hermes, opencode and Claude Code at a model running in ModelDeck.

Where to find it

Configure agents is a panel on the Server screen (⌘5). It appears while the server is running and a model is selected under Loaded models. It points a coding agent on your Mac at the local server and that model.

The panel has one row per agent, in this order: Hermes, Codex CLI, OpenCode and Claude Code. Each row shows a status and the config file it would change:

StatusMeaning
ConfiguredThe agent's config points at this server and model.
Out of dateThe config has a ModelDeck entry, but its model, address or key differ from the live ones. Apply again to update it.
Not configuredThe config has no ModelDeck entry.
Prompt onlyModelDeck does not edit this agent's files. Use Copy prompt.

Apply a change

  1. Select the model under Loaded models.
  2. Click Apply on the agent's row. ModelDeck shows the exact lines it would add or change, with the key masked.
  3. Click Write change, or Cancel. If nothing would change, it says Already up to date.

Apply edits only that agent's own config file. Before the first change ModelDeck saves a copy of the file next to it, named like config.toml.modeldeck-20261118T091500.bak. If ModelDeck created the file, it leaves an empty .absent marker instead. ModelDeck checks the edited file parses before and after writing it, and puts the original back if anything fails.

Revert appears once a backup exists. It restores the file as it was before ModelDeck first changed it, and removes the backup. Edits you made to that file after applying are lost, so copy them first.

In the snippets below, <base URL> is the address Copy URL copies on the Server screen, ending in /v1. ModelDeck fills in the real values when it writes the file.

Copy prompt copies a setup prompt you can paste into any agent so it configures itself. The prompt includes the server address, the model id, the exact snippet, and the server's API key if one is set.

Hermes

File: ~/.hermes/config.yaml. ModelDeck adds a modeldeck provider inside the file's providers: map, between marker lines:

# modeldeck:begin
  modeldeck:
    api: <base URL>
    api_key: "<key>"
    transport: chat_completions
    discover_models: true
    default_model: <model id>
# modeldeck:end

api_key is written only when the server has a key, and it is stored in the file as plain text. To undo by hand, delete the lines between the markers.

The Model catalog section has a Use with Hermes note. Hermes's catalog picker reads only its own providers, so add ModelDeck as a provider like this rather than pointing Hermes's catalog URL at ModelDeck.

Codex CLI

File: ~/.codex/config.toml. ModelDeck appends a provider and a profile between marker lines:

# modeldeck:begin
[model_providers.modeldeck]
name = "ModelDeck"
base_url = "<base URL>"
wire_api = "chat"
env_key = "MODELDECK_API_KEY"

[profiles.modeldeck]
model = "<model id>"
model_provider = "modeldeck"
# modeldeck:end

Your default model is not changed. Start Codex with the profile:

codex --profile modeldeck

env_key is added only when the server has a key. The key stays out of the file; put it in your shell profile:

export MODELDECK_API_KEY="the key from Settings > Local server"

OpenCode

File: ~/.config/opencode/opencode.json. ModelDeck adds a modeldeck provider and sets OpenCode's default model to it. Your other settings and models are kept.

{
  "provider": {
    "modeldeck": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "ModelDeck",
      "options": { "baseURL": "<base URL>", "apiKey": "<key, only if set>" },
      "models": { "<model id>": { "name": "<model id>" } }
    }
  },
  "model": "modeldeck/<model id>"
}

ModelDeck refuses to edit a file that is not valid JSON and tells you so.

Claude Code

The Claude Code row is Prompt only: ModelDeck does not write any Claude Code file. Copy prompt gives a prompt that sets up claude-code-router, a separate open source tool, to send Claude Code's requests to ModelDeck. It installs the router, writes ~/.claude-code-router/config.json and starts Claude Code through it with ccr code. It does not change ~/.claude/settings.json.

You can also point Claude Code straight at ModelDeck's Anthropic Messages endpoint, without a router. Set these in the shell where you start Claude Code. Use the base URL without its /v1, and the model's id from the Server screen for every model variable, because Claude Code asks for its own small model for background calls:

export ANTHROPIC_BASE_URL="<base URL without the /v1 at the end>"
export ANTHROPIC_API_KEY="the ModelDeck API key, or any text if none is set"
export ANTHROPIC_MODEL="<model id>"
export ANTHROPIC_SMALL_FAST_MODEL="<model id>"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="<model id>"
export ANTHROPIC_DEFAULT_SONNET_MODEL="<model id>"
export ANTHROPIC_DEFAULT_OPUS_MODEL="<model id>"
claude

Claude Code may print an unrecognized_model notice for a model id it does not know. It is harmless. Thinking blocks and prompt caching are not supported by the endpoint; see what is supported.

The Configure agents panel does not set up this direct route yet, and some text in the app still says Claude Code cannot use ModelDeck without a router. The endpoint is in every release since 1.1.0.

Any other agent

Any tool that takes an OpenAI-compatible base URL can use ModelDeck: give it the address from Copy URL, the model id from the Server screen, and the API key if you set one. The API tab on the Server screen has curl, Python, JavaScript and Hermes snippets to copy.

These docs describe ModelDeck as of app commit 7d38f80, checked 2026-12-03. Features merged after the latest release are marked Coming in the next release.