Zed agent with a local model: setup for Ollama, LM Studio or llama.cpp
Zed's built-in agent runs inside the Zed editor (macOS, Linux, Windows) and can use local models from Ollama, LM Studio, llama.cpp or any OpenAI-compatible server. Zed discovers the models these servers expose. It suits developers who want an editor-native agent and have a model with reliable tool calling.
At a glance
- Type
- ide
- Licence
- Not verified
- Latest release
- Not verified
- Status
- Maintained
- Local backends
- ollama, lmstudio, llamacpp, openai-compatible
- Needs native tool calling
- Yes
- MCP support
- Not verified
- Recommended minimum context
- Not stated in its docs
- Start-up prompt
- Not measured
- GitHub stars
- Not verified
How to set it up with a local model
Pick your backend. Each command has its own Copy button. Where a step uses an example model, swap in the one you run; the table below lists the ones that fit your machine.
Install it (macOS (Homebrew)):
brew install --cask zedPull a coding model that supports tool calling (replace qwen3-coder:30b with your choice).
ollama pull qwen3-coder:30bMake sure the Ollama server is running: open Ollama.app on macOS, or run it from a shell.
ollama serveRaise the context Zed requests. Zed sends num_ctx to Ollama and defaults to 4096, so set it in Zed rather than in Ollama.
~/.config/zed/settings.json{ "language_models": { "ollama": { "context_window": 65536 } } }In Zed, pick the Ollama model from the agent's model dropdown (or star icon, Configure, LLM Providers, Ollama, Connect).
Other ways to install
Linux
curl -f https://zed.dev/install.sh | shWindows (winget)
winget install -e --id ZedIndustries.ZedCheck that it works
Open the Agent Panel, choose the local model and ask it to read a file in your project. A tool call should appear in the thread, not just a text reply.
Which local models fit, by machine
Checked by this site's engine at the context Zed agent needs, with 32 GB of system RAM for MoE offload. A Mac counts three quarters of unified memory as usable.
| Machine | Model | Quant | Context | Fit | Ollama |
|---|---|---|---|---|---|
| 12 GB GPU | Qwen 3.5 9B | Q4_K_M | 32,768 | Comfortable (7.4 GB of 12 GB) | qwen3.5:9b |
| Qwen 3.6 35B-A3B | Q4_K_M | 32,768 | With CPU offload (MoE) (22.7 GB of 12 GB) | qwen3.6:35b-a3b | |
| 16 GB GPU | Qwen 3.5 9B | Q4_K_M | 32,768 | Comfortable (7.4 GB of 16 GB) | qwen3.5:9b |
| Qwen 3.6 35B-A3B | Q4_K_M | 32,768 | With CPU offload (MoE) (22.7 GB of 16 GB) | qwen3.6:35b-a3b | |
| 24 GB GPU | Qwen3.8 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 24 GB) | qwen3.8:27b |
| Qwen 3.6 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 24 GB) | qwen3.6:27b | |
| Devstral Small 2 24B | Q4_K_M | 32,768 | Comfortable (20.7 GB of 24 GB) | devstral-small-2:24b | |
| Qwen 3.6 35B-A3B | Q4_K_M | 65,536 | Tight (23.3 GB of 24 GB) | qwen3.6:35b-a3b | |
| 32 GB GPU | Qwen3.8 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 32 GB) | qwen3.8:27b |
| Qwen 3.6 27B | Q4_K_M | 32,768 | Comfortable (19.9 GB of 32 GB) | qwen3.6:27b | |
| Devstral Small 2 24B | Q4_K_M | 32,768 | Comfortable (20.7 GB of 32 GB) | devstral-small-2:24b | |
| Qwen 3.6 35B-A3B | Q4_K_M | 65,536 | Comfortable (23.3 GB of 32 GB) | qwen3.6:35b-a3b | |
| Qwen3-Coder 30B-A3B (MoE) | Q4_K_M | 65,536 | Comfortable (25.7 GB of 32 GB) | qwen3-coder:30b | |
| Mac, 64 GB | Qwen 3.6 35B-A3B | Q8_0 | 131,072 | Comfortable (40.7 GB of 48 GB) | — |
Your exact machine: filter the matrix or check any model in the analyzer.
Common problems with local models
- Zed sends num_ctx 4096 to Ollama by default, whatever OLLAMA_CONTEXT_LENGTH says. Set context_window, or max_tokens per model.
- If you turn auto_discover off and list models by hand, set "supports_tools": true on each one, or the agent cannot use tools with it.
- llama.app's server listens on localhost:9931, while Zed's manual llama.cpp example uses http://localhost:8080. If no models appear, set language_models.llama.cpp.api_url to the port your server actually uses.
- External agents connected through ACP (for example OpenHands or Claude Code) manage their own models; these settings only affect Zed's own agent.
Other coding agents
How they rank for local models: the best agent harness for local LLMs.
- OpenCode
- Qwen Code
- Codex CLI
- Cline
- Kilo Code
- Aider
- Pi coding agent
- Claude Code
- Crush
- Goose
- OpenHands
- GitHub Copilot BYOK
- Continue (discontinued)
- Roo Code (discontinued)
- Void (discontinued)