Intermediate 13 minAgents

Kilo Code with a local model: Ollama, LM Studio

BestLLMfor — Kilo Code — Ollama & LM Studio
Direct response

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.

By Mohamed Meguedmi·Update 2026-12-01·Tested on Windows, macOS, and Linux

#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?

The complete kit for building your own AI copilot.

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).

i
Free doesn't mean no account
Kilo Code's local provider documentation doesn't require an API key for Ollama or for LM Studio. It doesn't specify whether a Kilo account is required to get started; if the extension asks for one, that sign-in is part of the network traffic Kilo lists.

#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.

Local models for Kilo Code: sizes published by Ollama as of November 18, 2026
Model (Ollama name)File sizeNative contextStatus in Kilo's documentationTarget machine
qwen3-coder:30b19 GB256K tokensCurrent recommendation for the agent24 GB GPU or Mac with 32 GB or more
devstral:24b14 GB128K tokensAlternative mentioned24 GB GPU or Mac with 32 GB or more
devstral-small-2:24b15 GB384K tokensNot 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 Q4variableGood enough for Enhance Prompt or commit messages, according to KiloMore 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.

  1. 01
    Install the VS Code extension
    Open 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.
  2. 02
    Other editor or terminal
    For 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.
Terminal (Windows, macOS, Linux): VS Code extension
code --install-extension kilocode.kilo-code
Terminal (Windows, macOS, Linux, Node.js required): Kilo CLI
npm install -g @kilocode/cli

#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.

  1. 01
    Install and start Ollama
    Install 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.
  2. 02
    Download the model
    In a second terminal, download the model with ollama pull qwen3-coder:30b. Expect a 19 GB download, according to the model's Ollama page.
  3. 03
    Adding Ollama in Kilo Code
    In 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.
  4. 04
    Choose the model
    Select 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.
  5. 05
    Validate on a small task
    Ask 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.
Terminal (Windows, macOS, Linux): download the recommended model
ollama pull qwen3-coder:30b

#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.

macOS and Linux (terminal): example from the Ollama documentation
OLLAMA_CONTEXT_LENGTH=64000 ollama serve

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.

kilo.json (VS Code extension and CLI): example from the Kilo documentation
{
  "model": "ollama/my-finetune:latest",
  "provider": {
    "ollama": {
      "models": {
        "my-finetune:latest": {
          "name": "My Fine-tuned Model",
          "tool_call": true,
          "limit": {
            "context": 32768,
            "output": 8192,
          },
        },
      },
    },
  },
}

#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.

Terminal (Windows, macOS, Linux): start the LM Studio server
lms server start

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.

Ollama or LM Studio with Kilo Code: the practical differences
CriterionOllamaLM Studio
Address expected by Kilo Codehttp://127.0.0.1:11434http://127.0.0.1:1234/v1
Starting the serverollama serve (ou application lancée)Developer tab, Start server, or lms server start
Model name in Kiloollama/name:taglmstudio/identifiant
Model managementFrom the command line (ollama pull, ollama ls)Graphical interface with search
Context settingApp slider or OLLAMA_CONTEXT_LENGTH variableContext length setting in LM Studio
Kilo's recommended profileLightweight background service, scriptableVisual 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.

What stays on your machine and what goes over the network (Kilo documentation, November 18, 2026)
Kilo Code featureWhere it runs with Ollama or LM StudioHow to stay local
Agent (Code, Plan, Ask, Debug)On your machineNothing: choose an ollama/ or lmstudio/ model
Inline autocompletionKilo Gateway, Codestral modelPause autocomplete from the status bar
Background tasks (session titles, context summarization)Auto Small, hosted, billed in creditsChange the small model in Settings, Models
Sign-in, updates, telemetryNetworkCheck each setting, according to Kilo
Remote MCP serversNetworkEnable only local MCP servers
Cloud Agents, hosted code reviewKilo cloud, pay-as-you-goDon't use them
!
Small background model
Kilo Code's documentation recommends replacing Auto Small with a free model in Settings, then Models. In the CLI, the setting is called small_model, in ~/.config/kilo/config.json. The documentation doesn't explicitly say whether a Ollama or LM Studio model is accepted there; if the small model is unavailable, Kilo falls back to your main model. After changing the setting, check that Kilo's cost counter no longer increases during a session.

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.

Terminal (Windows, macOS, Linux): loaded models, context, and GPU
ollama ps
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.
→
The test that proves everything is local
Turn off Wi-Fi, then ask the Kilo Code agent to summarize a file in the project. If you get a response, the agent's inference really is local. Online features (autocomplete, session titles, updates) will then fail: that's expected, and it shows they depended on the network.
Frequently asked questions
Does Kilo Code work with Ollama in JetBrains and on the command line?+
Yes. According to Kilo's official FAQ, Ollama is supported as a local provider in the VS Code extension, the JetBrains plugin, and the Kilo Code CLI. The setup is the same everywhere: provider Ollama, model written as ollama/ followed by its name, and address http://127.0.0.1:11434 if Ollama runs on the same machine.
What's the best free model for coding with Kilo Code?+
For a local coding agent, the Kilo Code documentation recommends qwen3-coder:30b on Ollama, a free 19 GB model from Alibaba, with devstral:24b from Mistral AI as an alternative. You need a 24 GB GPU or a 32 GB Mac for decent speed.
Does Kilo Code work without an internet connection?+
Kilo Code's agent works offline with Ollama or LM Studio, since inference runs on your machine. However, autocomplete, default background tasks, updates, remote MCP servers, and cloud features require network access. Kilo states that fully air-gapped use requires configuring each dependency.
Are the free models hosted by Kilo Code confidential?+
No, not necessarily. The Kilo Code documentation warns that the Auto Free tier may send your requests to providers that log prompts and responses to improve their services, and it asks you not to submit personal or confidential data there. For confidential code, a local model via Ollama or LM Studio removes this risk for the agent.
Why does Kilo Code forget my request with Ollama?+
Most often, the Ollama context is too short. On a GPU with less than 24 GiB, Ollama allocates 4k tokens by default according to its documentation, whereas Kilo Code requires at least 32k tokens. The agent's instructions and the files it reads then get truncated. Increase the context in the Ollama app or with OLLAMA_CONTEXT_LENGTH, then check the CONTEXT column of ollama ps.

#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.

Did this guide help you?

Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.