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.

  1. Install it (macOS (Homebrew)):

    brew install --cask zed
  2. Pull a coding model that supports tool calling (replace qwen3-coder:30b with your choice).

    ollama pull qwen3-coder:30b
  3. Make sure the Ollama server is running: open Ollama.app on macOS, or run it from a shell.

    ollama serve
  4. Raise 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
        }
      }
    }
  5. 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 | sh

Windows (winget)

winget install -e --id ZedIndustries.Zed

Check 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.

MachineModelQuantContextFitOllama
12 GB GPUQwen 3.5 9BQ4_K_M32,768Comfortable (7.4 GB of 12 GB)qwen3.5:9b
Qwen 3.6 35B-A3BQ4_K_M32,768With CPU offload (MoE) (22.7 GB of 12 GB)qwen3.6:35b-a3b
16 GB GPUQwen 3.5 9BQ4_K_M32,768Comfortable (7.4 GB of 16 GB)qwen3.5:9b
Qwen 3.6 35B-A3BQ4_K_M32,768With CPU offload (MoE) (22.7 GB of 16 GB)qwen3.6:35b-a3b
24 GB GPUQwen3.8 27BQ4_K_M32,768Comfortable (19.9 GB of 24 GB)qwen3.8:27b
Qwen 3.6 27BQ4_K_M32,768Comfortable (19.9 GB of 24 GB)qwen3.6:27b
Devstral Small 2 24BQ4_K_M32,768Comfortable (20.7 GB of 24 GB)devstral-small-2:24b
Qwen 3.6 35B-A3BQ4_K_M65,536Tight (23.3 GB of 24 GB)qwen3.6:35b-a3b
32 GB GPUQwen3.8 27BQ4_K_M32,768Comfortable (19.9 GB of 32 GB)qwen3.8:27b
Qwen 3.6 27BQ4_K_M32,768Comfortable (19.9 GB of 32 GB)qwen3.6:27b
Devstral Small 2 24BQ4_K_M32,768Comfortable (20.7 GB of 32 GB)devstral-small-2:24b
Qwen 3.6 35B-A3BQ4_K_M65,536Comfortable (23.3 GB of 32 GB)qwen3.6:35b-a3b
Qwen3-Coder 30B-A3B (MoE)Q4_K_M65,536Comfortable (25.7 GB of 32 GB)qwen3-coder:30b
Mac, 64 GBQwen 3.6 35B-A3BQ8_0131,072Comfortable (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.

Sources (7), checked 2026-10-20