computer, laptop, tech, blue computer, blue laptop, blue tech, computer, laptop, tech, tech, tech, tech, tech

Using Zed with Ollama: Local Models in the Agent Panel

The goal: Zed’s agent, running on your own machine

Zed ships with a built-in AI agent and a model picker that happily talks to providers other than Zed’s own hosted models. Point it at Ollama and your prompts, your code and your context never leave the machine. If you have already read my guides on using Cursor with local LLM models and Claude Code with local LLM models, the shape of this will feel familiar, but Zed is noticeably simpler because Ollama is a first-class provider rather than a workaround.

By the end of this guide you will have Zed with Ollama working in the Agent Panel, a sensible context length, and a model that can actually call tools rather than just chat.

Step 1: get Ollama running with a coding model

Install Ollama, then pull a model that supports tool calling. Zed’s agent edits files through tools, so a chat-only model will be stuck answering questions. A reasonable starting point on a 32GB machine is qwen3-coder:30b; on 16GB try qwen2.5-coder:7b.

ollama pull qwen3-coder:30b
ollama list

# on Linux, if the service isn't already running
ollama serve

On macOS the Ollama app runs the server for you. Either way, curl http://localhost:11434 should reply before you go any further.

Step 2: connect Ollama in Zed

  1. Click the AI (sparkle/star) icon in the status bar and choose Configure, or run agent: new thread from the command palette and open settings from there.
  2. Under LLM Providers, pick Ollama.
  3. Check the host URL is http://localhost:11434 and click Connect.
  4. Open the model selector in the Agent Panel’s message editor and choose your model from the Ollama section.

Zed discovers pulled models automatically, so anything you add with ollama pull later will appear in the list.

Step 3: set context length and capabilities in settings.json

This is the step most people skip, and it is why local agents feel stupid. Zed sends a context length to Ollama as num_ctx, and the default is only 4096 tokens. An agent thread with a system prompt, tool definitions and a couple of files blows through that almost immediately. Open your Zed settings.json and declare the model explicitly:

{
  "language_models": {
    "ollama": {
      "api_url": "http://localhost:11434",
      "available_models": [
        {
          "name": "qwen3-coder:30b",
          "display_name": "Qwen3 Coder 30B (local)",
          "max_tokens": 32768,
          "supports_tools": true
        }
      ]
    }
  }
}
  • max_tokens sets the context window for that model. You can also set context_window at the Ollama level to apply one value to every model.
  • supports_tools tells Zed the model can use tools. If Zed shows a No tools label next to the model, the agent cannot edit files with it.
  • auto_discover can be set to false if you only want the models you list to appear.
  • Zed’s docs also list supports_thinking and supports_images flags for models that support them.

Bigger context costs memory. If the model starts spilling onto the CPU, back the number down rather than switching models.

Using LM Studio instead

Zed also has an LM Studio provider. Download a model in LM Studio (or with lms get), start the server with lms server start, then pick it from the same model dropdown.

Troubleshooting

  • Model not listed: confirm it shows in ollama list and that Zed’s API URL matches where Ollama is listening.
  • Agent forgets the file it just read: context is too small. Raise max_tokens and check the result with ollama ps, which shows the active context and the CPU/GPU split.
  • “No tools” label: either the model genuinely lacks tool support or you have not set supports_tools. Swap to a model built for agentic coding.
  • Painfully slow first response: the model is loading into memory. Subsequent prompts should be much quicker.
  • Ollama on another box: set api_url to that machine, and do not expose port 11434 to the open internet.
# check what context length a loaded model is actually using
ollama ps

# raise the server-wide default (or use the slider in the Ollama app settings)
OLLAMA_CONTEXT_LENGTH=32768 ollama serve

Verdict

Zed with Ollama is the least painful local-agent setup in this series: native provider support, automatic model discovery and a clear signal when tools are not available. Set the context length properly and pick a tool-capable model, and it is genuinely usable for day-to-day edits. If you also want a browser chat front end on the same models, see Open WebUI with Ollama.

This post is part of a series on running AI coding tools against local models. The others cover Zed with Ollama, VS Code and Continue with Ollama, JetBrains AI Assistant with local models, Codex CLI with Ollama, Xcode with Ollama, and a capstone on choosing a local coding model for your hardware.


Leave a Reply