★ Reading this for free? Get 20 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 seconds
Coding Tools

Kilo Code + Ollama: Free Local AI Coding Agent in VS Code

September 6, 2026
12 min read
LocalAimaster Research Team

Want to go deeper than this article?

Free account unlocks the first chapter of all 25 courses — RAG, agents, MCP, voice AI, MLOps, real GitHub repos.

📚AI Learning Path

Ollama’s running. Here’s what to build with it. Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.

Start free
Or own it for life — Lifetime $149, pay once

Short answer: yes — Kilo Code (26.7K GitHub stars, MIT, v7.4.20 as of August 2026) runs fully local on Ollama in VS Code and JetBrains. Open Settings → Providers tab → select Ollama (not Ollama Cloud), pick your model as ollama/qwen3-coder:30b (19GB download, 24GB-VRAM class), and raise Context Window Size (num_ctx) to at least 32K — Kilo's own docs say "you need to have at least 32k to get decent results." One hard limitation up front: the Kilo CLI does not support local Ollama (two feature requests closed as "not planned") — local models are an extension feature only.

That paragraph is the whole setup. The rest of this guide is the part that keeps it working: why the 32K context rule exists, which models are honestly usable at each VRAM tier, the four gotchas people keep filing GitHub issues about, and how Kilo compares to Cline — its closest relative — for local work. Everything here was verified against Kilo's official Ollama docs, the GitHub repo, and Ollama's model cards in August 2026.


What Kilo Code Is (and What Happened to Roo Code)

Kilo Code is a free, MIT-licensed AI coding agent for VS Code and JetBrains — 26.7K GitHub stars and 1.38M+ VS Code Marketplace installs as of August 2026 — and it is the de facto successor to Roo Code, which shut down in May 2026.

