Kilo Code in VS Code with a local model: an open-source coding agent with Ollama (Linux, Windows, Mac)
Before you start
- 20 min read
Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#
Kilo Code is an open-source (MIT) AI coding agent for VS Code that reads your project, edits files and runs commands, and with Ollama or LM Studio it can use a model on your own computer; but its defaults still send autocomplete, session titles and usage statistics to Kilo's cloud, so you have to switch those off yourself.
Logo: the official Kilo Code project (github.com/Kilo-Org/kilocode)
Kilo Code suits people who want an agent in the editor that works through a task, not just a chat. Here Kilo talks to Ollama on localhost. Three things decide whether it works well: a model that can call tools, a context size set on the Ollama side (not in Kilo), and closing the cloud defaults. It is also not the Kilo Code older tutorials describe: the extension was rebuilt in April 2026.
| Current version | GitHub's latest release is 7.8.18 (October 2026); the VS Code pre-release channel, which the extension is shipped on, is at 7.8.26 (November 2026) |
| Status | Alive, MIT licence. Rebuilt on the Kilo CLI (a fork of OpenCode) in April 2026; Anaconda announced it was acquiring Kilo in July 2026 |
| Needs | VS Code 1.105.1 or newer (the extension's own package.json), and Ollama or LM Studio |
| Time needed | About 40 minutes plus the model download (our estimate) |
| Size on disk | Kilo's docs recommend qwen3-coder:30b: 19 GB on Ollama's library; devstral:24b is 14 GB |
| Hardware | Kilo's docs: a GPU with 24 GB or more VRAM, or a Mac with 32 GB or more unified memory, for decent speed |
| Ports | None for Kilo. Ollama listens on 11434, LM Studio on 1234 |
| Licence | MIT |
| Official docs | kilo.ai/docs and github.com/Kilo-Org/kilocode |
At a glance:
- What it is: a VS Code extension (id
kilocode.kilo-code). It also has a CLI and a JetBrains plugin; this guide covers VS Code. - What it changes: files and terminal commands. By default most tools run without asking, so tighten that (Step 6).
- Local model: the
ollamaprovider, model nameollama/<model>, no API key. - The settings to get right: a model with the
toolsbadge, the context size in Ollama,limit.contextandlimit.outputin Kilo. - Privacy: with a local model your code goes to your own computer, but autocomplete, the background "small model" and telemetry go to the cloud until you change them (Step 5).
- Compared with Cline: see the table below.
How it fits together#
Kilo sits between you, your project and the model. Dashed parts are optional.
Drawn from the Kilo docs (local models, settings, autocomplete, free usage), the Kilo source at release v7.8.18 and the Ollama docs, November 2026. Green stays on your machine; red only happens if you leave the defaults on.
Before you start#
| You need | Details |
|---|---|
| VS Code | Version 1.105.1 or newer. Check with code --version. On a Mac, run "Shell Command: Install 'code' command in PATH" from the Command Palette first (VS Code docs) |
| Ollama | Any current version; check with ollama --version. Port 11434 free |
| Memory | Kilo's docs say 24 GB VRAM or 32 GB unified memory for the models they discuss. Smaller machines can run smaller models, but the docs warn they "get stuck in loops, fail to use tools properly or produce syntax errors" more often |
| Disk | 19 GB for qwen3-coder:30b |
| Windows | Kilo's installation page says PowerShell must be on your PATH (C:\Windows\System32\WindowsPowerShell\v1.0\) |
Checklist:
- [ ] VS Code 1.105.1 or newer installed
- [ ] A project that is a git repo, or a throwaway folder (you will test in one)
- [ ] Existing VS Code settings and
~/.config/kilobacked up (see Updates and backups) - [ ] Port 11434 free (Ollama's default)
Not run by DIY Lab Hub. Every command and value comes from the official docs, the Kilo source at tag v7.8.18 and the sources listed at the end, read in November 2026.
Step 1: Install Ollama and pull a coding model#
If Ollama already runs, skip to the pull. Our Ollama guide goes deeper. Kilo's docs recommend qwen3-coder:30b and name devstral:24b as the alternative; both carry the tools badge on Ollama's library.
Linux#
curl -fsSL https://ollama.com/install.sh | sh ollama pull qwen3-coder:30b
Windows (PowerShell)#
Download the installer from ollama.com/download and run it, then open PowerShell:
ollama pull qwen3-coder:30b
Mac (Terminal)#
Download the Mac app from ollama.com/download and open it once, then:
ollama pull qwen3-coder:30b
Check it worked. ollama list shows qwen3-coder:30b. On ollama.com/library/qwen3-coder the model has the tools badge: Kilo needs tool calls to act.
Tip: If 19 GB is too much, pick a smaller model with the
toolsbadge, but expect more failed tool calls.
Step 2: Raise Ollama's context size#
Ollama's FAQ says the default is 4096 tokens; its context page says it depends on VRAM (under 24 GiB: 4k, 24 to 48 GiB: 32k) and advises at least 64000 for coding tools. Kilo's docs say "at least 32k". Kilo cannot fix this itself: Ollama's OpenAI-compatible endpoint, which Kilo's example uses, "does not have a way of setting the context size". The example uses 32768; use 65536 if your memory allows.
Linux#
If Ollama runs as a systemd service, set the variable in an override (Ollama FAQ):
sudo systemctl edit ollama.service
Add these two lines, save, then reload:
[Service] Environment="OLLAMA_CONTEXT_LENGTH=32768"
sudo systemctl daemon-reload sudo systemctl restart ollama
If you start it by hand, use OLLAMA_CONTEXT_LENGTH=32768 ollama serve.
Windows (PowerShell)#
Ollama's docs: change the slider under Settings in the Ollama app. Or set a user variable and restart Ollama from the tray (Ollama FAQ: Windows reads your user environment variables):
setx OLLAMA_CONTEXT_LENGTH 32768
Mac (Terminal)#
Use the slider in the Ollama app's settings, or set the variable for the app (Ollama FAQ), then quit and reopen Ollama:
launchctl setenv OLLAMA_CONTEXT_LENGTH 32768
Check it worked. You confirm it in Step 4, once a model is loaded: ollama ps shows a CONTEXT column with your number. The Ollama docs show this layout (expected output from the docs, a different model):
NAME ID SIZE PROCESSOR CONTEXT UNTIL gemma4:latest c6eb396dbd59 9.6 GB 100% GPU 131072 2 minutes from now
Tip: A larger context needs more memory. If
ollama psshows part of the model on the CPU, lower the number.
Step 3: Install Kilo Code in VS Code#
Kilo's installation page: open Extensions, search for "Kilo Code", click the arrow next to Install and choose Install Pre-Release Version. The page says the "pre-release" label is only a Marketplace distribution channel and that the extension "is stable and recommended for all users". The docs also show a command-line install.
Linux#
code --version code --install-extension kilocode.kilo-code code --list-extensions --show-versions | grep -i kilo
Windows (PowerShell)#
code --version code --install-extension kilocode.kilo-code code --list-extensions --show-versions | Select-String kilo
Mac (Terminal)#
Same commands as Linux (after the "Install 'code' command in PATH" step above):
code --version code --install-extension kilocode.kilo-code code --list-extensions --show-versions | grep -i kilo
Check it worked. The last line reads [email protected]. If the number starts with 5, you have the old extension: uninstall it and use the Install Pre-Release Version button instead. I could not test which channel the command line picks, so this check matters. The first time you open the Kilo panel it asks you to sign in. The docs do not say whether you can skip that for local-only use, and I could not test it; read "What leaves your machine" before you sign in.
Step 4: Connect Kilo to Ollama#
Open Kilo, click the gear icon, go to the Providers tab and add Ollama. No API key is needed, and Kilo's docs say you only set a base URL if Ollama runs on another host. The extension stores this in kilo.jsonc. To declare the model's limits, use Global Config in the Settings header (Kilo creates the file if it is missing) and make it look like this:
{
"$schema": "https://app.kilo.ai/config.json",
"model": "ollama/qwen3-coder:30b",
"provider": {
"ollama": {
"models": {
"qwen3-coder:30b": {
"name": "Qwen3 Coder 30B",
"tool_call": true,
"limit": { "context": 32768, "output": 8192 }
}
}
}
}
}
Kilo's custom-model page warns: without limit.context and limit.output a model that is not in its catalogue gets limits of 0 and compaction is disabled, so use the same number as Step 2. The global file is ~/.config/kilo/kilo.jsonc.
Linux#
mkdir -p ~/.config/kilo
Create or open ~/.config/kilo/kilo.jsonc and paste the JSON above, or use Global Config.
Windows (PowerShell)#
The file is $HOME\.config\kilo\kilo.jsonc:
New-Item -ItemType Directory -Force $HOME\.config\kilo | Out-Null
Mac (Terminal)#
Same file and command as Linux:
mkdir -p ~/.config/kilo
Check it worked. Open a new chat; the model picker shows ollama/qwen3-coder:30b. Send "Reply with the word ready." and, in another terminal, run ollama ps: the model is listed with your CONTEXT number. If the picker only offers an "Ollama Cloud" entry, you have the hosted provider; the docs say ollama-cloud/... "does not connect to http://localhost:11434".
Using LM Studio instead#
Download a GGUF model in LM Studio, open the Local Server tab and click Start Server. Kilo's docs give this config (default port 1234):
{
"model": "lmstudio/<model-id>",
"provider": {
"lmstudio": {
"options": { "baseURL": "http://localhost:1234/v1" }
}
}
}
If you see "Please check the LM Studio developer logs to debug what went wrong", the docs say to raise the context length in LM Studio. Our LM Studio headless server guide covers running it without the window.
Step 5: Close the three cloud doors#
Kilo's own docs describe three defaults that use the Kilo Gateway or Kilo's servers even when your main model is local. Set all three, then reload the VS Code window (Kilo reads the project config when it loads a workspace).
- Autocomplete is on by default and "routed through the Kilo Gateway" with Codestral; the docs list no local option. In your VS Code user settings set
"kilo-code.new.autocomplete.enableAutoTrigger": false(default true in the extension'spackage.json). - The small model does background jobs such as session titles and summaries. By default it is "Auto Small", which uses credits and the Kilo cloud. Go to Settings, Models and set it to a model on your machine, or set
small_modelinkilo.jsonc(the docs show it only with a placeholder; themodelkey usesprovider/model, for exampleollama/<small-model>). - Telemetry is on by default. The docs say to set
experimental.openTelemetrytofalseinkilo.jsonc. In the extension's source, Kilo turns telemetry off when VS Code's own telemetry is off, so set"telemetry.telemetryLevel": "off"too.
The first block goes in your VS Code user settings, the second in kilo.jsonc next to provider:
{
"kilo-code.new.autocomplete.enableAutoTrigger": false,
"telemetry.telemetryLevel": "off"
}
{
"experimental": { "openTelemetry": false },
"small_model": "ollama/<small-model>"
}
Linux#
Press Ctrl+Shift+P, run Preferences: Open User Settings (JSON), add the first block. Edit ~/.config/kilo/kilo.jsonc for the second.
Windows (PowerShell)#
Press Ctrl+Shift+P, run Preferences: Open User Settings (JSON), add the first block. Edit $HOME\.config\kilo\kilo.jsonc for the second.
Mac (Terminal)#
Press Cmd+Shift+P, run Preferences: Open User Settings (JSON), add the first block. Edit ~/.config/kilo/kilo.jsonc for the second.
Check it worked. After a reload, typing shows no grey autocomplete suggestions, and Settings, Models shows your small model. To be sure, watch the VS Code processes' connections in your firewall for a few minutes: only localhost should appear, plus VS Code's own traffic. I did not capture traffic.
Tip: Kilo's telemetry code sends a random machine ID, OS, version, model and provider names, and your account email once you sign in. Its event definitions have no prompt or file fields. I read that in the source; I did not capture it on the wire.
Step 6: Tighten approvals and run a first task#
Kilo's quickstart says "By default, most tools are auto-approved", and only shell commands, files outside the project and sensitive file reads such as .env ask first. A small local model makes mistakes, so make edits and commands ask. Each tool takes allow, ask or deny. Add to kilo.jsonc:
{
"permission": {
"edit": "ask",
"bash": "ask"
}
}
Then test in a throwaway folder.
Linux#
mkdir ~/kilo-test && cd ~/kilo-test && git init && code .
Windows (PowerShell)#
New-Item -ItemType Directory $HOME\kilo-test | Out-Null cd $HOME\kilo-test git init code .
Mac (Terminal)#
mkdir ~/kilo-test && cd ~/kilo-test && git init && code .
In the Kilo panel type the docs' example task: "Create a file named hello.txt containing 'Hello, world!'."
Check it worked. Kilo asks before it writes the file. Approve it, then run git status in the folder: hello.txt is listed as new. Kilo's docs say snapshots (Git-based, taken before and after agent edits) let you revert a message's changes from the chat.
Tip: Reload the window after changing the project
kilo.jsonc. The docs say Kilo caches project rules when it loads a workspace, so an edited rule may not apply until you do.
What leaves your machine#
Kilo's local-models page says "Your code and data never leave your computer". That is true for the model request, but not for everything Kilo does.
| Part | Where data goes | What you can do |
|---|---|---|
Chat with an ollama/ or lmstudio/ model | Your own computer (localhost) | Keep the default addresses |
| Autocomplete | Kilo Gateway, on by default | Step 5 |
| Small model (titles, summaries) | Kilo cloud by default ("Auto Small") | Step 5 |
| Telemetry | PostHog, on by default | Step 5 |
| Sign-in | Kilo's servers; the built-in provider needs an account | Skip the Kilo provider and free models: the docs warn "Auto Free" may use providers that "log prompts and outputs" |
| Model catalogue | Kilo refreshes a snapshot of models.dev hourly | Not documented as switchable; watch your firewall |
| Codebase indexing | Off by default. Ollama can make the embeddings "fully offline" | Leave it off, or use a local embedding provider |
| Session sharing | Only if you create a link; local sessions stay on your machine | Share mode disabled under Experimental |
ollama-cloud/ models, web fetch, MCP servers | Hosted services or the sites you ask for | Pick ollama/ models; keep webfetch on ask |
Kilo Code or Cline?#
Both are VS Code agents with a local-model route. The differences that matter, from our Cline guide and the Kilo docs:
| Kilo Code (7.x) | Cline | |
|---|---|---|
| Approvals by default | Most tools run without asking; you tighten them | You approve each edit and command |
| Context for Ollama | Set on the Ollama side; limit.context only controls compaction | A "Model Context Window" field in Cline sends the number |
| Telemetry | On by default, PostHog | On by default, with its own opt-out |
| Account | Sign-in prompt; built-in provider needs it | Cline also contacts its servers for sign-in and flags |
For a terminal tool, see our Aider and OpenCode guides.
Security and testing#
- Keep Ollama local. It binds to
127.0.0.1:11434by default. Do not setOLLAMA_HOSTto0.0.0.0on a laptop. To use a home GPU from elsewhere, use Ollama over Tailscale. - Keys. A local setup needs none. If you add a cloud provider, keep keys out of any
kilo.jsoncyou commit: Kilo's docs say{env:VAR}references only resolve in your global config, so a project file cannot read them. - Commands. Keep
bashon ask: a file the model reads can contain instructions it then tries to follow. - Functional test. Check that Ollama answers on its own:
curl http://localhost:11434/v1/models
curl.exe http://localhost:11434/v1/models
Check it worked. You get a JSON list that contains your model. If Kilo says it cannot connect, this tells you whether Ollama or Kilo is at fault.
Common mistakes#
Each row comes from the Kilo docs or from a real issue in Kilo-Org/kilocode (state as read in November 2026). The last row is about AI assistants.
| Mistake | Why it happens | Do this instead |
|---|---|---|
Setting limit.context and expecting Ollama to load that much | In issue #10868 (June 2026, closed by a stale bot) a user set it and "Ollama keeps loading the model using the context value set at server level". Ollama's OpenAI endpoint cannot set context | Set OLLAMA_CONTEXT_LENGTH or the app slider (Step 2); then match limit.context to it; check CONTEXT in ollama ps |
| Leaving autocomplete, the small model and telemetry on | They default to the Kilo Gateway and PostHog (docs, source) | Step 5 |
| Leaving every tool on auto-approve with a small model | "Most tools default to allow" (docs); a weak model edits files without asking | Set edit and bash to ask (Step 6) |
| A custom model with no limits | Context and output resolve to 0, so compaction is off and output falls back to 32,000 (custom-models page). Issue #10558 (open since May 2026) shows "The model hit its output limit while reasoning" | Set both limit values |
| Long sessions on a 32K model | Issue #11076 (open since June 2026): "Compaction exhausted" after 2 or 3 compactions; the reporter says Kilo's system prompt uses about 15K tokens. Issue #15605 (open since October 2026): the summary is not injected after compacting | One task per session; use 64K if memory allows; start a fresh chat when it grows |
Setting temperature and nothing changes | Issue #15633 (open since October 2026): a custom model not in the catalogue is marked as not supporting temperature | Add "temperature": true to that model's entry |
Picking an ollama-cloud/ model thinking it is local | It is the hosted provider (docs callout) | Use ollama/<model> |
| "Cannot connect" to a working Ollama | Issue #12145 (July 2026, closed unanswered) and #14952 (open since October 2026, undefined/chat/completions): the base URL was wrong or unset | Test with curl (above), then set options.baseURL to http://localhost:11434/v1 |
| AI assistants describe the old extension or invent keys | They copy older tutorials: modes, .kilocode rules, a "Context Window Size (num_ctx)" box, VS Code settings for models. Our assessment from the docs, not a measured test | Check each key against the current docs: kilo.jsonc, provider.<id>.models.<model>.limit, permission, small_model |
Tip: The Ollama page in Kilo's own docs still carries old wording: a "Context Window Size (num_ctx)" setting and a 10-minute timeout. The custom-models page says the provider
timeoutdefaults to 300000 ms (5 minutes). Trust the page that matches what you see in Settings.
Tip: The docs disagree on where
baseURLgoes: the Ollama page puts it underprovider.ollama, the LM Studio page underoptions. This guide usesoptions, which the provider-options table supports.
Tip: Make the first session a throwaway: a clean folder, one small task,
ollama psopen in a second terminal.
Troubleshooting#
| Problem | Solution |
|---|---|
| "No connection could be made because the target machine actively refused it" | The server is not running or the port differs. Defaults: Ollama 11434, LM Studio 1234 (Kilo docs). Run the curl test |
| Model appears but never calls tools | The model lacks tool calling. Choose a tools model; set "tool_call": true |
| Kilo forgets the project | Context too small. Raise it (Step 2), restart Ollama, check ollama ps |
| Slow answers | Look at PROCESSOR in ollama ps; lower the context or use a smaller model. Kilo's docs: short conversations, simple prompts, fewer MCP tools |
| Window reload changes nothing | Kilo caches project config; reload the window |
| Windows: shell commands behave oddly | Check PowerShell is on the PATH. Issue #9440 (April 2026, closed): bash commands went to PowerShell when Bash was the default shell |
Ollama logs fill with /v1/embeddings | Codebase indexing is on. Issue #11134 (June 2026, closed stale). Turn indexing off |
Every prompt fails with SQLiteError: database disk image is malformed | The local database is damaged. Close VS Code, rename kilo.db and its -wal and -shm files (see Updates and backups), reopen |
Exact error texts#
Compaction exhausted: context still exceeds model limits after 3 attempts is from issue #11076. Start a new session, or run /compact by hand (the reporter says manual works).
The model hit its output limit while reasoning and produced no actionable output... is from issue #10558. Kilo's docs say to disable reasoning or raise limit.output.
Known bugs (open in November 2026)#
- #15633:
temperatureis not sent to a custom Ollama model (workaround in the table above). - #11076 and #15605: compaction fails or loses its summary in long sessions.
- #10558: reasoning models can run out of output budget.
- #14952: a custom Ollama provider can fail with
undefined/chat/completions.
Updates and backups#
Update. VS Code updates extensions itself. To stay on a version that worked, Kilo's docs say: download that release's .vsix from GitHub Releases, use Install from VSIX... in the Extensions menu, and turn off auto-update for the extension. Ollama downloads its own updates on Mac and Windows (Ollama FAQ); on Linux re-run the install script (Ollama Linux docs).
Back up. Kilo has no Docker volume; your data is ~/.config/kilo (settings) and the session database ~/.local/share/kilo/kilo.db (Windows: $HOME\.config\kilo and $HOME\.local\share\kilo\kilo.db). Close VS Code first. Leave model files out: Ollama downloads them again. If you added cloud keys, the archive may hold them, so do not share it.
mkdir -p ~/backups tar -czf ~/backups/kilo-$(date +%F).tar.gz -C ~ .config/kilo .local/share/kilo/kilo.db
New-Item -ItemType Directory -Force $HOME\backups | Out-Null Compress-Archive -Path "$HOME\.config\kilo","$HOME\.local\share\kilo\kilo.db" -DestinationPath "$HOME\backups\kilo-$(Get-Date -Format yyyy-MM-dd).zip"
Schedule it with cron at 03:00 on Linux and Mac, or with Windows Task Scheduler.
Restore test. Extract into a scratch folder and look at the files:
mkdir -p ~/kilo-restore-test && tar -xzf ~/backups/kilo-<date>.tar.gz -C ~/kilo-restore-test && ls -R ~/kilo-restore-test | head
If kilo.jsonc and kilo.db are there, the backup works. To reset a damaged database, rename kilo.db (and any -wal and -shm files) and restart: Kilo makes a new one, but local history is gone.
Performance and resources#
- Context costs memory. Ollama's FAQ says memory scales with the context and the number of parallel requests. Watch PROCESSOR in
ollama ps. - Speed tips from Kilo's docs. Simple prompts, short conversations, fewer MCP tools.
- Timeouts. A provider
timeoutoption (default 300000 ms per the custom-models page) can be raised for slow models underprovider.ollama.options;falseturns it off. - No figures here. Kilo's docs publish no speed or RAM numbers, and we took no timings.
FAQ#
Does it work offline? The docs say local models give "offline access", but Kilo also makes background calls. After Step 5, test with your network off before you rely on it.
Do I need a Kilo account? Not for the local model request, but the extension asks you to sign in at first launch. The docs do not say whether you can skip it; I could not test.
Which model should I use? Kilo's docs recommend qwen3-coder:30b, with devstral:24b as an alternative, and admit the 30b model "sometimes fails to call tools correctly". Our Cline guide lists smaller options.
Is Kilo Code still maintained? Yes. The repository has over 34,000 commits, a release in October 2026 and is not archived. Anaconda announced the acquisition in July 2026 and said open source stays; watch the licence and privacy pages.
Can I use a remote Ollama? Yes: set the base URL in the Providers tab. A user in issue #10868 saw only the "Ollama Cloud" entry in an older build, so check you picked the local provider.
Sources#
- Kilo Code docs and their source (
packages/kilo-docs) - read November 2026 - Installation, Authentication, Your first task, Settings and Auto-approving actions - read November 2026
- VS Code page and what's new, Ollama provider, LM Studio provider, Local models and Custom models - read November 2026
- Using Kilo for free, Autocomplete and Troubleshooting extensions - read November 2026
- Kilo-Org/kilocode on GitHub (MIT), release v7.8.18, the extension's
package.jsonand thekilo-telemetrysource at that tag, and PRIVACY.md - read November 2026 - The new Kilo Code for VS Code is generally available (April 2026) and Anaconda acquires Kilo Code (July 2026) - read November 2026
- Kilo Code on Open VSX - version 7.8.26, pre-release - read November 2026
- Ollama: context length, FAQ, OpenAI compatibility; VS Code: command line, telemetry - read November 2026
- GitHub issues in Kilo-Org/kilocode: #10868, #11076, #12145, #15633, #10558, #11134, #9440, #14952, #15605 - read November 2026
Checked against the official docs on 2026-11-05.