How to use Ollama in VS Code with Kingcurve
Kingcurve turns any model you run in Ollama into an AI coding assistant inside Visual Studio Code: chat about your code, get multi-file edits as diffs you approve, and run an agent that reads files, edits and runs tests. It is free and MIT-licensed. Nothing goes to the cloud, and there is no account to create.
1. Install Ollama and a model
Install Ollama from ollama.com and start it.
Download a coding model, for example:
ollama pull qwen2.5-coder:7bChoose a size that fits your computer's memory; larger models give better answers.
- For Agent mode, use a model that supports tool calling. The Ollama library marks these models with a tools tag.
- For screenshots and UI mockups, use a model with vision, for example
gemma3,qwen2.5vlorllava.
2. Install Kingcurve
Install Kingcurve from the Visual Studio Marketplace, or search for "Kingcurve" in the Extensions view. It needs VS Code 1.106 or newer.
3. Connect to Ollama
Open Kingcurve with Cmd+Alt+M (macOS) or Ctrl+Alt+M (Windows, Linux). It opens in the Secondary Side Bar on the right. Kingcurve finds Ollama at http://127.0.0.1:11434 automatically. Click Test on the Ollama provider, then choose your model in the message box (bottom left).
4. Context length: automatic
The context length is how much text the model can consider at once. Ollama's own default is small and silently cuts off longer prompts. Kingcurve sets it for you (num_ctx), and it adjusts with the conversation:
- It starts at 8K tokens and grows to 16K, then 32K, as the conversation gets longer. Within a conversation it never shrinks, because changing
num_ctxmakes Ollama reload the model. - Agent mode starts at the maximum right away. The descriptions of its tools alone take about 2,100 tokens, and every file it reads is added.
- The maximum is 32K by default, and never more than the model supports. Raise it in Settings → Maximum automatic context if your computer has the memory, or lower it if the model gets slow.
- To use a fixed value instead, set Context length in Settings or in the provider's advanced options.
5. Choose a mode
| Mode | Best for |
|---|---|
| Ask | Questions about your code. Read-only |
| Edit | Changes proposed as diffs. Works with every model |
| Plan | A step-by-step plan you approve before anything changes |
| Agent | Reading, editing, running commands and tests, and checking the result. Needs tool calling |
Attach context with @ (@file, @folder, @selection, @problems, @git, @workspace), or paste a screenshot. Every edit is shown as a diff before it is written, and every command asks for your approval.
6. Optional: inline autocomplete
Kingcurve can show ghost-text completions while you type. With Ollama models that support fill-in-the-middle (the insert capability, for example qwen2.5-coder), it uses Ollama's native fill-in-the-middle API, which is fast. Turn it on in Settings → Autocomplete and choose the model. It is off by default.
Troubleshooting
- Kingcurve cannot connect. Check that Ollama is running (
ollama serve). If it listens on another address, edit the provider's Base URL. - Ollama runs on another computer. On that computer, start Ollama with
OLLAMA_HOST=0.0.0.0. In Kingcurve, set the Base URL tohttp://<its-ip>:11434. - "The conversation no longer fits the model context window". Raise Maximum automatic context in Settings (step 4), or start a new conversation with +.
- Agent mode is unavailable. The selected model cannot call tools. Choose a model with the tools tag, or use Edit mode, which works with every model.
- "cannot read images". The model has no vision support. Choose a vision model such as
gemma3orqwen2.5vl.