Local models
Point a profile at Ollama, LM Studio, vLLM or llama.cpp on localhost. The server must be running, and the model must handle tool calls.
Do this for me on this machine: connect my local model server to sc as an endpoint, add a profile that uses my local model, and check it with sc profiles. This is superclaude's own guide. Read all of it as raw Markdown first, without summarizing it: curl -fsSL "https://superclaude.io/docs/provider-local.md" Then: 1. Tell me in a few lines what you are going to change. 2. Do every step yourself: run the commands, edit the files, check each result. 3. Stop only for what needs me: a browser sign-in, a choice between options, a secret to paste. 4. Finish by showing it works, and tell me the one command I will use from now on. Other superclaude pages, if you need them: https://superclaude.io/llms.txt
A local model server is an endpoint like any other (the URL, wire format and key sc sends requests to): a URL on localhost, a wire format, and a key. Start the server before you launch. sc probes it, and a refused connection fails the launch. The model id is the server’s own name for the model, the one its /v1/models lists.
-
Find the model id
curl -s <url>/v1/modelsThe reply lists the ids the server serves. Take
<url>from the table below. -
Add the endpoint and a profile
[endpoints.local] url = "http://localhost:11434" format = "openai-compat" key_csv = "local" [profiles.local] opus = { slug = "local/<model-id>" }key_csv = "local"is a placeholder. These servers ignore the key unless you turned authentication on, but the gateway refuses an endpoint with no key at all. Leave/v1offurl; the gateway appends/v1/chat/completions. -
Check the routing
sc profiles localIt prints a row for each of opus, sonnet and haiku with the model that role goes to; a role the profile does not set is marked as inherited.
-
Launch on it
sc -u local <project> <agent>
| Server | url | Notes |
|---|---|---|
| Ollama | http://localhost:11434 | Default context is 4,096 tokens; raise it with OLLAMA_CONTEXT_LENGTH. |
| LM Studio | http://localhost:1234 | Start its local server, and set the context length when you load the model. |
| vLLM | http://localhost:8000 | Tool calls need --enable-auto-tool-choice and a --tool-call-parser for your model. |
llama.cpp llama-server | http://localhost:8080 | Set the context with -c. |
What the model needs
- Tool calls. Claude Code sends its tools as function definitions and expects the model to call them. A model or server without tool calling can chat, but cannot edit files or run commands.
- A long context. Claude Code’s system prompt and tool definitions take tens of thousands of tokens before your first message. A server left at a short default context cuts the request.
- Streaming, which all four servers support.
A model id that contains deepseek, glm, kimi, qwen, minimax or mimo gets that family’s thinking field, as on a hosted endpoint; any other id gets none (the table).
Keep Claude on the main loop
The profile above runs the main loop on your model too. To keep Claude there and send only Claude Code’s background requests and Haiku subagents to the local model, map only haiku and put opus on the anthropic passthrough endpoint (Anthropic and Claude):
[profiles.claude-local]
opus = { slug = "anthropic/opus" }
haiku = { slug = "local/<model-id>" }sonnet inherits opus here, so Sonnet requests stay on Claude too.
Use the Anthropic-compatible API
All four servers also serve the Anthropic Messages API at /v1/messages. To use it, set format = "anthropic-messages"; the gateway then forwards Claude Code’s request untranslated, apart from the model id:
[endpoints.local-anthropic]
url = "http://localhost:11434"
format = "anthropic-messages"
key_csv = "local"The server then has to accept Claude Code’s own request shape, which local servers cover only in part, so start with openai-compat.
My server needs an API key
If you started the server with an API key, such as vLLM’s --api-key or LM Studio’s authentication setting, read it from the environment instead of the placeholder: key_csv = "${LOCAL_LLM_KEY}". The daemon expands it in its own environment (details).
Next: How the gateway routes