Zed is a fast, GPU-accelerated code editor built in Rust that’s been gaining serious traction among developers who want VS Code’s capabilities without its memory overhead. Its AI assistant feature — Zed Assistant — supports custom AI backends including Ollama, which means you can get AI-assisted coding in one of the fastest editors available, backed by a local model with no API costs. This guide walks through setting it up and getting the most from the combination.
What Zed’s AI Assistant Can Do
Zed’s AI assistant integrates directly into the editor workflow rather than as a side panel. You can open an AI panel alongside your code (the assistant panel), select code and ask questions about it, request inline edits, and have multi-turn conversations with full context from your open files. It’s more tightly integrated than many VS Code AI extensions — code context flows naturally into conversations without manual copy-pasting.
With Ollama as the backend, all of this runs locally. No code leaves your machine, no subscription required, and no rate limits.
Setting Up Ollama as Zed’s AI Backend
First, make sure Ollama is running with the model you want to use. Then configure Zed to connect to it. Open Zed’s settings (Cmd+, on macOS, Ctrl+, on Linux) and add the Ollama configuration:
{
"language_model": {
"default": "ollama",
"ollama": {
"api_url": "http://localhost:11434"
}
},
"assistant": {
"default_model": {
"provider": "ollama",
"model": "qwen2.5-coder:7b"
},
"version": "2"
}
}
Save the settings file. Zed reads it immediately — no restart needed. Open the assistant panel with Cmd+? (macOS) or Ctrl+? (Linux). You should see a chat interface with your selected model shown at the top.
Choosing the Right Model for Zed
Zed’s assistant has two distinct modes of operation: chat/explanation (where you ask questions and get responses) and inline editing (where it rewrites selected code). Each benefits from a slightly different model profile.
For chat and code explanation: a general instruction-tuned model or coding model at 7B+ is appropriate. Qwen 2.5 Coder 7B is a strong default — it handles both code questions and general programming discussion well. Llama 3.2 3B is a good choice if you want faster responses and your questions are straightforward.
For inline code editing: a fast, precise model works better than a verbose one. Qwen 2.5 Coder 7B or DeepSeek Coder V2 Lite are good options. Avoid very large models for inline editing since the latency becomes noticeable when you’re making repeated small edits.
Zed currently uses the same model for both modes, so the best single choice is a coding-specific 7B model that’s fast enough for inline use but capable enough for longer chat conversations. Qwen 2.5 Coder 7B is the current recommendation for most hardware setups.
Using the Assistant Panel
Open the assistant panel with Cmd+? or through View → Assistant. You get a chat interface where you can have multi-turn conversations. Zed automatically includes context from your active editor — the current file, selected text, and open buffers can be referenced.
To include specific code in your prompt, select it in the editor and use the “Quote Selection” action (Cmd+Shift+I on macOS) to insert it into the assistant input with proper formatting. This is cleaner than copy-pasting and preserves the file path context.
Some useful prompts for development work:
# In the Zed assistant panel:
"Explain what this function does and suggest improvements."
"Write unit tests for the selected code using pytest."
"This function is slow — suggest optimisations with explanations."
"Refactor this to use async/await properly."
"What edge cases am I not handling here?"
Figure 1 — Zed + Ollama Setup Overview
Inline Editing with Zed
Zed’s inline edit feature lets you select code and ask the AI to rewrite it without leaving the editor. Select the code you want to modify, then trigger the inline assistant (Cmd+Enter or through the right-click menu). Type your instruction in the small input that appears:
- “Add type hints to all parameters and return values”
- “Extract this into a separate function called handle_auth”
- “Simplify this — it’s too verbose”
- “Add error handling for network failures”
The model generates the rewritten code which Zed shows as a diff — you can accept, reject, or further refine it. This workflow is significantly faster than copy-pasting to a chat window, editing, and copy-pasting back, especially for small targeted changes. The diff view makes it easy to see exactly what changed and catch any unintended modifications.
For inline editing, model latency matters more than for chat. On a mid-range GPU, a 7B model generates fast enough for the inline workflow to feel natural. On CPU-only setups or very slow hardware, consider using a 3B model for inline editing specifically (set it in your Zed config) and reserve the 7B for chat.
Zed vs VS Code + Continue for Local AI Coding
The honest comparison: Zed with Ollama and VS Code with the Continue extension both work well for local AI-assisted coding. The differences come down to editor preference and workflow.
Zed’s advantages: it’s genuinely fast — the editor itself is noticeably snappier than VS Code, which makes the overall AI coding experience feel more responsive. The AI integration is built in rather than being an extension, so it’s more reliably maintained and consistent in behaviour. The diff-based inline editing workflow is cleaner than Continue’s inline edit flow for many users.
VS Code + Continue’s advantages: VS Code has a much larger extension ecosystem, more language-specific tooling, and Continue has more configuration options including per-model settings for chat vs. autocomplete. If you’re heavily invested in VS Code extensions (debuggers, linters, specific language support), the switch to Zed has a real cost.
If you’re open to trying a new editor, Zed is worth a week’s trial — it’s particularly good for Python, Rust, and Go where the built-in language support is strong. If you’re committed to VS Code, the Continue extension gives you a comparable Ollama-backed AI coding experience without switching editors. Neither is clearly better; it comes down to which editor fits your workflow.
Figure 2 — AI Coding Setup Comparison
Troubleshooting Zed + Ollama
If the assistant panel shows an error or doesn’t respond, check these in order. First, confirm Ollama is running — run curl http://localhost:11434 in a terminal and confirm you get “Ollama is running”. Second, confirm the model is downloaded — ollama list should show the model you specified in your Zed config. Third, check the model name in your Zed settings exactly matches the Ollama model name — qwen2.5-coder:7b not qwen2.5coder. Fourth, verify your Zed settings JSON is valid — a syntax error in the settings file causes Zed to silently fall back to defaults. Open Zed’s developer tools (if available on your platform) or check the Zed logs for error messages pointing to the settings issue. If Zed connects but responses are slow, increase the request_timeout setting and check whether your model is loaded in Ollama memory with ollama ps — a cold-loading model adds 15–30 seconds of latency to the first request in a session.
Keeping Models Fast for Editor Use
The best quality-of-life improvement for using Ollama-backed AI in Zed is keeping your model loaded in memory. By default, Ollama unloads models after 5 minutes of inactivity — and a 30-second cold load when you return to work disrupts flow. Set OLLAMA_KEEP_ALIVE to a longer duration while working: 2–4 hours is reasonable for a development session. Set it in your shell profile or environment so it applies whenever Ollama starts. The memory cost of keeping a 7B model loaded is around 5–6GB — significant but worth it for the responsiveness improvement during an active coding session. If you regularly switch between models in Zed, set OLLAMA_MAX_LOADED_MODELS=2 so Ollama keeps two models in memory simultaneously, avoiding the reload delay when switching between a coding model and a general-purpose model mid-session.
Zed’s Future AI Direction
Zed is actively investing in its AI capabilities — the team has publicly committed to making AI-assisted coding a core part of the editor’s value proposition, and new features ship regularly. The Ollama integration benefits from this trajectory: as Zed adds new AI-powered features (better code search, multi-file context, agent-style task execution), the local Ollama backend should support them as long as the model capabilities match what the feature requires. The current assistant and inline edit features are already useful for everyday development work, and the editor’s native speed advantage over VS Code means the overall AI coding experience feels snappier even on the same hardware with the same model. If you’re a developer who’s been on the fence about trying Zed, adding Ollama as a backend and spending a week with the setup is a low-effort way to evaluate whether the combination improves your workflow before committing to a full editor switch.