The lineage matters because it answers the question most people arrive with. Kilo's own migration guide states it plainly: "We started Kilo as a Roo fork in 2025. The two codebases share real git history." Roo Code itself was a fork of Cline. Then in April 2026 Roo's maintainer announced the shutdown — "Roo Code hit 3 million installs. We're shutting it down to go all-in on Roomote" — and archived the repo on May 15, 2026. Kilo published an official Roo-to-Kilo migration path (your .roorules, custom modes, and MCP configs carry over; API keys don't), and it is now where most of that ecosystem landed.

Two things distinguish Kilo from the tool it forked:

  • It's a platform, not just an extension. VS Code, JetBrains, a CLI, and five task modes (Code, Plan, Ask, Debug, Review) plus inline autocomplete. The extension is the part that matters for local models.
  • It has commercial backing. Anaconda acquired Kilo Code on July 15, 2026. In a fork family where the previous champion just folded, a funded maintainer is a real argument — release v7.4.20 shipped the day before we checked, so the cadence is alive and well.

The fork-family churn cuts both ways, though, and we'd be doing you a disservice to skip it: Cline → Roo → Kilo is three generations in about two years, and Roo died at 3 million installs. Kilo looks like the stable branch now — Anaconda's backing is the best evidence — but if you build your workflow on any of these tools, keep your rules files portable. (They mostly are: AGENTS.md and MCP configs travel well.)

Why run it on Ollama at all? Same three reasons as every local agent: $0 in subscriptions and per-token bills, code that never leaves your machine, and no rate limits. Kilo's cloud gateway advertises 500+ models; the local provider trades that catalog for privacy and a price of zero.


Reading articles is good. Building is better.

Free account = the first chapter of all 25 courses, with a per-chapter AI tutor. No card.

The 5-Minute Setup

Four steps: install Ollama, pull a model, install the Kilo Code extension, point its Ollama provider at localhost. No API key exists anywhere in this flow.

1. Install Ollama (skip if it's already running):

# macOS / Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows: download the installer from ollama.com

# Start the daemon if it isn't running
ollama serve

2. Pull a coding model. Kilo's Ollama docs recommend exactly two, and we'd start with the same one (full reasoning in the model section):

# Kilo's primary recommendation — needs ~24GB VRAM class hardware
ollama pull qwen3-coder:30b

# Their listed alternative — 14GB download, dense 24B agent-tuned model
ollama pull devstral:24b

3. Install the extension. VS Code → Extensions (Ctrl+Shift+X / ⇧⌘X) → search "Kilo Code" → Install. The Kilo icon lands in the Activity Bar. (JetBrains users: the plugin is on the JetBrains Marketplace and the provider config below is the same.)

4. Configure the Ollama provider:

  1. Click the Kilo Code icon, then the settings gear in its panel.
  2. Open the Providers tab.
  3. Select Ollama — the local one. There is a separate Ollama Cloud entry for Kilo's gateway; picking that one is the single most common wrong turn (see gotchas).
  4. Leave the base URL at the localhost default unless Ollama runs on another machine.
  5. Pick your model — Kilo uses the ollama/<model_name> format, so the pull above appears as ollama/qwen3-coder:30b. If nothing appears, confirm with ollama list that the model is actually pulled.
  6. Set Context Window Size (num_ctx) to 32768 or higher. This is the step that decides whether the agent works. Next section explains why.

Test it: open a repo, switch Kilo to Code mode, and give it something small — "add input validation to this function." If it plans, edits, and finishes, you're done. If it stalls after a step or two, you skipped step 6.


The 32K Context Rule

Kilo's official Ollama docs put the requirement in one sentence: "You need to have at least 32k to get decent results." Ollama's default context is 4,096 tokens (per its FAQ) — an eighth of the minimum — and an agent on a 4K window doesn't degrade gracefully, it silently breaks.

Here's the failure mechanism, because recognizing it saves you a debugging session: an agentic tool like Kilo stuffs a large system prompt, tool definitions, file contents, and the running conversation into every request. On a 4K window that overflows almost immediately, Ollama truncates from the top, and the model loses the very instructions that tell it how to call tools. From the outside it looks like the model "forgot" the task, re-reads the same file forever, or emits malformed tool calls. People blame the model; it's the window.

Kilo makes the fix easier than most of its relatives — it's a first-class setting, no custom Modelfile required:

  • In Providers → your Ollama profile, set Context Window Size (num_ctx) to 32768 (or 65536 if your VRAM allows — more below).

Two alternates if you'd rather fix it at the Ollama layer, where it applies to every client at once:

# Session-wide: restart the daemon with a bigger default
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
# Permanent per-model tag: bake it into a Modelfile
# Save as "Modelfile", then: ollama create qwen3-coder-32k -f ./Modelfile
FROM qwen3-coder:30b
PARAMETER num_ctx 32768

The cost of context, stated honestly: the KV cache grows with the window, on top of the model weights. On a 24GB card, a Q4 30B-class model at 32K is comfortable and 64K is workable; chasing qwen3-coder's full 256K native window on consumer hardware means offloading and a crawl. Size the window to your tasks, not to the model card's maximum. Kilo's docs make the same point — bigger values "increase memory usage and may impact performance."


Which Local Model to Run

Run qwen3-coder:30b if you have 24GB of VRAM or a 32GB+ unified-memory Mac — it's Kilo's own primary recommendation. Take devstral:24b as the dense alternative at 14GB. Below 16GB, drop to Qwen2.5-Coder and scale your expectations with the parameter count.

Specs below are from each model's Ollama library page; the SWE-bench figure is Mistral's own reported number, not our measurement:

ModelParamsDownloadNative contextWhy it's here
qwen3-coder:30b30B MoE (3.3B active)19GB256KKilo docs' primary pick; fast for its size thanks to MoE
devstral:24b24B dense14GB128KKilo docs' alternative; built for coding agents by Mistral + All Hands AI, Mistral-reported 46.8% SWE-bench Verified, Apache 2.0
qwen2.5-coder:14b14B dense9GB32KThe 12-16GB-card fallback
qwen2.5-coder:7b7B dense4.7GB32K8GB cards; light duty only

The honest fine print, straight from the source: Kilo's docs note that even their recommended qwen3-coder:30b "occasionally struggles with tool calls," and that local models in general are "much more likely to get stuck in loops, fail to use tools properly or produce syntax errors" than cloud frontier models. That is our experience with this model class too — 30B-class local coders are genuinely useful agents with occasional babysitting, not set-and-forget.

Which also frames the 7B question people keep asking: can you run Kilo on a small model? You can select one, and Kilo's docs themselves say smaller models are fine for the light features — Enhance Prompt, commit-message generation. But agentic multi-step editing is the hardest thing you can ask a local model to do, and tool-call reliability falls off fast below ~14B. On an 8GB card, treat Kilo's agent modes as a "scoped, single-file edits" tool and expect to interrupt loops. For the field beyond Kilo's two picks — and honest notes on what each size class can actually do — our best local models for programming ranking is the deeper reference.

One sizing note: download size is not VRAM-at-load. Weights plus KV cache plus runtime overhead is the real number, and it grows with the num_ctx you just raised. Our Ollama RAM/VRAM table maps model-by-model what actually fits.


Save yourself the weekend

Skip the plumbing and get to the part that works

Agents with tool calling already wired up, ready to point at your own tasks — instead of rebuilding the same scaffolding.

Get it — $19$19 once · instant accessStart free →

Gotchas From the Issue Tracker

Four failure modes account for most "Kilo + Ollama doesn't work" reports on GitHub. All four are avoidable in setup.

1. The CLI doesn't do local Ollama — at all. This is the big one, and it's a decision, not a bug: feature requests for local Ollama in the Kilo CLI were filed in February 2026 (#6326) and again in March (#6871 — "the CLI only allows me to select Ollama Cloud"), and both were closed as not planned. The Kilo CLI is a fork of OpenCode wired to Kilo's cloud gateway; local models live in the VS Code and JetBrains extensions. If a terminal agent on local models is what you actually want, use a tool built for it — Aider has first-class Ollama support.

2. "Ollama" vs "Ollama Cloud" confusion. The provider list contains both, and users have filed bugs after finding only "Ollama Cloud" where they expected their local daemon (issue #8491, April 2026 — the reporter's local setup worked in JetBrains while VS Code showed only the cloud entry). If you don't see the local Ollama provider: update the extension first (releases ship near-daily), confirm ollama serve is actually running, then restart VS Code so the extension can detect the daemon.

3. Silence instead of errors. Issue #3348 is the archetype: models show up in Kilo's dropdown, the request visibly hits Ollama, and no response ever arrives — on a CPU-only Windows/WSL2 machine. Two things gang up here. First, CPU-only inference on a 30B-class model is slow enough that a response may not land within any reasonable window. Second, Kilo's API Request Timeout defaults to 10 minutes — a slow first token on cold model load plus a big context can blow through it, and what you observe is a hang. Fix: raise the timeout in Kilo Code's settings (Extensions panel → Kilo Code gear → Settings → API Request Timeout), warm the model first with a trivial ollama run prompt, and be honest with yourself about CPU-only agentic coding — it technically functions and practically doesn't.

4. The context window, again. It's gotcha #4 only because we gave it its own section. If the agent loops, forgets, or mangles tool calls: num_ctx, always num_ctx first.


Kilo Code vs Cline

Same family, same local-model mechanics, different trade: Cline has the bigger community (65.8K stars vs 26.7K), Kilo has more built in — autocomplete, five modes, and a context-window setting that saves you the Modelfile dance.

We maintain a full Cline + Ollama guide, so here's just the decision layer:

Kilo CodeCline
GitHub stars (Aug 2026)26.7K65.8K
LicenseMITApache 2.0
EditorsVS Code + JetBrains + CLIVS Code + JetBrains + CLI
Local OllamaOfficial provider, docs'dOfficial provider, docs'd
num_ctx fixBuilt-in provider settingModelfile / env var
Extras5 modes, autocomplete, cloud gateway (optional)Largest agent-extension ecosystem
BackingAnaconda (acquired Jul 2026)Cline Bot Inc.

Because Kilo descends from Roo which descends from Cline, your intuition transfers almost completely — the provider config, the approval flow, and crucially the same context-window trap. Our first-hand throughput numbers were measured in Cline rather than Kilo, so we'll point you at them rather than re-badge them: on an RTX 3090 running a 24B dense model at 64K context we saw roughly 18-22 tok/s in agent loops (details in the Cline guide) — the same model class in Kilo's harness should land in the same neighborhood, but treat that as an inference, not a measurement.

If what you actually want is inline completion rather than an autonomous agent, skip both and set up Continue.dev + Ollama — lighter models, lighter footprint. And for the whole landscape ranked side by side, see our best AI coding tools roundup.


Hardware Reality Check

Kilo's docs set the bar themselves: "a GPU with a large amount of VRAM (24GB or more) or a MacBook with a large amount of unified RAM (32GB or more)" for the recommended models. Below that, you're trading down the model, the context, or both.

Your hardwareRealistic Kilo modelnum_ctx to set
8GB VRAMqwen2.5-coder:7b16-32K, scoped tasks only
12-16GB VRAMqwen2.5-coder:14b32K
24GB VRAM (3090/4090 class)qwen3-coder:30b or devstral:24b32-64K
32GB+ unified (Apple Silicon)Either recommended model64K

The agent workload is unusually context-hungry — that's why this table is more conservative than a chat-use table for the same GPUs. For picks tuned to each tier, see best coding LLMs for 24GB VRAM at the comfortable end and best coding LLMs for 8GB VRAM at the honest-compromise end.


Where Local Kilo Falls Short

A well-configured local Kilo is a real daily driver for scoped, private work — and it is not frontier-cloud-class on hard multi-file tasks. Kilo's own documentation says as much, which is to their credit.

What works well on a 24GB-class setup: single-concern edits, test generation, boilerplate, codebase Q&A, refactors with clear boundaries. What still favors cloud models: long-horizon multi-file refactors, ambiguous specs, and marathon agent sessions — the places where a 30B model loses the thread and a frontier model doesn't. The pragmatic pattern is the same one we recommend in every guide in this series: local for the bulk of daily, private, unlimited work; cloud for the occasional genuinely hard task.

Two Kilo-specific caveats to carry forward:

  • Fork-family risk is nonzero. Roo Code died this year at 3 million installs. Kilo's Anaconda acquisition (July 2026) and near-daily releases are the counter-evidence, and it's currently the healthiest branch of the family — but keep your AGENTS.md rules and MCP configs portable, because in this family, they're what survives.
  • The local story is extension-only. No local Ollama in the CLI, closed as not planned. Plan your workflow around the editor.

Sources


FAQ

🎯
AI Learning Path

Ollama’s running. Here’s what to build with it.

Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.

Or own it for life — Lifetime $149 $599, pay once
Once your hardware is sorted

Stop piecing Ollama together from blog posts

Ollama Mastery is 15 chapters end to end — install, model choice, Modelfiles, GPU offload, the API, and the 20 errors that actually happen. Plus 24 more courses.

$149 once unlocks everything, forever — about $0.27/chapter for life. Prefer to spread it out? Pro is $79/year (saves 27%) or $8.99/month.
Secure checkout by Lemon Squeezy — your card never touches this siteInstant access the moment you payFirst chapter of every course is free — try before you buy

Liked this? 25 full AI courses are waiting.

From fundamentals to RAG, agents, MCP servers, voice AI, and production deployment with real GitHub repos. First chapter free, every course.

Reading now
Join the discussion

LocalAimaster Research Team

Creator of Local AI Master. I've built datasets with over 77,000 examples and trained AI models from scratch. Now I help people achieve AI independence through local AI mastery.

Build Real AI on Your Machine

RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.

Want structured AI education?

25 courses, 519+ chapters, from $9. Understand AI, don't just use it.

AI Learning Path
More on Ollama
See the full Best Ollama Models 2026 guide.

Comments (0)

No comments yet. Be the first to share your thoughts!

Does Kilo Code work with local Ollama models?

Yes — in the VS Code and JetBrains extensions. Kilo Code has an official local Ollama provider: open Settings (gear icon), go to the Providers tab, select Ollama (not Ollama Cloud), and pick your model in the ollama/<model_name> format, e.g. ollama/qwen3-coder:30b. No API key is needed. The one non-negotiable step is raising the Context Window Size (num_ctx) setting to at least 32K — Kilo's own docs say you need at least 32K to get decent results.

Is Kilo Code the successor to Roo Code?

Effectively yes. Roo Code announced its shutdown on April 21, 2026 ("We're shutting it down to go all-in on Roomote") and archived its repository on May 15, 2026. Kilo's own migration guide states: "We started Kilo as a Roo fork in 2025. The two codebases share real git history." Kilo publishes an official Roo-to-Kilo migration guide — project rules, custom modes, MCP configs, and ignore files carry over; API keys do not. Kilo Code itself was acquired by Anaconda on July 15, 2026, and the extension remains MIT-licensed on GitHub.

Why does Kilo Code keep looping or failing with Ollama?

Context window, almost every time. Ollama defaults models to a small context (4,096 tokens per its FAQ), and Kilo's system prompt plus tool definitions plus your files overflow that within one or two turns — after which the model silently loses its tool instructions and loops. Kilo's Ollama docs are blunt: "You need to have at least 32k to get decent results." Set Context Window Size (num_ctx) to 32768 or more in the provider settings. If long tasks die at exactly 10 minutes, that's the separate API Request Timeout setting — raise it in the Kilo Code settings.

Can the Kilo CLI use local Ollama models?

No, and this catches a lot of people. The Kilo CLI (a fork of OpenCode) only offers Ollama Cloud, not your local daemon — users have filed for local support twice (issues #6326 and #6871) and both were closed as not planned as of August 2026. Local Ollama is a VS Code / JetBrains extension feature. If you want a terminal agent on local models instead, use a tool with first-class local support — our Aider and OpenCode guides cover that route.

Kilo Code vs Cline — which is better for local models?

They are close relatives (Kilo forked Roo Code, which forked Cline), so the local setup and the num_ctx trap are nearly identical. Cline has the bigger community (65.8K stars vs Kilo's 26.7K as of August 2026). Kilo counters with a built-in Context Window Size setting right in the provider config (no custom Modelfile needed), inline autocomplete, and five task modes. Both are free and open source (Kilo is MIT, Cline is Apache 2.0) with your code staying on localhost — try Kilo if you want the batteries-included option, Cline if you want the largest ecosystem.

Ready to Go Beyond Tutorials?

20 structured courses with hands-on chapters - build RAG chatbots, AI agents, and ML pipelines on your own hardware.

Bonus kit

Ollama Docker Templates

10 one-command Docker stacks for local models — get your agent backend serving in minutes. Included with paid plans, or free after subscribing to both Local AI Master and Little AI Master on YouTube.

See Plans →

Was this helpful?

📅 Published: September 6, 2026🔄 Last Updated: September 6, 2026✓ Manually Reviewed
LM

Written by the Local AI Master Team

The team behind Local AI Master

We build Local AI Master around practical, testable local AI workflows: model selection, hardware planning, RAG systems, agents, and MLOps. The goal is to turn scattered tutorials into a structured learning path you can follow on your own hardware.

✓ Local AI Curriculum✓ Hands-On Projects✓ Open Source Contributor
📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Ollama’s running. Here’s what to build with it.

Go from “ollama run” to RAG apps, agents, and fine-tuned models — structured and hands-on. First chapter free.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators