> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokios.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Tokios exposes private local models through https://api.tokios.com using an outbound-only connector tunnel.
> Use 'connector' for the local tokios-connector process.
> Use 'deployment' for the public model name in the API model field.
> Use 'upstream model id' for the model served by Ollama, llama.cpp, vLLM, LM Studio, or another local backend.
> API keys use the prefix sk-tok-. Connector tokens use the prefix ct-tok-.

# Use coding agents with local models

> Connect coding agents that support custom OpenAI or Anthropic endpoints to Tokios deployments backed by your local models.

Coding agents are a natural fit for Tokios because they can keep a stable API configuration while you change the local model behind it. Register a deployment once, point the agent at Tokios, then switch models by changing the `model` value.

## Pick the API shape

| Agent or client | API shape | Base URL | Setup guide |
| - | - | - | - |
| Claude Code | Anthropic-compatible | `https://api.tokios.com` | [Claude Code](https://docs.tokios.com/guides/claude-code.md) |
| OpenAI Codex | OpenAI Responses | `https://api.tokios.com/v1` | [OpenAI Codex](https://docs.tokios.com/guides/openai-codex.md) |
| Aider | OpenAI-compatible | `https://api.tokios.com/v1` | [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md) |
| Cline | OpenAI-compatible | `https://api.tokios.com/v1` | [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md) |
| Continue | OpenAI-compatible | `https://api.tokios.com/v1` | [Compatible clients](https://docs.tokios.com/guides/compatible-clients.md) |

Use your Tokios API key as the client API key. Use the deployment name you registered as the client model name.

## Recommended setup path

**1. Start with one known-good backend**

Run one local backend first, such as Ollama, llama.cpp, vLLM, or LM Studio. Confirm it serves an OpenAI-compatible `/v1/chat/completions` endpoint before adding the coding agent.

**2. Register one deployment**

Give the deployment a short, stable name such as `qwen-coder-local` or `gemma-tunnel`. This is the value the coding agent sends in the `model` field.

**3. Configure the agent**

Set the base URL for the API shape the agent uses. OpenAI-style clients usually use `https://api.tokios.com/v1`; Anthropic-style clients use `https://api.tokios.com`.

**4. Run a small task first**

Ask the agent to explain a small file or make a tiny change before sending a larger refactor. This confirms routing, streaming, and model behavior.

## What to compare

When you test coding agents with local models, compare the full workflow rather than only raw model speed.

| Signal | What it tells you |
| - | - |
| Time to first response | Whether the model and backend feel responsive enough for interactive work |
| Tokens per second | How quickly the local model generates once it starts |
| Task completion | Whether the model follows instructions and uses tool context well |
| Context handling | Whether the model can reason over the repository snippets the agent sends |
| Stability | Whether repeated requests keep working without restarting the backend |

> [!NOTE]
>
> A faster model is not always the better coding model. For agent workflows, instruction following and repository understanding matter as much as generation speed.

## Next steps

> [card] [Use Claude Code](https://docs.tokios.com/guides/claude-code.md)
>
> Configure `ANTHROPIC_BASE_URL` and `ANTHROPIC_API_KEY`.

> [card] [Use OpenAI Codex](https://docs.tokios.com/guides/openai-codex.md)
>
> Add Tokios as a Codex model provider in `config.toml`.

> [card] [Test your deployment](https://docs.tokios.com/guides/benchmark-your-deployment.md)
>
> Compare latency, streaming, and task behavior across deployments.

> [card] [Route multiple models](https://docs.tokios.com/guides/model-routing.md)
>
> Keep one endpoint and switch models with the `model` field.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.