Kilo Code
Connect Kilo Code to your own endpoint with the right wire API, credentials that never land in a repo, and limit.context and limit.output set so context management works.
Scope: Kilo Code only: custom providers in the extension and in kilo.jsonc, key handling, model mapping, tool-calling and streaming caveats, troubleshooting. Serving belongs to vllm, llama-cpp, ollama, llama-swap; the gateway to litellm. Other clients: cline, continue, cursor, llm-clients. Roo Code, an ancestor of Kilo, is archived and has no skill.
Work through the steps in order. Load a reference only when a step names it.
Discover first
Read-only, never prints secret values.
code --list-extensions --show-versions 2>/dev/null | grep -i kilocode
command -v kilo && kilo --version
kilo debug paths 2>/dev/null # where config, data, cache live
ls -l ~/.config/kilo/ ./kilo.json ./kilo.jsonc 2>/dev/null # config files and modes
jq -r '.provider // {} | to_entries[] | "\(.key) \(.value.npm // "default") \(.value.options.baseURL // "-")"' ~/.config/kilo/kilo.json 2>/dev/null # ids and URLs, no keys
kilo models 2>/dev/null | head -20 # models Kilo can use now
env | cut -d= -f1 | grep -E '^(KILO|LLM|LITELLM)_' || true # names only
gh api repos/Kilo-Org/kilocode/releases --jq '[.[]|select(.tag_name|test("^v[0-9]"))][0].tag_name'
LLM_API_KEY_FILE=~/.config/llm/kilo.key scripts/probe.sh http://127.0.0.1:4000/v1 coder
kilo.jsonc allows comments; jq only reads a strict-JSON kilo.json. Ask only what discovery cannot show: which wire API the endpoint speaks, gateway or engine, extension or CLI, global or project config.
Decision flow
- Endpoint serves OpenAI Chat Completions (vLLM, llama.cpp, LiteLLM, llama-swap, Ollama
/v1): Provider API "OpenAI Compatible" (@ai-sdk/openai-compatible, the default). -> references/providers-endpoints.md
- Endpoint serves the OpenAI Responses API: "OpenAI Responses" (
@ai-sdk/openai). -> references/providers-endpoints.md
- Endpoint serves Anthropic Messages (LiteLLM
/v1/messages, a bridge): "Anthropic Messages" (@ai-sdk/anthropic). -> references/providers-endpoints.md
- Ollama or LM Studio on the same host: their built-in providers. ->
references/providers-endpoints.md
- Per-engine values: ->
references/combos/self-hosted-endpoints.md
- Context never compacts, tools missing, models not listed: ->
references/troubleshooting.md
- Install, CLI, version drift: ->
references/install.md, references/updating.md
Rules
- Ask before changing the system. Show the
kilo.jsonc diff first; keep a backup copy and name the restore step.
- Secrets never touch output. Reference keys as
{env:NAME} or {file:/path} and keep them in your global config (~/.config/kilo) and 0600 files. A project-level kilo.json cannot resolve {env:} (by design) and must never hold a literal apiKey. Never print config files that may contain keys.
- Set
limit.context and limit.output for every custom or local model. Unset limits resolve to 0: compaction is disabled, output falls back to 32,000 tokens, usage tracking is skipped.
- Set
tool_call: true for models that must edit files or run commands.
- Trim auto-fetched model lists. The picker lists everything the key can see; keep the aliases you want.
- Azure GPT-5 is not custom-provider territory. Use the native
azure provider; generic providers send max_tokens.
- Verify upstream. Kilo ships quickly; kilo.ai/docs and the releases page are the source of truth at use time.
Workflows
Add a self-hosted model (extension)
Add a self-hosted model (CLI or advanced)
Reference index
| File |
Read when |
references/install.md |
Extension, JetBrains, CLI install; config locations; versions |
references/providers-endpoints.md |
Custom provider fields, kilo.jsonc schema, wire APIs, keys, limits |
references/combos/self-hosted-endpoints.md |
Exact entries per vLLM, llama.cpp, Ollama, LiteLLM, llama-swap |
references/troubleshooting.md |
Symptom to cause to fix |
references/updating.md |
Updating, version lines, re-verification |
Template: assets/kilo.jsonc. Script: scripts/probe.sh (read-only; key from LLM_API_KEY or LLM_API_KEY_FILE).
Companion skills
Install any with npx skills add ScaleDockHQ/llm-skills --skill <name>.
litellm: gateway with scoped virtual keys and aliases for Kilo.
llm-gateway: whether to use a gateway at all.
llm-clients: other coding agents and IDE extensions.
cline, continue, cursor: other editor clients.
vllm, llama-cpp, ollama, llama-swap: serving the model Kilo talks to.
1---2name: kilo-code3description: "Configure Kilo Code (VS Code, JetBrains, kilo CLI) for self-hosted LLMs through Custom provider or kilo.jsonc, picking OpenAI Compatible, OpenAI Responses or Anthropic Messages per endpoint, with baseURL, keys, model id mapping and context limits for vLLM, llama.cpp, Ollama, LiteLLM and llama-swap. Use for kilo.json, limit.context, tool_call, auto-fetch models, or compaction not working."4license: MIT5compatibility: Kilo Code extension for VS Code or JetBrains, or the kilo CLI (@kilocode/cli). Probe script needs bash, curl and jq. Editing kilo.jsonc or provider credentials needs the user's approval.6metadata:7 source: https://skillmd.com/skills/scaledockhq/kilo-code8 author: ScaleDockHQ9 version: "0.1.0"10---1112# Kilo Code1314Connect Kilo Code to your own endpoint with the right wire API, credentials that never land in a repo, and `limit.context` and `limit.output` set so context management works.1516**Scope:** Kilo Code only: custom providers in the extension and in `kilo.jsonc`, key handling, model mapping, tool-calling and streaming caveats, troubleshooting. Serving belongs to `vllm`, `llama-cpp`, `ollama`, `llama-swap`; the gateway to `litellm`. Other clients: `cline`, `continue`, `cursor`, `llm-clients`. Roo Code, an ancestor of Kilo, is archived and has no skill.1718Work through the steps in order. Load a reference only when a step names it.1920## Discover first2122Read-only, never prints secret values.2324```bash25code --list-extensions --show-versions 2>/dev/null | grep -i kilocode26command -v kilo && kilo --version27kilo debug paths 2>/dev/null # where config, data, cache live28ls -l ~/.config/kilo/ ./kilo.json ./kilo.jsonc 2>/dev/null # config files and modes29jq -r '.provider // {} | to_entries[] | "\(.key) \(.value.npm // "default") \(.value.options.baseURL // "-")"' ~/.config/kilo/kilo.json 2>/dev/null # ids and URLs, no keys30kilo models 2>/dev/null | head -20 # models Kilo can use now31env | cut -d= -f1 | grep -E '^(KILO|LLM|LITELLM)_' || true # names only32gh api repos/Kilo-Org/kilocode/releases --jq '[.[]|select(.tag_name|test("^v[0-9]"))][0].tag_name'33LLM_API_KEY_FILE=~/.config/llm/kilo.key scripts/probe.sh http://127.0.0.1:4000/v1 coder34```3536`kilo.jsonc` allows comments; `jq` only reads a strict-JSON `kilo.json`. Ask only what discovery cannot show: which wire API the endpoint speaks, gateway or engine, extension or CLI, global or project config.3738## Decision flow39401. **Endpoint serves OpenAI Chat Completions** (vLLM, llama.cpp, LiteLLM, llama-swap, Ollama `/v1`): Provider API "OpenAI Compatible" (`@ai-sdk/openai-compatible`, the default). -> `references/providers-endpoints.md`412. **Endpoint serves the OpenAI Responses API:** "OpenAI Responses" (`@ai-sdk/openai`). -> `references/providers-endpoints.md`423. **Endpoint serves Anthropic Messages** (LiteLLM `/v1/messages`, a bridge): "Anthropic Messages" (`@ai-sdk/anthropic`). -> `references/providers-endpoints.md`434. **Ollama or LM Studio on the same host:** their built-in providers. -> `references/providers-endpoints.md`445. **Per-engine values:** -> `references/combos/self-hosted-endpoints.md`456. **Context never compacts, tools missing, models not listed:** -> `references/troubleshooting.md`467. **Install, CLI, version drift:** -> `references/install.md`, `references/updating.md`4748## Rules4950- **Ask before changing the system.** Show the `kilo.jsonc` diff first; keep a backup copy and name the restore step.51- **Secrets never touch output.** Reference keys as `{env:NAME}` or `{file:/path}` and keep them in your global config (`~/.config/kilo`) and `0600` files. A project-level `kilo.json` cannot resolve `{env:}` (by design) and must never hold a literal `apiKey`. Never print config files that may contain keys.52- **Set `limit.context` and `limit.output`** for every custom or local model. Unset limits resolve to `0`: compaction is disabled, output falls back to 32,000 tokens, usage tracking is skipped.53- **Set `tool_call: true`** for models that must edit files or run commands.54- **Trim auto-fetched model lists.** The picker lists everything the key can see; keep the aliases you want.55- **Azure GPT-5 is not custom-provider territory.** Use the native `azure` provider; generic providers send `max_tokens`.56- **Verify upstream.** Kilo ships quickly; kilo.ai/docs and the releases page are the source of truth at use time.5758## Workflows5960### Add a self-hosted model (extension)6162- [ ] Probe: `scripts/probe.sh <base>/v1 <model>`; note `tool_calls`.63- [ ] Settings > Providers > Custom provider: Provider ID, Display name, Provider API, Base URL, API key, Models (or Fetch models), Headers if needed; Submit.64- [ ] Open the config and add `limit`, `tool_call` and `modalities` per model (see `assets/kilo.jsonc`).65- [ ] Select `provider_id/model_id`; ask the agent to create a file; confirm path and model in the gateway log.6667### Add a self-hosted model (CLI or advanced)6869- [ ] Copy the relevant block from `assets/kilo.jsonc` into `~/.config/kilo/kilo.jsonc`.70- [ ] Keep the key in `{env:LLM_API_KEY}` (exported in the shell that starts `kilo`) or `{file:/home/you/.config/llm/kilo.key}`.71- [ ] `kilo models` lists it; `kilo debug config` shows the resolved config; run `kilo -m provider_id/model_id`.7273## Reference index7475| File | Read when |76| -------------------------------------------- | ------------------------------------------------------------------ |77| `references/install.md` | Extension, JetBrains, CLI install; config locations; versions |78| `references/providers-endpoints.md` | Custom provider fields, kilo.jsonc schema, wire APIs, keys, limits |79| `references/combos/self-hosted-endpoints.md` | Exact entries per vLLM, llama.cpp, Ollama, LiteLLM, llama-swap |80| `references/troubleshooting.md` | Symptom to cause to fix |81| `references/updating.md` | Updating, version lines, re-verification |8283Template: `assets/kilo.jsonc`. Script: `scripts/probe.sh` (read-only; key from `LLM_API_KEY` or `LLM_API_KEY_FILE`).8485## Companion skills8687Install any with `npx skills add ScaleDockHQ/llm-skills --skill <name>`.8889- `litellm`: gateway with scoped virtual keys and aliases for Kilo.90- `llm-gateway`: whether to use a gateway at all.91- `llm-clients`: other coding agents and IDE extensions.92- `cline`, `continue`, `cursor`: other editor clients.93- `vllm`, `llama-cpp`, `ollama`, `llama-swap`: serving the model Kilo talks to.