Skip to content
KoboldCpp
GitHub

KoboldCpp Agent

KoboldCpp includes a small terminal agent, similar to OpenCode or Claude Code. You give it a task, and it uses tools to read and edit files, run shell commands and fetch web pages. It talks to KoboldCpp's OpenAI-compatible API.

At least 12 GB of VRAM is recommended.

  1. With 24 GB of VRAM or more, click Get Help in the launcher, choose Newbie Templates, pick HighSpec-CodingAgent and click Load Template. With less, load your own model on the Quick Launch tab; it needs room for a context of 28672 (see below).
  2. On the Admin tab, tick Launch KoboldCpp Agent.
  3. Click Launch. When the model has loaded, the agent opens in a new terminal window.
  4. Type a task and press Enter. Approve or reject each tool call.

On the command line:

Terminal
koboldcpp --model mymodel.gguf --agent

Add --cli to run the agent in the same terminal instead of a new window.

When the agent is on, KoboldCpp adjusts these settings at launch and prints a warning listing them:

SettingChanged to
Context sizeat least 28672
Default generation amountat least 8192
Use Jinja (--jinja)on
Jinja for Tools (--jinjatools)on

The larger context needs more memory. See Context size.

ToolWhat it does
read, write, editRead, create and change files.
shellRun a shell command.
glob, grepFind files and search their contents.
web_fetchDownload a web page.
view_imageLook at an image file.
ask_userAsk you a question.

If KoboldCpp has MCP servers loaded, the agent adds their tools too. MCP tools run on the KoboldCpp server; the built-in tools run where the agent runs.

If the working folder has an AGENTS.md file, the agent reads it as project instructions.

Type these at the agent prompt:

CommandWhat it does
/helpList all commands.
/confirm onAsk before every tool call except ask_user (default).
/confirm offRun all tool calls without asking.
/confirm autoAsk only when the agent's own review does not approve the call.
/toolsList the tools. /tools NAME on or /tools NAME off turns one on or off and clears the conversation.
/workdir PATHChange the working folder. Clears the conversation.
/compactSummarize the conversation to free context.
/clearStart over.
/reasoning on, /reasoning offShow or hide the model's reasoning.
/verbose on, /verbose offShow or hide full tool arguments and results.
/connectSwitch to another endpoint, API key or model.
/exit or /quitStop the agent.

The agent works with any OpenAI-compatible API. koboldcpp --agent with no other arguments opens only the agent, without starting a server. It connects to http://127.0.0.1:5001/v1, or to the URL in the OPENAI_BASE_URL environment variable. Use /connect to change the endpoint.

When you run kcpp_agent.py from a source checkout, it takes these options:

OptionDefault
--base-urlOPENAI_BASE_URL, or http://127.0.0.1:5001/v1
--api-keyOPENAI_API_KEY, or local
--modelOPENAI_MODEL, or local-model
--temperature0.4
--max-tokensnot set
--request-timeout600 seconds
--confirmationon (also off, auto)
--no-coloroff

On Linux, KoboldCpp opens the agent in the first terminal it finds: x-terminal-emulator, gnome-terminal, konsole, mate-terminal, xfce4-terminal or xterm. Without any of them, use --cli.