Kilo Code with a local model: Ollama, LM Studio

Kilo Code is an open source coding agent (MIT license) for VS Code, JetBrains, and the terminal that runs for free with a local model via Ollama or LM Studio. Its documentation recommends qwen3-coder:30b, a context of at least 32k tokens, and a 24 GB GPU or a 32 GB Mac. Only the agent becomes local: autocomplete and background tasks go through Kilo's cloud by default.
Kilo Code connects to Ollama or LM Studio with just a few settings and no API key. This guide covers the up-to-date procedure as of November 18, 2026, which model to download for your machine, the context setting that prevents truncated responses, and a list of what still goes over the network. You'll learn how to verify that your code stays on your machine.
#What is Kilo Code?
Kilo Code is an open source coding agent that reads your project, edits multiple files, runs commands, and fixes its own work. According to the official GitHub repository, accessed November 18, 2026, Kilo Code works in VS Code, in JetBrains IDEs, and on the command line (CLI), and its code is released under the MIT license, commercial use included.
Kilo Code has changed its technical foundation: according to its documentation, the current VS Code extension is built on the Kilo CLI, which is itself a fork of the open-source OpenCode agent. Kilo Code offers four built-in agents: Code (the default), Plan for designing before writing code, Ask for querying the project without touching any files, and Debug for tracing a problem.
Kilo Code has been acquired by Anaconda: the company announced the deal on July 15, 2026, and the Kilo documentation now displays "Kilo has been acquired by Anaconda." The repository remains public: the latest stable release on GitHub is v7.8.27, from November 5, 2026, and pre-releases come out almost daily.
- Code agent
- A program that takes an instruction in natural language, reads files, calls tools (read, write, terminal), and chains steps together until it reaches a result.
- Provider
- In Kilo Code, the service that runs the model: Kilo Gateway, an API key, or local software like Ollama or LM Studio.
- Tool call
- A structured request through which the model asks Kilo Code to take an action. A local model that fails its tool calls blocks the agent, even if it codes well in conversation.
#Is Kilo Code free with a local model?
Benefit from our experience and a guided path to build your local copilot and get comfortable with your coding assistant.
- Lifetime online access
- PDF + files
- Refunded within 30 days
Yes, Kilo Code is free with a local model: the official pricing page, checked on November 18, 2026, puts usage with Ollama or LM Studio in the $0-per-month tier, with no paid inference plan. You only pay for your hardware and the electricity it uses.
Kilo Code's pricing page breaks costs into three items. The platform is free for individuals; the Teams plan costs $15 per user per month. Inference is billed at the provider's rate when you go through Kilo Gateway, or through the Kilo Pass subscription starting at $19 per month. Cloud compute (Cloud Agent, hosted code review) is billed by usage, for example $0.60 per hour for a Cloud Agent, billed per second.
With Ollama or LM Studio, those last two costs go away as long as you avoid hosted features. Exception: autocomplete and background tasks use online models paid for with credits by default (see below for what stays online).
#Which local model should you choose for Kilo Code?
For Kilo Code's agent, the official documentation recommends qwen3-coder:30b on Ollama, with devstral:24b as an alternative. It recommends a GPU with at least 24 GB of VRAM or a Mac with at least 32 GB of unified memory for decent speed.
Qwen3-Coder 30B-A3B is a mixture-of-experts (MoE) model from Alibaba: according to its Ollama page, it has 30 billion parameters, 3.3 billion of them active, a 19 GB size, and a native context of 256K tokens. Kilo Code warns that it sometimes fails its tool calls, much more often than the 480-billion-parameter version, and recommends rephrasing the prompt when that happens.
Devstral is Mistral AI's model family designed for coding agents. Kilo lists devstral:24b, the first version; Ollama also offers the newer Devstral Small 2 (devstral-small-2:24b): 15 GB and 384K tokens of context according to its model card. Kilo doesn't list it yet, so compare the two on a small task.
| Model (Ollama name) | File size | Native context | Status in Kilo's documentation | Target machine |
|---|---|---|---|---|
| qwen3-coder:30b | 19 GB | 256K tokens | Current recommendation for the agent | 24 GB GPU or Mac with 32 GB or more |
| devstral:24b | 14 GB | 128K tokens | Alternative mentioned | 24 GB GPU or Mac with 32 GB or more |
| devstral-small-2:24b | 15 GB | 384K tokens | Not mentioned (newer than devstral:24b) | 24 GB GPU or Mac with 32 GB or more |
| Small model (7 to 8 billion parameters) | about 5 GB at Q4 | variable | Good enough for Enhance Prompt or commit messages, according to Kilo | More modest machine |
Context comes on top of the memory taken by the weights, and Kilo Code requires at least 32k tokens of context. On a 16 GB card, a 19 GB file doesn't fit entirely in VRAM: part of the model spills over to the CPU, which the Ollama documentation advises against. The PROCESSOR column of the ollama ps command should show 100% GPU. The site's VRAM calculator estimates weights and context before you download.
#How do you install Kilo Code in VS Code, JetBrains, or the terminal?
You can install Kilo Code from your editor's marketplace or from the command line. In VS Code, the documentation tells you to choose the Install Pre-Release Version option: according to Kilo, this pre-release channel is stable and recommended for everyone, and it requires VS Code 1.84.0 or later.
- 01Install the VS Code extensionOpen the Extensions view (Ctrl+Shift+X on Windows and Linux, Cmd+Shift+X on macOS), search for Kilo Code, click the arrow next to Install, and choose Install Pre-Release Version.
- 02Other editor or terminalFor VSCodium and compatible editors, install Kilo Code from the Open VSX registry. For a JetBrains IDE, search for Kilo Code under Settings, then Plugins. For the terminal, install the CLI with npm, then run the kilo command in your project folder.
#How do you connect Kilo Code to Ollama?
To connect Kilo Code to Ollama, run Ollama, download a model, then add Ollama in the Providers tab of Kilo Code's settings. No API key is required. In Kilo, local models are written as ollama/ followed by the name, for example ollama/qwen3-coder:30b.
- 01Install and start OllamaInstall Ollama from its official website, then check that the service is running. If the app hasn't already started it, run the ollama serve command in a terminal and leave it open.
- 02Download the modelIn a second terminal, download the model with ollama pull qwen3-coder:30b. Expect a 19 GB download, according to the model's Ollama page.
- 03Adding Ollama in Kilo CodeIn Kilo Code, open the settings (gear icon), go to the Providers tab, and add Ollama. Keep the default address if Ollama is running on the same machine. The extension saves this setting in the kilo.json file.
- 04Choose the modelSelect ollama/qwen3-coder:30b in Kilo Code's model picker, under the Ollama provider. Don't confuse it with Ollama Cloud, offered through Kilo Gateway or your own key (BYOK): according to Kilo's documentation, that's a hosted service that doesn't connect to your local Ollama.
- 05Validate on a small taskAsk the agent to read a single file and suggest a small change. Kilo recommends validating tool calls on a short task before any long-running work.
#Setting the Ollama context for Kilo Code
Ollama's context is the first pitfall with Kilo Code. According to the Context length page in the Ollama documentation, the default context depends on VRAM: 4k tokens below 24 GiB, 32k from 24 to 48 GiB, and 256k above that. Kilo Code needs at least 32k tokens: below 24 GiB, the agent's instructions and the code it reads get truncated, and the agent seems to forget its task.
Ollama recommends at least 64,000 tokens for coding tools and agents. You can set the context with the slider in the Ollama app settings, or with the OLLAMA_CONTEXT_LENGTH environment variable when starting the server, as in the example below from the Ollama documentation. If you run short on memory, drop down to 32768, the minimum Kilo requires: a longer context uses more memory and can slow down generation.
The ollama ps command lets you verify the setting applied to Ollama: its CONTEXT column shows the context allocated to the loaded model, and its PROCESSOR column shows whether the model fits entirely on the GPU. Run it after Kilo Code's first request.
If a model isn't in the Kilo Code model picker, you declare it manually in kilo.json. The example below, taken from the Kilo documentation, declares a model named my-finetune:latest with tool calling enabled, 32,768 tokens of context, and 8,192 output tokens. Replace that name with the one listed by Ollama.
#How do you connect Kilo Code to LM Studio?
To connect Kilo Code to LM Studio, load a model in LM Studio, start its local server, then add LM Studio in Kilo Code's Providers tab. The LM Studio server mimics the OpenAI API and listens by default at http://127.0.0.1:1234/v1, with no API key.
LM Studio is a desktop app that downloads and runs local models through a graphical interface. Its current documentation has you start the server from the Developer tab (Start server toggle) or from the terminal; the Kilo Code page that mentions a Local Server tab describes the old interface.
In Kilo Code, LM Studio models are written as lmstudio/ followed by the identifier served by LM Studio. A model missing from the picker can be declared in kilo.json, with a key identical to that identifier, according to Kilo's documentation.
The models listed on Kilo Code's LM Studio page (CodeLlama, Mistral 7B, DeepSeek Coder 6.7B) are several generations old. Instead, look in LM Studio for GGUF versions of Qwen3-Coder 30B-A3B or Devstral Small 2. On an Apple Silicon Mac, LM Studio also runs models in Apple's MLX format, according to its documentation: choose the MLX version when one is available.
| Criterion | Ollama | LM Studio |
|---|---|---|
| Address expected by Kilo Code | http://127.0.0.1:11434 | http://127.0.0.1:1234/v1 |
| Starting the server | ollama serve (ou application lancée) | Developer tab, Start server, or lms server start |
| Model name in Kilo | ollama/name:tag | lmstudio/identifiant |
| Model management | From the command line (ollama pull, ollama ls) | Graphical interface with search |
| Context setting | App slider or OLLAMA_CONTEXT_LENGTH variable | Context length setting in LM Studio |
| Kilo's recommended profile | Lightweight background service, scriptable | Visual model browser |
#Is Kilo Code with Ollama really 100% local?
No, Kilo Code with Ollama isn't fully offline by default. Kilo's official FAQ states that only model inference stays local: sign-in, updates, remote MCP servers, telemetry, Cloud Agents and hosted code review follow their own network paths.
Two Kilo Code features bypass your local provider. Inline autocomplete goes through Kilo Gateway and uses Codestral from Mistral, paid for with Kilo credits or your own Mistral key. Background tasks, session titling and context summarization, use a small hosted model called Auto Small by default, which is also paid for with credits. A local setup that overlooks these two settings still sends code online.
| Kilo Code feature | Where it runs with Ollama or LM Studio | How to stay local |
|---|---|---|
| Agent (Code, Plan, Ask, Debug) | On your machine | Nothing: choose an ollama/ or lmstudio/ model |
| Inline autocompletion | Kilo Gateway, Codestral model | Pause autocomplete from the status bar |
| Background tasks (session titles, context summarization) | Auto Small, hosted, billed in credits | Change the small model in Settings, Models |
| Sign-in, updates, telemetry | Network | Check each setting, according to Kilo |
| Remote MCP servers | Network | Enable only local MCP servers |
| Cloud Agents, hosted code review | Kilo cloud, pay-as-you-go | Don't use them |
Local models also lose advanced features: according to Kilo Code's documentation, they often don't support prompt caching or computer use.
#Kilo Code isn't responding: how do you check and troubleshoot?
When Kilo Code doesn't respond with a local model, first check that the server is running at the expected address, then the exact model name, then the context. Kilo's documentation attributes the connection-refused error to a stopped server or a wrong port.
- Connection refused (target machine actively refused it)
- Ollama or LM Studio is stopped or listening on a different port. Check the base URL in Kilo Code: http://127.0.0.1:11434 for Ollama, http://127.0.0.1:1234/v1 for LM Studio.
- Model not found
- The name differs from the server's. With Ollama, use the name given to ollama run ou as listed by ollama ls; with LM Studio, use the identifier served by the server.
- "check the LM Studio developer logs" error
- According to Kilo Code, you then often need to adjust the context length setting in LM Studio.
- Timed out
- By default, Kilo Code cuts off a request after 10 minutes. Increase API Request Timeout in the extension settings, or pick a smaller model.
- Loops and failed tool calls
- Kilo warns that local models get stuck in loops more often. Keep conversations short, disable MCP tools you don't need, and rephrase the instruction.
Does Kilo Code work with Ollama in JetBrains and on the command line?+
What's the best free model for coding with Kilo Code?+
Does Kilo Code work without an internet connection?+
Are the free models hosted by Kilo Code confidential?+
Why does Kilo Code forget my request with Ollama?+
#Sources and verification as of November 18, 2026
The versions, prices, URLs, commands, and model recommendations in this guide were checked on November 18, 2026, against Kilo Code's documentation and pricing page, Kilo's GitHub repository, Anaconda's announcement, and the Ollama and LM Studio documentation; Kilo Code ships new versions almost daily, and these details may change.
- Source: Using Ollama With Kilo Code (Kilo documentation)
- Source: Using LM Studio With Kilo Code (Kilo documentation)
- Source: Using Local Models (Kilo documentation)
- Source: Ollama FAQ and Kilo, offline features (Kilo)
- Source: Autocomplete (Kilo documentation)
- Source: Using Kilo for Free (Kilo documentation)
- Source: Kilo Code pricing page
- Source: Kilo-Org/kilocode GitHub repository
- Source: announcement of the acquisition by Anaconda (July 15, 2026)
- Source: Context length, default context by VRAM (Ollama documentation)
- Source: GGUF and MLX formats (LM Studio documentation)
- Source: LM Studio local server (LM Studio documentation)
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.