All docs pages

DocsTutorials

Connect a coding agent

Point Codex, OpenCode or Hermes at a local model through ModelDeck's server, and check that it answers.

This tutorial connects a coding agent on your Mac to a model running in ModelDeck. You need a model loaded; if you have none, do Run your first model first.

What you will do
  1. Check the serverIt starts with ModelDeck
  2. Test it from TerminalOne request with curl
  3. Configure the agentApply, and review the diff
  4. Run the agentAgainst the local model
  5. Watch the requestsIn Live requests

1. Check the server

Open Server (⌘5). The header says Running at and an address. Click Copy URL.

In Terminal, keep the address in a variable:

export MODELDECK_URL="http://127.0.0.1:8099/v1"   # or the address from Copy URL, if you changed the port
If you see "Stopped"

Click Start server. If it says the port is already in use, quit the app that holds it, or choose another port in Settings > Local server.

2. Test it

Select your model under Loaded models. The Overview tab shows Model id for apps. Use it in a request:

curl "$MODELDECK_URL/chat/completions" -H "Content-Type: application/json" \
  -d '{"model":"<model id for apps>","messages":[{"role":"user","content":"Say hello in five words."}]}'

Expected result

A JSON reply with the model's answer in choices[0].message.content. The request appears at the top of Live requests on the Server screen.

If you see 401 "Invalid or missing API key"

You set an API key in Settings > Local server. Add -H "Authorization: Bearer <key>" to the request.

If you see 404 "is not loaded and not in the library"

The model value does not match. Copy Model id for apps again. Every MLX model is served as default_model.

3. Configure the agent

With the server running and your model selected, scroll to Configure agents on the Server screen. Pick your agent:

Codex CLI

Click Apply on the Codex CLI row. ModelDeck shows the lines it will add to ~/.codex/config.toml: a modeldeck provider and a modeldeck profile. Click Write change.

Your default model does not change. Start Codex with the profile:

codex --profile modeldeck

OpenCode

Click Apply on the OpenCode row. ModelDeck shows the change to ~/.config/opencode/opencode.json: a modeldeck provider, and OpenCode's default model set to it. Click Write change, then start OpenCode as usual.

Hermes

Click Apply on the Hermes row. ModelDeck adds a modeldeck provider to ~/.hermes/config.yaml. Click Write change, then start Hermes and pick the ModelDeck model.

Claude Code

Claude Code is Prompt only: ModelDeck does not edit its files. Follow Configure agents: Claude Code to point it at ModelDeck's Anthropic endpoint, or use Copy prompt to set up a router.

Expected result

The agent's row says Configured. ModelDeck saved a backup of the file before changing it, and Revert puts it back.

4. Run the agent

Give the agent a small task. Watch Live requests on the Server screen: each request shows the client, model, tokens and speed, and the loaded model's card shows requests in flight.

If you see "Out of date" on the agent's row

The model, address or key changed since you applied. Click Apply again.

If you see The agent waits, then fails with a 503

The model was not loaded and the memory check refused to load it. Load it yourself from the Server screen, or see Troubleshooting.

Next

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.