This is the full developer documentation for KoboldCpp # Documentation > Guides and reference for KoboldCpp: download and install, models and hardware, launcher settings, features, the API and troubleshooting. KoboldCpp runs AI models on your own computer. This community wiki has the details. New to it? The [beginner guide](https://koboldcpp.net/getting-started/) takes you from download to your first chat in four steps. The project also has its own [KoboldCpp wiki on GitHub](https://github.com/LostRuins/koboldcpp/wiki). [Click here for online KoboldCpp API documentation](https://lite.koboldai.net/koboldcpp_api) ## Download and install Every release file and what it needs: [Release files and system requirements](https://koboldcpp.net/docs/install/releases/). Step by step for [Windows](https://koboldcpp.net/docs/install/windows/), [Linux](https://koboldcpp.net/docs/install/linux/), [macOS](https://koboldcpp.net/docs/install/macos/), [Android](https://koboldcpp.net/docs/install/android/), and [Colab and Docker](https://koboldcpp.net/docs/install/colab-docker/). Also: [Updating](https://koboldcpp.net/docs/install/updating/), [Build from source](https://koboldcpp.net/docs/install/from-source/) and [Staying safe](https://koboldcpp.net/docs/install/staying-safe/). ## Models and hardware * Models: [GGUF and quantization](https://koboldcpp.net/docs/models/gguf-and-quantization/), [Where to get models](https://koboldcpp.net/docs/models/where-to-get-models/), [How much memory a model needs](https://koboldcpp.net/docs/models/memory/). * Hardware: [GPU backends](https://koboldcpp.net/docs/hardware/backends/), [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/), [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/), [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/), [Old PCs and CPU-only](https://koboldcpp.net/docs/hardware/old-and-cpu-only/), [Apple Silicon](https://koboldcpp.net/docs/hardware/apple-silicon/), [RPC](https://koboldcpp.net/docs/hardware/rpc/). ## Launcher and settings The [launcher tour](https://koboldcpp.net/docs/settings/launcher-tour/) explains every tab. Also: [Context size](https://koboldcpp.net/docs/settings/context-size/), [Config files](https://koboldcpp.net/docs/settings/config-files/), [Templates](https://koboldcpp.net/docs/settings/templates/), [Command line](https://koboldcpp.net/docs/settings/command-line/), [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). ## Features [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/), [Image and video generation](https://koboldcpp.net/docs/features/image-generation/), [Speech-to-text](https://koboldcpp.net/docs/features/speech-to-text/), [Text-to-speech](https://koboldcpp.net/docs/features/text-to-speech/), [Music](https://koboldcpp.net/docs/features/music/), [Vision and audio input](https://koboldcpp.net/docs/features/vision/), [Embeddings](https://koboldcpp.net/docs/features/embeddings/), [Web search and MCP tools](https://koboldcpp.net/docs/features/web-search-and-mcp/), [KoboldCpp Agent](https://koboldcpp.net/docs/features/agent/), [AI Horde worker](https://koboldcpp.net/docs/features/horde-worker/), [Multiplayer and server saves](https://koboldcpp.net/docs/features/multiplayer-and-saves/). ## Apps and API [Connect SillyTavern and other apps](https://koboldcpp.net/docs/api/connect-apps/), the [API overview](https://koboldcpp.net/docs/api/overview/) and [endpoints](https://koboldcpp.net/docs/api/endpoints/), [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/), [Remote access](https://koboldcpp.net/docs/api/remote-access/), [Streaming and multiple users](https://koboldcpp.net/docs/api/streaming/). ## Troubleshooting [Won't start](https://koboldcpp.net/docs/troubleshooting/wont-start/), [Model won't load](https://koboldcpp.net/docs/troubleshooting/model-wont-load/), [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/), [GPU not used or slow](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/), [Bad or strange output](https://koboldcpp.net/docs/troubleshooting/output-quality/), [Connection and API problems](https://koboldcpp.net/docs/troubleshooting/connection/), [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/). Short answers: the [FAQ](https://koboldcpp.net/docs/faq/). ## Reference [Command-line flags](https://koboldcpp.net/docs/reference/flags/) and [Deprecated flags](https://koboldcpp.net/docs/reference/deprecated-flags/). # Connect SillyTavern and other apps > KoboldAI Lite is built in. To use KoboldCpp from SillyTavern or other apps, pick the right address - KoboldAI API, OpenAI-compatible /v1 or Ollama. KoboldCpp has its own chat interface, KoboldAI Lite, at `http://localhost:5001`. You do not need another app. Connect one only if you prefer its interface or features. ## Which address to use Start KoboldCpp with a model first. Then enter the address that matches the connection type you pick in the app: | Connection type in the app | Address | | -------------------------- | ----------------------------------------------------------------------------------- | | KoboldAI or KoboldCpp | `http://localhost:5001` | | OpenAI-compatible | `http://localhost:5001/v1` | | Ollama | `http://localhost:11434` (start KoboldCpp on port 11434, [see below](#ollama-apps)) | * If an app asks for the full KoboldAI API address, use `http://localhost:5001/api`. * `localhost` only works on the PC that runs KoboldCpp. For a phone or another PC, see [Remote access](https://koboldcpp.net/docs/api/remote-access/). * If you changed **Port:** on the **Network** tab (`--port`), use your port in place of `5001`. When KoboldCpp is ready, the console shows the addresses: Console ```text Starting Kobold API on port 5001 at http://localhost:5001/api/ Starting OpenAI Compatible API on port 5001 at http://localhost:5001/v1/ Starting llama.cpp secondary WebUI at http://localhost:5001/lcpp/ ``` ## API key * **No password set:** if the app requires an API key, enter any text. * **Password set:** enter your password as the API key. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Model name OpenAI-style apps often ask for a model name. KoboldCpp ignores it and always uses the model it has loaded, so any name works. `http://localhost:5001/v1/models` lists the loaded model. The exception is router mode, where the model name selects which model to load. See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). ## Reply length Set the response length (max tokens) in the app. If the app does not send one, KoboldCpp uses **Default Gen Amt:** on the **Context** tab (`--defaultgenamt`, default 2048). ## SillyTavern SillyTavern has its own connection type for KoboldCpp: 1. In SillyTavern, click **API Connections** (the plug icon in the top bar). 2. Set **API** to **Text Completion** and **API Type** to **KoboldCpp**. 3. Enter `http://localhost:5001` in **API URL**. 4. If you set a password, enter it in **koboldcpp API key (optional)**. 5. Click **Connect**. KoboldCpp understands the SillyTavern-specific sampler fields, such as banned strings. SillyTavern can also use KoboldCpp for images when an image model is loaded, through the A1111/Forge or ComfyUI APIs. Use the same `http://localhost:5001` address. See [Image generation](https://koboldcpp.net/docs/features/image-generation/). ## Ollama apps Apps that only speak the Ollama API look for it on port 11434. 1. On the **Network** tab, set **Port:** to `11434`. On the command line, add `--port 11434`. 2. Launch. The console prints `Ollama Emulation is now available at port 11434.` 3. In the app, use `http://localhost:11434`. If Ollama itself is running, it already uses port 11434 and KoboldCpp cannot start on it. Close Ollama first. ## Anthropic-API apps KoboldCpp serves the Anthropic Messages API at `/v1/messages`. With a password, the app must send it as `Authorization: Bearer `. KoboldCpp does not accept the `x-api-key` header that Anthropic clients normally use. Configure such apps to send a Bearer token. If an app can't, run KoboldCpp without a password only where no one else can reach it, for example with **Host:** set to `127.0.0.1`. ## Other apps and tools * **KoboldAI Lite online:** the hosted copy at [lite.koboldai.net](https://lite.koboldai.net) can connect to your local KoboldCpp. * **KoboldAI United and KoboldAI Client:** enter the KoboldAI API address. * **Bundled interfaces:** besides KoboldAI Lite, KoboldCpp serves the llama.cpp WebUI at `/lcpp/`, the image interface at `/sdui` and the music and speech interface at `/musicui`. The last two only generate when the matching model is loaded. See [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/). * **KoboldCpp Agent:** the bundled coding agent connects to `http://127.0.0.1:5001/v1` by default. See [Agent](https://koboldcpp.net/docs/features/agent/). * **GPTLocalhost:** a Microsoft Word add-in that uses KoboldCpp. * **Speech-to-text clients:** KoboldCpp accepts WAV, MP3 and FLAC audio. WebM recordings are not supported. See [Speech-to-text](https://koboldcpp.net/docs/features/speech-to-text/). ## Go deeper * [API overview](https://koboldcpp.net/docs/api/overview/) * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) * [Remote access](https://koboldcpp.net/docs/api/remote-access/) * [Streaming and multiple users](https://koboldcpp.net/docs/api/streaming/) # API endpoints reference > Every KoboldCpp API endpoint by family - path, method, purpose, whether the password protects it and which model or flag it needs. Every endpoint KoboldCpp serves, grouped by API family. For request fields, see the API docs at `/api` on your instance or [lite.koboldai.net/koboldcpp\_api](https://lite.koboldai.net/koboldcpp_api). How to read the tables: * **Password:** **Yes** means the endpoint needs the password when one is set (`--password`). **No** means it never checks. **Admin** means admin mode and the admin password. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). * **Needs:** the model or flag that must be loaded for the endpoint to do its job. "Text model" is the model in **GGUF Text Model:**. * A path in brackets is an alias that does the same. * A short path after a comma continues the first path's prefix: `/api/extra/multiplayer/status`, `/getstory` means `/api/extra/multiplayer/getstory`. ## KoboldAI (native) | Path | Method | Password | Purpose | Needs | | ---------------------------------------------------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | | `/api/v1/generate` (`/api/latest/generate`) | POST | Yes | Generate text | Text model | | `/api/extra/generate/stream` | POST | Yes | Generate text, streamed as server-sent events | Text model | | `/api/extra/generate/check` | GET, POST | Yes | Text generated so far by the running request; POST with `genkey` for your own request | Text model | | `/api/extra/abort` | POST | Yes | Stop generating; with `genkey` only your own request | Text model | | `/api/extra/last_logprobs` | GET, POST | Yes | Token probabilities of the last generation | Text model | | `/api/extra/tokencount` (`/api/extra/tokenize`) | POST | Yes | Count and list tokens; also accepts OpenAI-style `messages` | Text model | | `/api/extra/detokenize` | POST | Yes | Turn token IDs back into text | Text model | | `/api/extra/json_to_grammar` | POST | Yes | Convert a JSON schema to a grammar | | | `/api/v1/model` | GET | Partly | Loaded model name; without a valid key it returns `koboldcpp/protected-model` | | | `/api/v1/config/max_length`, `/api/v1/config/max_context_length` | GET | No | Limits reported to KoboldAI clients: `max_length` is 1024 unless `--hordegenlen` is set (not **Default Gen Amt:**); `max_context_length` is the context size, or `--hordemaxctx` if set | | | `/api/v1/config/soft_prompt`, `/api/v1/config/soft_prompts_list` | GET | No | Compatibility stubs for KoboldAI clients | | | `/api/v1/info/version` | GET | No | KoboldAI API version (`1.2.5`) | | | `/api/extra/version` | GET | No | KoboldCpp version and active features | | | `/api/extra/true_max_context_length` | GET | No | Context size the server allocated | | | `/api/extra/perf` | GET | No | Speed of the last request, queue length | | | `/api/extra/preloadstory` | GET | No | Story set with `--preloadstory` | `--preloadstory` | | `/api/extra/websearch` | POST | Yes | Web search, body `{"q": "..."}`; returns `[]` when off | `--websearch` | | `/api/extra/multiplayer/status`, `/getstory`, `/setstory` | POST | Yes | Shared multiplayer session | `--multiplayer` | | `/api/extra/data/list`, `/load`, `/save` | POST | Yes | Server-side save slots | `--savedatafile` | | `/api/extra/transcribe` | POST | Yes | Speech-to-text | Whisper model or audio mmproj | | `/api/extra/tts` | POST | Yes | Text-to-speech | TTS model | | `/api/extra/speakers_list` | GET | No | TTS voices | | | `/api/extra/embeddings` | POST | Yes | Embeddings | Embeddings model | | `/api/extra/music/prepare` | POST | Yes | Plan a song (audio codes) | Music models | | `/api/extra/music/generate` | POST | Yes | Generate music as WAV or MP3 | Music models | | `/request` | POST | Yes | Legacy format: `{text, max}` in, `{"data": {"seqs": [...]}}` out | Text model | | `/api`, `/docs` | GET | No | API documentation | | Without `--savedatafile`, `/api/extra/data/list` and `/load` close the connection without an answer, and `/save` returns HTTP 400. ## OpenAI-compatible | Path | Method | Password | Purpose | Needs | | ---------------------------------------------------- | ------ | -------- | -------------------------------------------------------------------- | ------------------------------------ | | `/v1/completions` (`/v1/completion`, `/completions`) | POST | Yes | Text completion | Text model | | `/v1/chat/completions` (`/chat/completions`) | POST | Yes | Chat, with tools and images; thinking text in `reasoning_content` | Text model; vision mmproj for images | | `/v1/responses` (`/responses`) | POST | Yes | OpenAI Responses API | Text model | | `/v1/models` (`/models`) | GET | No | Loaded model; in router mode also the admin-directory configs | | | `/v1/embeddings` | POST | Yes | Embeddings; supports `encoding_format: base64` | Embeddings model | | `/v1/audio/transcriptions` (`/audio/transcriptions`) | POST | Yes | Speech-to-text; JSON with `audio_data`, or a multipart `file` upload | Whisper model or audio mmproj | | `/v1/audio/speech` (`/audio/speech`) | POST | Yes | Text-to-speech; `response_format: mp3` for MP3 | TTS model | | `/v1/audio/voices` (`/audio/voices`) | GET | No | TTS voices | | | `/v1/images/generations` (`/images/generations`) | POST | **No** | Generate an image | Image model | | `/v1/images/edits` (`/images/edits`) | POST | **No** | Edit an image | Image model | | `/v1` | GET | No | Landing page | | ## Anthropic-compatible | Path | Method | Password | Purpose | Needs | | ---------------------------- | ------ | ---------------- | -------------------------------------------------- | ---------- | | `/v1/messages` (`/messages`) | POST | Yes, Bearer only | Anthropic Messages API, with images and tool calls | Text model | ## Ollama-compatible Run KoboldCpp with `--port 11434` so Ollama apps find it. | Path | Method | Password | Purpose | Needs | | ---------------------- | ------ | -------- | ------------------------------------------------------ | ---------------- | | `/api/generate` | POST | Yes | Text completion; streams unless `"stream": false` | Text model | | `/api/chat` | POST | Yes | Chat with tool calls; streams unless `"stream": false` | Text model | | `/api/embed` | POST | Yes | Embeddings | Embeddings model | | `/api/tags`, `/api/ps` | GET | No | Model list | | | `/api/version` | GET | No | Reports Ollama version `0.7.0` | | | `/api/show` | POST | No | Fixed placeholder model info | | ## A1111 / Forge (images) | Path | Method | Password | Purpose | Needs | | -------------------------------------------------------------------------------------------------------------- | ------ | ----------------------- | --------------------------------------- | ----------------------------------------------------------- | | `/sdapi/v1/txt2img` | POST | **No** | Text to image; also video with `frames` | Image model | | `/sdapi/v1/img2img` | POST | **No** | Image to image, inpainting | Image model | | `/sdapi/v1/upscale`, `/sdapi/v1/extra-single-image` | POST | **No** | Upscale an image | Upscaler (`--sdupscaler`) | | `/sdapi/v1/interrogate` | POST | **No** | Describe an image | Vision mmproj; returns 503 `No Vision model loaded` without | | `/sdapi/v1/sd-models`, `/options`, `/samplers`, `/schedulers`, `/loras`, `/upscalers`, `/latent-upscale-modes` | GET | No | Lists and settings | Image model | | `/sdapi/v1/progress`, `/sdapi/v1/get_last.json` | GET | No (scoped by `genkey`) | Progress and last result | Image model | ## ComfyUI-compatible (images) | Path | Method | Password | Purpose | Needs | | ----------------------------------------------------------- | ------ | -------- | --------------------------------------------------------------- | ----------- | | `/prompt` | POST | **No** | Generate an image; answers when it is done, with a fixed job ID | Image model | | `/upload/image` (`/api/upload/image`) | POST | **No** | Upload an input image | Image model | | `/view` (`/view.png`, `/api/view`, `/view_image`) | GET | No | Get the generated image | Image model | | `/history` (`/api/history`) | GET | No | Emulated history that only holds the last image | Image model | | `/ping`, `/system_stats`, `/object_info` | GET | No | Compatibility answers; `/system_stats` holds placeholder values | | | `/models/checkpoints`, `/models/loras` (also under `/api/`) | GET | No | Model lists | | | `/ws` | GET | No | WebSocket handshake only | | ## XTTS-compatible (speech) | Path | Method | Password | Purpose | Needs | | ------------------------------------------------ | ------ | -------- | --------------------------------- | --------- | | `/tts_to_audio` | POST | **No** | Text-to-speech | TTS model | | `/speakers_list`, `/speakers` | GET | No | Voices | | | `/get_tts_settings` | GET | No | Settings stub | | | `/set_tts_settings` | POST | No | Accepts anything, changes nothing | | | `/voice/check`, `/voice/speakers`, `/voice/vits` | GET | No | Legacy TTS endpoints | | ## Admin Only active with admin mode (**Enable Model Administration**, `--admin`). See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). | Path | Method | Password | Purpose | | ---------------------------------------------------------------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------- | | `/api/admin/list_options` | GET | Admin | Configs and models you can switch to | | `/api/admin/reload_config` | POST | Admin | Switch config or model, body `{"filename": "..."}`; `unload_model` and `initial_model` are special names | | `/api/admin/check_state`, `/save_state`, `/load_state`, `/clear_state` | POST | Admin | Save and restore the KV cache | ## Other | Path | Method | Password | Purpose | Needs | | -------------------------- | ------ | -------- | ---------------------------------------------------------------------- | ------------------------------ | | `/mcp` | POST | Yes | MCP JSON-RPC proxy (`initialize`, `tools/list`, `tools/call`) | `--mcpfile` | | `/props` | GET | No | llama.cpp-style info: chat template, `n_ctx`, vision and audio support | | | `/slots` | GET | No | Always 501; not supported | | | `/.well-known/serviceinfo` | GET | No | Service info | | | `/` | GET | No | KoboldAI Lite | | | `/noscript` | GET | No | Interface without JavaScript | | | `/lcpp/` | GET | No | llama.cpp WebUI | | | `/sdui` | GET | No | Stable UI for images | Image model to generate | | `/musicui` | GET | No | Music and TTS interface | Music or TTS model to generate | | `/manifest.json` | GET | No | Web app manifest | | ## Not in the official API docs The API docs at `/api` leave out: the Ollama, ComfyUI and XTTS endpoints, `/v1/images/edits`, `/v1/audio/voices`, `/mcp`, `/request`, `/sdapi/v1/extra-single-image`, the A1111 GET lists other than `sd-models`, `options` and `samplers`, the soft prompt stubs and `/slots`. # API overview: KoboldAI, OpenAI and Ollama APIs > The APIs KoboldCpp serves on one port - KoboldAI, OpenAI, Anthropic, Ollama, A1111/Forge, ComfyUI, XTTS and Whisper - and where to find the API docs. KoboldCpp serves several APIs at once, all on the same port (5001 by default). Many apps built for other servers, such as OpenAI, Ollama or Automatic1111, can use KoboldCpp once you point them to its address. Not every feature of those servers is supported. ## API documentation KoboldCpp serves many compatibility REST APIs. Swagger API documentation is provided: * **On your instance:** Run KoboldCpp, then open `http://localhost:5001/api` for interactive API docs hosted locally. * **Online API docs:** An online copy of the docs is hosted at [lite.koboldai.net/koboldcpp\_api](https://lite.koboldai.net/koboldcpp_api). Both cover the KoboldAI, OpenAI, Anthropic and A1111 endpoints. The Ollama, ComfyUI and XTTS emulation is not in them; see [Endpoints](https://koboldcpp.net/docs/api/endpoints/). ## API families | API | Base path | Use it for | | ---------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | KoboldAI (native) | `/api/v1/`, `/api/extra/` | Text generation with full sampler control, plus KoboldCpp extras such as token counting, abort and multiplayer. KoboldAI Lite uses this API. | | OpenAI | `/v1/` | Completions, chat completions (with tools and images), embeddings, audio and images | | OpenAI Responses | `/v1/responses` | Apps built for the OpenAI Responses API | | Anthropic Messages | `/v1/messages` | Apps built for the Anthropic API, with images and tool calls | | Ollama | `/api/generate`, `/api/chat`, `/api/embed`, `/api/tags` | Ollama apps; run KoboldCpp on port 11434 so they find it | | A1111 / Forge | `/sdapi/v1/` | Image generation, upscaling and image captioning | | ComfyUI | `/prompt`, `/view`, `/history` | Apps that send image jobs to ComfyUI | | XTTS | `/tts_to_audio`, `/speakers_list` | Apps built for an XTTS text-to-speech server | | OpenAI audio (Whisper) | `/v1/audio/transcriptions`, `/v1/audio/speech` | Speech-to-text and text-to-speech | Each family needs the matching model loaded. Text endpoints need a text model, image endpoints an image model, and so on. [Endpoints](https://koboldcpp.net/docs/api/endpoints/) lists every path and what it needs. ## First requests Two examples with `curl`. They use Linux and macOS shell quoting. KoboldAI API: Terminal ```sh curl http://localhost:5001/api/v1/generate \ -H "Content-Type: application/json" \ -d '{"prompt": "Once upon a time", "max_length": 50}' ``` The reply text is in `results[0].text`. OpenAI chat completions: Terminal ```sh curl http://localhost:5001/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"messages": [{"role": "user", "content": "Hello there!"}], "max_tokens": 50}' ``` On Windows, Command Prompt needs the command on one line, with the inner quotes escaped. In PowerShell, type `curl.exe` instead of `curl`. Command Prompt ```bat curl http://localhost:5001/api/v1/generate -H "Content-Type: application/json" -d "{\"prompt\": \"Once upon a time\", \"max_length\": 50}" ``` If you set a password, add `-H "Authorization: Bearer "`. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## What is loaded | Path | Shows | | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `GET /api/extra/version` | Which features are available: `llm`, `txt2img`, `vision`, `audio`, `transcribe`, `tts`, `embeddings`, `music`, `websearch`, `multiplayer`, `jinja`, `mcp`, `admin`, `router`, `protected` and more | | `GET /v1/models` | The loaded text model; in router mode also the files you can switch to | | `GET /props` | Chat template, context size (`n_ctx`) and whether vision and audio input work | | `GET /api/extra/true_max_context_length` | The context size the server allocated | | `GET /api/extra/perf` | Speed of the last request and the queue length | ## Chat formatting The chat-style APIs (OpenAI chat, Responses, Anthropic, Ollama chat) send messages, and KoboldCpp turns them into the prompt format the model expects. * By default, KoboldCpp guesses the format from the model's chat template (**Chat Adapter:** on the **Loaded Files** tab, `--chatcompletionsadapter`, default `AutoGuess`). The console prints `Chat completion heuristic: `. * **Use Jinja** (`--jinja`) renders the model's own chat template instead. Try it if chat replies look badly formatted with a newer model. * For tool calls with Jinja, also tick **Jinja for Tools** (`--jinjatools`). ## Advanced: server-side defaults These apply to every request from every app: | Launcher (**Context** tab) | Flag | Effect | | -------------------------- | ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Default Gen Amt:** | `--defaultgenamt` | Reply length when the request sets none (default 2048, at most half the context) | | **Prompt Limit:** | `--genlimit` | Hard cap on reply length; longer requests are cut to it | | **Default Params:** | `--gendefaults` | JSON with default values for fields the request leaves out, using the native KoboldAI and A1111 field names, e.g. `{"rep_pen": 1.1}`. For the reply length, use **Default Gen Amt:** instead. | | **Override** | `--gendefaultsoverwrite` | Makes **Default Params:** overwrite values the request did send | ## Advanced: routing details * Most paths are matched by their ending; a few, such as `/props` and `/prompt`, must match exactly. The query string and a trailing slash don't change which endpoint answers: `http://localhost:5001/api/v1/generate/` works the same as without the slash. * Paths starting with `/lcpp/` are mapped to the root, so `/lcpp/v1/models` answers like `/v1/models`. This is how the bundled llama.cpp WebUI at `/lcpp/` reaches the API. * An unknown GET path returns 404 with a short HTML page that links to `/api`. An unknown POST path returns 404. * `POST /mcp` is a JSON-RPC proxy to the MCP servers from **MCP JSON:** (`--mcpfile`). See [Web search and MCP](https://koboldcpp.net/docs/features/web-search-and-mcp/). * Admin mode adds `/api/admin/` endpoints for swapping models. See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). ## Go deeper * [Endpoints](https://koboldcpp.net/docs/api/endpoints/) * [Streaming and multiple users](https://koboldcpp.net/docs/api/streaming/) * [Connect other apps](https://koboldcpp.net/docs/api/connect-apps/) # Passwords and security > Protect a shared KoboldCpp with a password and admin password, limit who can connect, and know which endpoints stay open. By default KoboldCpp has no password and accepts connections on all network interfaces. Any device that can reach your PC on port 5001 can use it. ## Safe setup at a glance | Your situation | Do this | | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | | Only you, on this PC | Set **Host:** to `127.0.0.1` (`--host 127.0.0.1`). | | Other devices on your network, or **Remote Tunnel** | Set a **Password:** (`--password`). | | Admin mode is on | Always set an **Admin Password:** (`--adminpassword`). | | Sharing with an image model loaded | Image generation is not password-protected. Limit image size with `--sdclamped`, or don't load an image model. | ## Set a password * **Launcher:** **Network** tab → **Password:** * **Command line:** `--password ` * **Environment variable:** `KCPP_PASSWORD` In apps, enter the password where they ask for an API key. KoboldAI Lite asks for it in an **API Key Required** box when it opens. ## How clients send the password Clients must send the header `Authorization: Bearer `. This is the same way OpenAI apps send their API key. Terminal ```sh curl http://localhost:5001/v1/chat/completions \ -H "Authorization: Bearer mypassword" \ -H "Content-Type: application/json" \ -d '{"messages": [{"role": "user", "content": "Hello!"}]}' ``` On Windows, write it on one line with escaped quotes; see [First requests](https://koboldcpp.net/docs/api/overview/#first-requests). * No other header works. KoboldCpp does not accept `x-api-key`, which Anthropic clients use. * A missing or wrong password returns HTTP 401: `{"detail": {"error": "Unauthorized", "msg": "Authentication key is missing or invalid.", "type": "unauthorized"}}` ## What the password protects **Protected:** * Text generation on every API: KoboldAI, OpenAI, Responses, Anthropic, Ollama * Token counting, generation check, abort, logprobs * Speech-to-text, `/api/extra/tts`, `/v1/audio/speech`, embeddings, music * Web search, multiplayer, server-side saves, `/mcp` **Not protected:** * Image generation: `/sdapi/v1/txt2img`, `/sdapi/v1/img2img`, `/v1/images/*`, ComfyUI `/prompt` and `/upload/image` * Upscaling: `/sdapi/v1/upscale`, `/sdapi/v1/extra-single-image` * Image captioning: `/sdapi/v1/interrogate` * XTTS text-to-speech: `/tts_to_audio` * Info pages (GET), such as `/api/extra/version`, `/api/extra/perf`, `/v1/models` and `/props` * `/api/v1/model` hides the model name without the password, but `/v1/models` and `/props` still show it. * The web interfaces (KoboldAI Lite, `/sdui` and the others) load without a password. Their requests to protected endpoints need it. If you share an instance that has an image or TTS model loaded, anyone who can reach it can generate images and speech. Limit image size with **Clamp Resolution (Hard):** on the **Image Gen** tab (`--sdclamped`), or only load those models on instances you trust. ## Admin password Admin mode (**Enable Model Administration** on the **Admin** tab, `--admin`) lets clients switch and unload models. Caution Always set an admin password when you enable admin mode. * **Launcher:** **Admin** tab → **Admin Password:** * **Command line:** `--adminpassword ` * **Environment variable:** `KCPP_ADMINPASSWORD` The admin password also works as the normal password. Give other users the normal password and keep the admin password for yourself. See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). ## Passwords in saved files * A saved config (`.kcpps`) contains your passwords in plain text. Don't share it. * Templates (`.kcppt`, **Generate LaunchTemplate** on the **Extra** tab) leave the passwords out. Share those instead, after checking them for local file paths and an embedded story. ## Who can connect **Host:** on the **Network** tab (`--host`) sets which network address KoboldCpp listens on. | Host | Who can connect | | ----------------------------- | ----------------------------------------------- | | Empty (default) | Any device that can reach this PC | | `127.0.0.1` | Only this PC | | One of this PC's IP addresses | Devices that reach this PC through that network | For access from other devices, see [Remote access](https://koboldcpp.net/docs/api/remote-access/). **Remote Tunnel** also works with `127.0.0.1`, because its `cloudflared` program runs on the same PC. If you only use KoboldCpp locally and through the tunnel, set **Host:** to `127.0.0.1` and leave **Router Mode** off, so that other devices on your network cannot connect directly. ## Browser access (CORS) KoboldCpp allows requests from web pages on any site. This is what lets browser apps, such as the hosted KoboldAI Lite at lite.koboldai.net, talk to your local server. There is no setting to restrict it. It also means that any web page open in your browser can send requests to your KoboldCpp. The password keeps them out of the protected endpoints. ## HTTPS (SSL) KoboldCpp serves plain HTTP by default. To serve HTTPS, give it a certificate and a key: * **Launcher:** **Network** tab → **SSL Cert:** and **SSL Key:** * **Command line:** `--ssl cert.pem key.pem` The key must be unencrypted (no passphrase). If a file is missing, KoboldCpp prints `Your SSL configuration is INVALID. SSL will not be used.` and serves plain HTTP. If a file exists but is not a valid certificate or key, the server does not start. To make a self-signed certificate for testing: Terminal ```sh openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes ``` Browsers warn about self-signed certificates until you trust them. **Remote Tunnel** links are HTTPS already, without a certificate of your own. ## Limits for shared servers | Launcher | Flag | Default | Effect | | ------------------------------------------------------------ | ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Multiuser Queue:** (**Network**) | `--multiuser` | 10 | How many requests it accepts at once, counting the one that runs (default: 1 runs, 9 wait); see [Streaming and multiple users](https://koboldcpp.net/docs/api/streaming/#several-users-at-once) | | **Max Req. Size (MB):** (**Network**) | `--maxrequestsize` | 32 | Bigger requests get HTTP 500 `Payload is too big`. | | **IP Rate Limiter (s):** (**Network**) | `--ratelimit` | 0 (off) | Each IP may start one generation per this many seconds; faster ones get HTTP 503. Behind **Remote Tunnel**, all users count as one IP. | | **Prompt Limit:** (**Context**) | `--genlimit` | 0 (off) | Caps the reply length of every request | | **Clamp Resolution (Hard):** (**Image Gen**) | `--sdclamped` | 0 (off) | Caps the longest image side; `--sdclamped` alone means 512 | | **(Soft):**, next to Clamp Resolution (Hard) (**Image Gen**) | `--sdclampedsoft` | 0 | Caps the image area; 0 means 832×832 for SD 1.x/2.x and 1024×1024 for other models | ## Advanced: other network settings * **NoCertify Mode (Insecure)** (`--nocertify`) turns off certificate checks for KoboldCpp's own outgoing connections, such as web search, MCP servers and the Horde worker. Model downloads use `aria2c`, `curl` or `wget`, which still check certificates. It does not affect the server's HTTPS. * MCP servers from **MCP JSON:** (`--mcpfile`) that run as a local command have full access to your system. Remote MCP servers receive the data sent to them. Only add servers you trust. See [Web search and MCP](https://koboldcpp.net/docs/features/web-search-and-mcp/). * RPC (sharing a GPU with other PCs) must not be exposed to the internet. See [RPC](https://koboldcpp.net/docs/hardware/rpc/). * Don't combine **SingleInstance Mode** (`--singleinstance`) with **Remote Tunnel**. ## Related * [Remote access](https://koboldcpp.net/docs/api/remote-access/) * [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/) * [Endpoints](https://koboldcpp.net/docs/api/endpoints/) # Remote access > Use KoboldCpp from your phone or another PC - on the same network with the LAN IP, or over the internet with Remote Tunnel. Set a password first. KoboldCpp runs on one PC, and you can use it from other devices. KoboldAI Lite works in any browser, including on phones. | Where the other device is | Use | | ------------------------- | ----------------------------------------- | | Same Wi-Fi or network | [The PC's network address](#same-network) | | Anywhere | [Remote Tunnel](#anywhere-remote-tunnel) | Caution Set a **Password:** on the **Network** tab (`--password`) before you open KoboldCpp to other devices. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Same network KoboldCpp listens on all network interfaces by default, so devices on your network can already reach it. 1. If others share your network, set a **Password:** on the **Network** tab. Leave **Host:** on the same tab empty; with `127.0.0.1`, only this PC can connect. 2. Launch KoboldCpp. 3. Find the PC's IP address on your network, for example `192.168.1.20`. * Windows: run `ipconfig` in Command Prompt and look for **IPv4 Address**. * Linux: run `hostname -I`. * macOS: run `ipconfig getifaddr en0`. 4. On the other device, open `http://:5001`, for example `http://192.168.1.20:5001`. The console still prints `http://localhost:5001`. That address is only for the PC itself. If the page does not load, the PC's firewall is usually blocking port 5001, or the IP address is wrong: * **Windows:** on first launch, Windows may ask whether KoboldCpp may use the network. Allow **Private networks**. If you missed it, open **Windows Security** > **Firewall & network protection** > **Allow an app through firewall** and tick KoboldCpp for **Private**. * **Linux (ufw):** `sudo ufw allow 5001/tcp`. Browsers allow the microphone and camera only on HTTPS or on the PC itself (`localhost`). For voice input or the camera from another device, use the **Remote Tunnel** link or [HTTPS](https://koboldcpp.net/docs/api/passwords-and-security/#https-ssl). For other apps, use the same address in place of `localhost`, for example `http://192.168.1.20:5001/v1` for OpenAI-compatible apps. ## Anywhere: Remote Tunnel **Remote Tunnel** creates a public HTTPS link through Cloudflare. It works even behind a firewall. 1. Set a **Password:** on the **Network** tab. 2. Tick **Remote Tunnel** on the **Quick Launch** or **Network** tab. On the command line, add `--remotetunnel`. 3. Launch. The first time, KoboldCpp downloads Cloudflare's `cloudflared` program from GitHub. 4. Wait for the link in the console: Console ```text Your remote tunnel is ready, please connect to https://.trycloudflare.com ``` 5. Open the link on any device to use KoboldAI Lite. For other apps, add `/api` or `/v1` to it, as printed in the console. The link changes every time you launch KoboldCpp. Anyone who has the link can reach your KoboldCpp. The password keeps them out of text generation, but not out of image generation. See [what the password protects](https://koboldcpp.net/docs/api/passwords-and-security/#what-the-password-protects). If the tunnel fails, the console prints `Error: Could not create cloudflare tunnel!` or `Remote Tunnel Failed!`. KoboldCpp needs internet access to download `cloudflared` and to open the tunnel. Remote Tunnel does not start in terminal-only modes (`--cli`, `--prompt`, `--benchmark`). ## Share with the world: AI Horde To let anyone use your model through the AI Horde network instead of a private link, run KoboldCpp as a Horde worker. See [Horde worker](https://koboldcpp.net/docs/features/horde-worker/). ## Advanced: choose the network address **Host:** (`--host`) sets the address KoboldCpp listens on. Leave it empty for all interfaces, use `127.0.0.1` for this PC only, or one of the PC's IP addresses to listen on that network only. When **Host:** is set, the console prints that address in place of `localhost`. The port is **Port:** on the **Network** tab (`--port`, default 5001). ## Advanced: HTTPS on your network On your own network, KoboldCpp serves plain HTTP. To serve HTTPS, set **SSL Cert:** and **SSL Key:** (`--ssl cert.pem key.pem`). The console addresses then start with `https://`. See [HTTPS (SSL)](https://koboldcpp.net/docs/api/passwords-and-security/#https-ssl). With SSL on, **Remote Tunnel** connects to KoboldCpp over HTTPS and accepts its certificate even if it is self-signed. ## Safety checklist * Set a **Password:** before you use **Remote Tunnel** or share on your network. * If admin mode is on, set an **Admin Password:**. * Image generation and `/tts_to_audio` are open to anyone who can reach the server. Load those models only on instances you trust, or limit image size with `--sdclamped`. * For shared servers, consider `--ratelimit`, `--genlimit` and `--maxrequestsize`. See [Limits for shared servers](https://koboldcpp.net/docs/api/passwords-and-security/#limits-for-shared-servers). ## Related * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) * [Connect other apps](https://koboldcpp.net/docs/api/connect-apps/) * [Connection problems](https://koboldcpp.net/docs/troubleshooting/connection/) # Streaming and multiple users > How each KoboldCpp API streams replies (SSE or NDJSON), how to poll and abort, and how the request queue behaves with several users. Streaming sends the reply piece by piece while it is generated, instead of all at once at the end. KoboldAI Lite streams by default. ## Streaming per API | API | How to turn it on | Format | | ------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------------------- | | KoboldAI | Call `/api/extra/generate/stream` in place of `/api/v1/generate` | Server-sent events (SSE): `event: message` + `data:` | | OpenAI completions and chat | `"stream": true` | SSE: `data:` lines, last one `data: [DONE]` | | OpenAI Responses | `"stream": true` | SSE with named `event:` lines | | Anthropic Messages | `"stream": true` | SSE with named `event:` lines | | Ollama (`/api/generate`, `/api/chat`) | On by default; `"stream": false` turns it off | NDJSON (`application/x-ndjson`), one JSON object per line | ## What the streams look like Real first bytes from KoboldCpp, shortened. **KoboldAI** (`/api/extra/generate/stream`). The last event has a `finish_reason`; there is no `[DONE]`. ```text event: message data: {"token": " to the team", "finish_reason": null} event: message data: {"token": "", "finish_reason": "length"} ``` **OpenAI chat** (`/v1/chat/completions`, `"stream": true`). Completions (`/v1/completions`) also end with `data: [DONE]`, but use `"object": "text_completion"` and put each piece in `choices[0].text` instead of `delta.content`. ```text data: {"id": "chatcmpl-…", "object": "chat.completion.chunk", …, "choices": [{"index": 0, "finish_reason": null, "delta": {"role": "assistant", "content": "Hi! How can I"}}]} data: [DONE] ``` **Anthropic** (`/v1/messages`, `"stream": true`). The events arrive in this order: `message_start`, `content_block_start`, `content_block_delta` (repeated), `content_block_stop`, `message_delta` (with `stop_reason`), `message_stop`. **Ollama** (`/api/chat`). One JSON object per line; the last one has `"done": true` and a `done_reason`. ## Polling instead of streaming (KoboldAI) Apps that can't read SSE can poll instead: 1. Start the request with `POST /api/v1/generate`. 2. While it runs, call `/api/extra/generate/check` to get the text generated so far. When several users share the server, send a unique `genkey` in the generate request and in `POST /api/extra/generate/check`. Each user then sees only their own text. KoboldAI Lite can also use polling; it is an option in Lite's settings. ## Stopping a generation * `POST /api/extra/abort` stops the running generation. With `genkey` in the body, it only stops the request with that key. * Image generation stops when the client disconnects, unless the request sets `keep_image_gen_on_disconnect` in `kcpp_extra_args`. ## Tool calls * Without **Jinja for Tools** (`--jinjatools`), a tool-call reply is sent all at once, in stream format. * With **Jinja for Tools**, tool calls stream as they are generated if KoboldCpp recognizes the model's tool-call format. Otherwise they are sent all at once. **Jinja for Tools** is on the **Context** tab and also turns on **Use Jinja**. * During tool-call streams, KoboldCpp sends whitespace now and then to keep the connection open. If generation fails in the middle of a stream, KoboldCpp sends an error object in the stream. ## Several users at once KoboldCpp generates text for one request at a time. Other requests wait in a queue and run in turn. **Multiuser Queue:** on the **Network** tab (`--multiuser`) sets how many requests it accepts at once, counting the one that runs: | `--multiuser` | Behaviour | | --------------- | ----------------------------------------------------- | | `10` (default) | 1 request runs, up to 9 wait | | `N` (2 or more) | 1 request runs, up to N−1 wait | | `1` | Same as 10 | | `0` | No queue: while one request runs, others get HTTP 503 | A request that finds the queue full gets HTTP 503 with `{"detail": {"msg": "Server is busy; please try again later.", "type": "service_unavailable"}}`. Measured with four requests sent at once, each taking about 2.5 seconds: | `--multiuser` | Results | | ------------- | --------------------------------------------------------------- | | default | All 4 succeed, finishing after about 2.5, 5, 7.5 and 10 seconds | | `2` | 2 succeed, 2 get 503 | | `0` | 1 succeeds, 3 get 503 | Exceptions to `0`: * When a Whisper, image, TTS or embeddings model is loaded, `0` acts like `2`. * Otherwise, with **Parallel Requests:** above 1, `0` acts like `10`. * The launcher shows values below 2 as 10. A `.kcpps` with `multiuser` set to `0` becomes 10 when you load it in the launcher. `GET /api/extra/perf` shows the current queue. ## Advanced: parallel requests **Parallel Requests:** on the **Network** tab (`--parallelrequests N`, also `--contbatch`) runs up to N text requests at the same time with continuous batching. It is experimental. * Values from 0 to 32; 0 and 1 mean off. * It turns off **Use ContextShift**. * Only plain text requests run in parallel. Requests with images or audio, grammar, banned strings, many samplers (DRY, XTC, Mirostat and others), tool calls or reasoning effort run one at a time. **Use SmartCache**, a draft model and **Enable Guidance** also turn batching off. * The console prints `Batching disabled due to …` when a request can't be batched. See the [flag reference](https://koboldcpp.net/docs/reference/flags/#parallelrequests) for the full list. ## Related * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) for `--ratelimit` and other limits * [Endpoints](https://koboldcpp.net/docs/api/endpoints/) * [Multiplayer and saves](https://koboldcpp.net/docs/features/multiplayer-and-saves/) # Frequently asked questions (FAQ) > Short answers to common KoboldCpp questions about downloads, models, memory, performance, features and the API, with links to the details. Short answers, each with a link to the page that explains more. For error messages, see [Troubleshooting](https://koboldcpp.net/docs/troubleshooting/wont-start/). ## General ### What is KoboldCpp? A program for running AI models (GGUF files) on your own computer. It is a single file with no installation, builds on llama.cpp, and includes the KoboldAI Lite web interface. Besides text, it can generate images, video and music, transcribe speech and speak text. See the [beginner guide](https://koboldcpp.net/getting-started/). ### Is it free? Yes. KoboldCpp and KoboldAI Lite are open source under AGPL-3.0; the included llama.cpp, GGML and stable-diffusion.cpp parts are under MIT. You don't need an account to run it. ### Where is the official download? Only on GitHub: the [official releases](https://github.com/LostRuins/koboldcpp/releases/latest). Files from other sites are not official. See [Staying safe](https://koboldcpp.net/docs/install/staying-safe/) for a list of known fake sites. ### Are my chats private? KoboldCpp runs fully offline and sends your chats nowhere. KoboldAI Lite stores your stories in your browser. Some things use the internet by design: * Model files you give as a URL are downloaded. * **Enable WebSearch** (`--websearch`) searches the web. * **Remote Tunnel** (`--remotetunnel`) makes KoboldCpp reachable over the internet. * MCP tools (`--mcpfile`) send the model's tool calls to the MCP servers you set up. * AI Horde and other apps you connect have their own privacy rules. * In KoboldAI Lite, **Share** with **Web URL** uploads the story to a public pastebin. The console shows your prompts and replies. **Quiet Mode** (`--quiet`) hides them. ## Download & setup ### Which file do I download? | Your PC | Windows | Linux | | ------------------------------------ | ---------------------- | ---------------------------- | | NVIDIA graphics card | `koboldcpp.exe` | `koboldcpp-linux-x64` | | AMD, Intel or no graphics card | `koboldcpp-nocuda.exe` | `koboldcpp-linux-x64-nocuda` | | Older processor or older NVIDIA card | `koboldcpp-oldpc.exe` | `koboldcpp-linux-x64-oldpc` | Apple Silicon Macs: `koboldcpp-mac-arm64`. See [Download KoboldCpp](https://koboldcpp.net/download/) ### Do I need a graphics card? No. KoboldCpp runs on the processor alone. A graphics card makes it much faster, and it can hold part of a model that doesn't fit completely. ### Which model should I start with? * Qwen3-VL-8B (Q4\_K\_S): the recommended all-rounder. * Gemma3-4B: lightweight and fast. * L3-8B-Stheno-v3.2: for creative writing and roleplay. Or click **Get Help** in the launcher and load a **Newbie Template**, which downloads a model for you. See [Choose a model](https://koboldcpp.net/getting-started/model/). ### Which quant do I download? Do I need all the files? You need one `.gguf` file, not the whole repository. If the quant is split into parts (`-00001-of-00003.gguf`), download all parts and select the first. Start with **Q4\_K\_M** or **Q4\_K\_S**. A lower quant is smaller, at some cost in quality. See [Choosing a quant](https://koboldcpp.net/docs/models/gguf-and-quantization/). ### What's the difference between GGUF and GGML? GGUF is the current format for text models. GGML (`.bin`) is the old format: it still loads, but some newer features don't work and its context is limited to 16k. ### Can I use safetensors or PyTorch models? Not for text models; convert them to GGUF first. Image models can be `.safetensors` or `.gguf`. ### Where do models downloaded from a URL go? Into the current working directory. When you double-click KoboldCpp, that is its own folder. **Download Dir:** on the **Loaded Files** tab (`--downloaddir`) sets a different folder. ### How do I update? Download the new file from the releases and use it instead of the old one. The launcher's **Update** button only opens the releases page. Save your settings with **Save Config** to keep them. See [Updating](https://koboldcpp.net/docs/install/updating/). ### Does it run on Android? Yes, in Termux. KoboldCpp is compiled on the phone by an official setup script. See [Android (Termux)](https://koboldcpp.net/docs/install/android/). ### Does it run on Windows 7? Not recommended. Use `koboldcpp-oldpc.exe`; the main builds need Windows 8 or newer. See [Windows 7](https://koboldcpp.net/docs/install/windows/#advanced-windows-7). ### My processor has no AVX2. Can I still use it? Yes. KoboldCpp detects this and switches to a slower compatibility mode. You can also pick **Use CPU (Old CPU)** or **Use Vulkan (Old CPU)** (`--noavx2`), or for processors without AVX, **Failsafe Mode (Older CPU)** (`--failsafe`). The `oldpc` files add CUDA 11 for AVX1 processors and **Use Vulkan (Older CPU)** for graphics cards on processors without AVX. See [Processor requirements](https://koboldcpp.net/docs/install/releases/#processor-avx2-avx-no-avx). ### Can I run it without a model? Yes. `--nomodel` (**Allow Launch Without Models** on the **Loaded Files** tab) starts KoboldCpp without loading a model. KoboldAI Lite can then connect to AI Horde or other online providers. ## Running & performance ### Which port does it use? 5001, so the chat is at `http://localhost:5001`. Change it with **Port:** on the **Network** tab or `--port`. ### How do I use the command line? Pass the model and options after the file name, for example `koboldcpp.exe --model mymodel.gguf --contextsize 8192`. With a model, the launcher is skipped. `--help` lists all flags. Many llama.cpp short forms also work, such as `-m`, `-c`, `-ngl` and `-t`. See [Command line](https://koboldcpp.net/docs/settings/command-line/). ### How many GPU layers should I use? Leave **GPU Layers:** at `-1`. KoboldCpp then fits as many layers into your VRAM as possible. A number you enter yourself turns this off. **Force AutoFit** (`--autofit`) forces the automatic fit even over manual settings. See [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/). ### How much RAM or VRAM do I need? Roughly the model's file size, plus memory for the context, plus some spare room. It depends on the model, the quant and the context size, so there is no fixed table. See [Memory](https://koboldcpp.net/docs/models/memory/). ### How many threads should I use? The default works for most PCs: about half of your processor's threads, minus one, and at most 8 when the system reports an Intel processor. With the whole model on the graphics card, the thread count matters little. ### How do I make it faster? * NVIDIA: **Use CUDA**. * AMD and Intel graphics: **Use Vulkan**. On Linux, an official ROCm build also exists for AMD. * Apple Silicon: the Mac build uses Metal automatically. * Put as many layers on the graphics card as fit, and keep **Use FlashAttention** on. See [GPU not used or slow](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/). ### Can I use several graphics cards? Yes, with CUDA and with Vulkan. **Tensor Split:** (`--tensor_split`) sets the share per card, and **SplitMode:** (`--splitmode`) is `layer` (default) or `tensor`. See [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/). ### What's the difference between row and layer split? Row split no longer exists. `--splitmode row` now uses tensor split and prints a warning. The choices are `layer` and `tensor`. ### How do I get a longer context? Set **Context Size:** in the launcher or `--contextsize` (default 16384, up to 524288 on the command line; the launcher slider goes to 262144). GGUF models set their RoPE scaling automatically. More context needs more memory. See [Context size](https://koboldcpp.net/docs/settings/context-size/). ### What are ContextShift and FastForwarding? Both avoid processing the whole prompt again. FastForwarding reuses the part of the prompt that didn't change; ContextShift drops the oldest text when the context is full. Both are on by default (`--noshift` and `--nofastforward` turn them off; turning off FastForwarding also turns off ContextShift). On models with SWA, ContextShift is off while SWA is on. ### What is SWA? Sliding window attention: a much smaller context cache for models that support it, such as Gemma 3. It is on by default and turns ContextShift off. **Allow SWA** off (`--noswa`) disables it. The old `--useswa` flag does nothing. ### What is flash attention? A faster, more memory-efficient way of computing attention. It is on by default; **Use FlashAttention** off (`--noflashattention`) disables it. The old `--flashattention` flag does nothing. ### What does quantized KV cache do? It stores the context in lower precision to save memory: **Quantize KV Cache:** (`--quantkv`) with `f16` (default), `bf16`, `q8_0`, `q5_1` or `q4_0`. Keep flash attention on; without it, only part of the cache is quantized. The old numbers `1` and `2` still mean `q8_0` and `q4_0`. ### What are mmap and mlock? **Use MMAP** (`--usemmap`, off by default) lets the system read the model file from disk as needed. **Use mlock** (`--usemlock`, off) keeps the model from being moved out of RAM. Both can be combined. ### What does lowvram do? `--lowvram` keeps the context cache in system RAM instead of VRAM. It works with CUDA and Vulkan, but is slow and not recommended. It is a flag of its own, no longer an option of `--usecuda`. ### What is MMQ? A CUDA method for quantized matrix multiplication, on by default (**Use MMQ**). `--nommq` turns it off. ### What is the `--foreground` flag? Windows only. **Keep Foreground** (`--foreground`) brings the console to the front for every new request, which avoids slowdowns when the window is in the background. ### What does `--multiuser` do? It queues requests from several users, up to 10 by default. `--multiuser 0` turns the queue off, so extra requests get a "Server is busy" error. With an image, Whisper, TTS or embeddings model loaded, or with **Parallel Requests:** above 1, a queue stays on. ### What are .kcpps and .kcppt files? A `.kcpps` file is a saved launcher configuration (**Save Config**). A `.kcppt` file is a template to share: it leaves out settings specific to your PC and can contain model download links. Load either with **Load Config** or `--config`. See [Config files](https://koboldcpp.net/docs/settings/config-files/) and [Templates](https://koboldcpp.net/docs/settings/templates/). ### Can I benchmark my PC? Yes. **Run Benchmark** on the **Hardware** tab, or `--benchmark`. With a file name, `--benchmark results.csv` appends the results to that file. ## Features ### Which interfaces are included? | Address | Interface | | ----------- | ------------------------------------------------ | | `/` | KoboldAI Lite | | `/lcpp/` | llama.cpp web UI | | `/sdui` | StableUI (generating needs an image model) | | `/musicui` | Music UI (generating needs a music or TTS model) | | `/noscript` | UI without JavaScript | | `/api` | API documentation | See [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/). ### Can it generate images? Yes. Load an image model on the **Image Gen** tab or with `--sdmodel` (`.safetensors` or `.gguf`). Some model families need extra files. See [Image generation](https://koboldcpp.net/docs/features/image-generation/). ### What else can it do? | Feature | Flag | Page | | ------------------------ | -------------------------- | -------------------------------------------------------- | | Speech to text (Whisper) | `--whispermodel` | [Speech to text](https://koboldcpp.net/docs/features/speech-to-text/) | | Text to speech | `--ttsmodel` | [Text to speech](https://koboldcpp.net/docs/features/text-to-speech/) | | Music | `--musicllm` and others | [Music](https://koboldcpp.net/docs/features/music/) | | Vision and audio input | `--mmproj` | [Vision](https://koboldcpp.net/docs/features/vision/) | | Embeddings | `--embeddingsmodel` | [Embeddings](https://koboldcpp.net/docs/features/embeddings/) | | Web search, MCP tools | `--websearch`, `--mcpfile` | [Web search and MCP](https://koboldcpp.net/docs/features/web-search-and-mcp/) | ### Can I switch models without restarting? Yes, with admin mode: **Enable Model Administration** (`--admin`) with a folder of configs (`--admindir`). Router mode (`--routermode`) switches by the model name in each request, autoswap mode (`--autoswapmode`) by request type, and `--adminunloadtimeout` unloads the model when idle. Set an admin password (`--adminpassword`) when you enable admin mode. See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). ### What is the KoboldCpp Agent? A coding agent for the terminal, new in v1.122. Start it with **Launch KoboldCpp Agent** on the **Admin** tab or `--agent`. It needs a context of at least 28672 tokens, which KoboldCpp sets automatically; 12 GB of VRAM or more is recommended. See [Agent](https://koboldcpp.net/docs/features/agent/). ### Can I chat in the terminal? Yes. `--cli` starts an interactive chat in the terminal without a web server. `--prompt "your text"` runs one prompt, prints the reply and exits. ### Can I see what's inside a model file? Yes. `--analyze mymodel.gguf`, or **Analyze Model** on the **Extra** tab, prints the metadata and tensors of a GGUF or safetensors file. ### Can I share my model on AI Horde? Yes, with the built-in Horde worker on the **Horde Worker** tab. See [Horde worker](https://koboldcpp.net/docs/features/horde-worker/). ### Which old flags no longer work? | Flag | Status | | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | | `--useclblast` | Removed (CLBlast was replaced by Vulkan); KoboldCpp exits with `unrecognized arguments`. Use `--usevulkan` | | `--usemirostat`, `--unbantokens`, `--stream`, `--psutil_set_threads` | Removed; KoboldCpp exits with `unrecognized arguments` | | `--flashattention`, `--useswa`, `--nommap` | Accepted, but do nothing; both features are on by default, mmap is off | | `--noblas` | Still works, same as `--usecpu` | | `--sdt5xxl`, `--sdvaecpu`, `--sdclipgpu` | Deprecated; use `--sdllm`, `--sdvaedevice`, `--sdclipdevice` | Full list: [Deprecated flags](https://koboldcpp.net/docs/reference/deprecated-flags/). ## API ### Is there an OpenAI-compatible API? Yes, at `http://localhost:5001/v1`. KoboldCpp also speaks the KoboldAI API (`/api`), and emulates the Ollama, Anthropic, A1111/Forge and ComfyUI APIs. See [API overview](https://koboldcpp.net/docs/api/overview/). ### How do I connect SillyTavern or another app? Point the app at `http://localhost:5001` for the KoboldAI API, or `http://localhost:5001/v1` for the OpenAI API. See [Connect apps](https://koboldcpp.net/docs/api/connect-apps/). ### How do I control the reply length over the API? Send `max_tokens` (OpenAI) or `max_length` (KoboldAI) in the request. If an app sends none, KoboldCpp uses **Default Gen Amt:** (`--defaultgenamt`, 2048, at most half the context). ### Does it support streaming? Yes. KoboldAI Lite streams replies by default (SSE). Over the API, the KoboldAI API streams at `/api/extra/generate/stream`, the OpenAI and Anthropic endpoints with `"stream": true`, and the Ollama endpoints by default. See [Streaming](https://koboldcpp.net/docs/api/streaming/). ### How do I use KoboldCpp from another device? * Same network: open `http://:5001` on the other device. * Over the internet: turn on **Remote Tunnel** (`--remotetunnel`) for a public `trycloudflare.com` link. Set a password first. See [Remote access](https://koboldcpp.net/docs/api/remote-access/). ### How do I secure a public instance? * Set a password (**Password:**, `--password`). Image generation and the `/tts_to_audio` endpoint are not password-protected, so anyone who can reach the server can use them. On shared servers, limit image generation with `--sdclamped`. * With admin mode on, set `--adminpassword`. * Limit requests with `--maxrequestsize`, `--ratelimit` and `--genlimit`. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). # KoboldCpp Agent > The coding agent bundled with KoboldCpp. It reads and edits files and runs commands in a terminal. Setup, safety, commands and options. 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. Caution The agent can change files and run commands on your computer. By default it asks before every tool call except `ask_user`. Keep it that way until you trust the model with your files. The agent works in the folder KoboldCpp was started from; change it with `/workdir`. ## Quick start 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 ```sh koboldcpp --model mymodel.gguf --agent ``` Add `--cli` to run the agent in the same terminal instead of a new window. ## Settings KoboldCpp changes for the agent When the agent is on, KoboldCpp adjusts these settings at launch and prints a warning listing them: | Setting | Changed to | | ------------------------------------ | -------------- | | Context size | at least 28672 | | Default generation amount | at least 8192 | | **Use Jinja** (`--jinja`) | on | | **Jinja for Tools** (`--jinjatools`) | on | The larger context needs more memory. See [Context size](https://koboldcpp.net/docs/settings/context-size/). ## Tools | Tool | What it does | | ----------------------- | ------------------------------------- | | `read`, `write`, `edit` | Read, create and change files. | | `shell` | Run a shell command. | | `glob`, `grep` | Find files and search their contents. | | `web_fetch` | Download a web page. | | `view_image` | Look at an image file. | | `ask_user` | Ask you a question. | If KoboldCpp has [MCP servers](https://koboldcpp.net/docs/features/web-search-and-mcp/) 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. ## Commands Type these at the agent prompt: | Command | What it does | | --------------------------------- | ------------------------------------------------------------------------------------------------------ | | `/help` | List all commands. | | `/confirm on` | Ask before every tool call except `ask_user` (default). | | `/confirm off` | Run all tool calls without asking. | | `/confirm auto` | Ask only when the agent's own review does not approve the call. | | `/tools` | List the tools. `/tools NAME on` or `/tools NAME off` turns one on or off and clears the conversation. | | `/workdir PATH` | Change the working folder. Clears the conversation. | | `/compact` | Summarize the conversation to free context. | | `/clear` | Start over. | | `/reasoning on`, `/reasoning off` | Show or hide the model's reasoning. | | `/verbose on`, `/verbose off` | Show or hide full tool arguments and results. | | `/connect` | Switch to another endpoint, API key or model. | | `/exit` or `/quit` | Stop the agent. | ## Other backends 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. ## Advanced: agent options When you run `kcpp_agent.py` from a source checkout, it takes these options: | Option | Default | | ------------------- | ------------------------------------------------ | | `--base-url` | `OPENAI_BASE_URL`, or `http://127.0.0.1:5001/v1` | | `--api-key` | `OPENAI_API_KEY`, or `local` | | `--model` | `OPENAI_MODEL`, or `local-model` | | `--temperature` | `0.4` | | `--max-tokens` | not set | | `--request-timeout` | `600` seconds | | `--confirmation` | `on` (also `off`, `auto`) | | `--no-color` | off | 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`. ## Related * [Web search and MCP tools](https://koboldcpp.net/docs/features/web-search-and-mcp/) * [Connect other apps](https://koboldcpp.net/docs/api/connect-apps/) # Embeddings > Serve an embeddings model from KoboldCpp for search and RAG apps, through the OpenAI, Ollama and KoboldCpp embeddings endpoints. An embeddings model turns text into a list of numbers (a vector). Apps use these vectors to find text with similar meaning, for example for document search and RAG. KoboldCpp serves an embeddings model next to the text model. You need this if an app asks for an embeddings endpoint, or to use **KoboldCpp Embeddings** in Lite's TextDB (**Context** > **TextDB**). Normal chatting in KoboldAI Lite does not need it. ## Quick start Started with a `Chatbot` newbie template? It already loads an embeddings model. Skip to step 4. 1. Download an embeddings model as a `.gguf` file. A good first pick is [bge-m3-q8\_0.gguf](https://huggingface.co/ggml-org/bge-m3-Q8_0-GGUF/resolve/main/bge-m3-q8_0.gguf), the one the `LowSpec-Chatbot` template uses. 2. In the launcher, open the **Loaded Files** tab and select the file in **Embeds Model:**. 3. Click **Launch**. 4. In your app, set the embeddings endpoint to `http://localhost:5001/v1` (OpenAI-compatible). On the command line: Terminal ```sh koboldcpp --model mymodel.gguf --embeddingsmodel embeddings-model.gguf ``` ## API | Endpoint | Format | | ---------------------------- | ----------------------------------------------- | | `POST /v1/embeddings` | OpenAI. Supports `"encoding_format": "base64"`. | | `POST /api/embed` | Ollama | | `POST /api/extra/embeddings` | KoboldCpp | With `--password` set, these endpoints need the password. ## Advanced options | Launcher field | Flag | What it does | | ----------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **ECtx:** | `--embeddingsmaxctx` | Maximum input length in tokens. Default `4096`, never more than the model was trained for. `0` uses the text model's context size. A negative value uses the model's trained context. | | **GPU** (next to **Embeds Model:**) | `--embeddingsgpu` | Puts the embeddings model on the GPU. Usually not needed. | An empty **ECtx:** field in the launcher saves as `0`. With bge-m3 on a PC with an RTX 3090, **GPU** embedded 32 texts of about 340 tokens in 0.69 s instead of 1.3 s on the CPU, and used about 300 MiB more VRAM. ## Related * [Connect other apps](https://koboldcpp.net/docs/api/connect-apps/) * [API endpoints](https://koboldcpp.net/docs/api/endpoints/) # AI Horde worker > Share your model with the AI Horde, a volunteer network. How to set up the built-in Horde worker in KoboldCpp and what the options do. The [AI Horde](https://aihorde.net) is a volunteer network: people run models on their own computers and others use them over the internet. KoboldCpp has a built-in worker, so you can share your text model with the Horde while you run it. The worker only takes Horde jobs while you are not using the model yourself: it waits until there has been no local request for 20 seconds. ## Set it up You need an AI Horde API key. Register at [aihorde.net/register](https://aihorde.net/register) to get one. 1. Load your text model as usual. 2. In the launcher, open the **Horde Worker** tab and tick **Configure for Horde**. 3. Enter your key in **API Key (If Embedded Worker):** and a name for your worker in **Horde Worker Name:**. 4. Click **Launch**. On the command line: Terminal ```sh koboldcpp --model mymodel.gguf --hordekey YOUR_KEY --hordeworkername my-worker ``` Both the key and the worker name are required. With only the key, KoboldCpp prints "Horde worker could not start. You need to specify a horde worker name with --hordeworkername". With a Horde worker, KoboldCpp switches to quiet mode automatically. Caution **Save Config** stores your Horde API key in plain text in the `.kcpps` file. Do not share that file. Templates (`.kcppt`) leave the key and worker name out. ## Options | Launcher field | Flag | What it does | | --------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------- | | **Horde Model Name:** | `--hordemodelname` | The model name shown on the Horde. Empty means the file name. KoboldCpp adds `koboldcpp/` in front. | | **Gen. Length:** | `--hordegenlen` | Most tokens your worker generates per Horde job. Default `1024`. | | **Max Context:** | `--hordemaxctx` | Largest context your worker accepts from a Horde job. `0` means your context size; it cannot go higher. | | **API Key (If Embedded Worker):** | `--hordekey` | Your AI Horde API key. | | **Horde Worker Name:** | `--hordeworkername` | Your worker's name on the Horde. | ## Advanced * These three settings are not Horde-only. **Horde Model Name:** also renames the model in `/api/v1/model` and `/v1/models`. **Gen. Length:** and **Max Context:** are also what `/api/v1/config/max_length` and `/api/v1/config/max_context_length` report to other apps. * With `--parallelrequests N`, KoboldCpp starts N workers under the same name. * After repeated errors, the worker pauses for growing periods, and stops after too many. * If the worker fails with certificate (SSL) errors, `--nocertify` turns off certificate checks for all outgoing connections. This is insecure: whoever intercepts the connection can read your Horde API key. Use it only as a last resort. ## Related * [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/): Lite can also use models from the AI Horde. * [Config files](https://koboldcpp.net/docs/settings/config-files/) # Image and video generation > Generate and edit images, and videos, with KoboldCpp. Which model files you need, how to load them, and how to use StableUI, Lite and the image APIs. KoboldCpp generates and edits images with a bundled copy of stable-diffusion.cpp. It also generates videos with some model families. Image generation runs next to the text model, or on its own. ## Quick start 1. Download an image model. A good first pick is [PicX Real](https://huggingface.co/koboldcpp/imgmodel/resolve/main/picx_real_q8_0.gguf). 2. In the launcher, open the **Image Gen** tab and select the file in **Image Model:**. 3. Click **Launch**. 4. Open `http://localhost:5001/sdui` for StableUI, the bundled image interface. A template is the other way in: click **Get Help**, choose **Newbie Templates**, and pick `LowSpec-ImageGen` or `MidSpec-ImageGen`. KoboldCpp downloads the files at launch. On the command line: Terminal ```sh koboldcpp --sdmodel picx_real_q8_0.gguf ``` Add `--model` with a text model if you want to chat as well. ## Using it * **StableUI** (`/sdui`): prompts, settings and a LoRA picker. It has a recovery mode for poor connections. * **KoboldAI Lite**: open **Settings** > **Media** and set **Image Backend** to **KCPP / Forge / A1111**. Then use **Add File** > **Generate Image**, or turn on **Autogenerate images**. * **Other apps**: KoboldCpp speaks the A1111/Forge API, the OpenAI images API and a ComfyUI-compatible API. Point apps such as SillyTavern at `http://localhost:5001`. | API | Endpoints | | ------------- | ------------------------------------------------------------------ | | A1111 / Forge | `POST /sdapi/v1/txt2img`, `/sdapi/v1/img2img`, `/sdapi/v1/upscale` | | OpenAI | `POST /v1/images/generations`, `/v1/images/edits` | | ComfyUI | `POST /prompt`, `/upload/image`; `GET /view`, `/history` | Videos use the same endpoints. See [API endpoints](https://koboldcpp.net/docs/api/endpoints/). Caution The password (`--password`) does not protect the image endpoints. Anyone who can reach your KoboldCpp can generate images. On a shared or public server, limit the image size with **Clamp Resolution (Hard):** (`--sdclamped`). See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Supported models Models come as `.safetensors` or `.gguf` files. | Kind | Families | | ------ | ------------------------------------------------------------------------ | | Images | Stable Diffusion 1.5, SDXL, SD3, Flux, Qwen Image, Z-Image, Klein, Krea2 | | Video | WAN 2.2, LTX2.3, Minimax H3 | Recent releases also added SDXS (small and fast, usable on a CPU), Microsoft Lens, HiDream o1, LongCat, Ernie Image, Ideogram 4 and Boogu Edit. Image models are on Hugging Face (search for the family name) and on CivitAI. The [popular templates](https://huggingface.co/koboldcpp/popular-templates) include ready setups, for example Z-Image Turbo and WAN 2.2. ## Models with several files SD 1.5 and SDXL models are usually one file. Newer families such as Flux, SD3, Qwen Image and Z-Image need extra parts. Load them on the **Image Gen** tab: | Part | Launcher field | Flag | | --------------------------------- | ---------------- | -------------- | | Main model (diffusion model) | **Image Model:** | `--sdmodel` | | Text encoder or LLM (T5, Qwen, …) | **Image LLM:** | `--sdllm` | | First CLIP model (Clip-L) | **Clip-1 File:** | `--sdclip1` | | Second CLIP model (Clip-G) | **Clip-2 File:** | `--sdclip2` | | VAE | **Image VAE:** | `--sdvae` | | Audio VAE (LTX2.3 video only) | **Audio VAE:** | `--sdaudiovae` | Leave a field empty if the model already contains that part. A template for the model fills in all fields for you. ## LoRAs * **Fixed LoRAs:** list the files in **Image LoRAs:** (`--sdlora`), with their strength in **Multiplier:** (`--sdloramult`). They apply to every image. * **Runtime LoRAs:** tick **Runtime LoRAs** and pick a folder in **LoRA Dir:** (`--sdlora `). KoboldCpp scans the folder and one level of subfolders. You choose LoRAs per image in StableUI, or with `` in the prompt. ## Saving memory | Launcher field | Flag | Effect | | -------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Compress Weights:** | `--sdquant` | Loads the model compressed to q8 (`1`) or q4 (`2`). A model downloaded pre-quantized loads faster. Cannot be combined with `--sdlora` on the command line. | | **Automatic VAE (TAE SD)** | `--sdvaeauto` | Uses a tiny built-in VAE. Faster and uses less memory, but image quality can drop. May fix a bad VAE. Not available for every model type. | | **Model Offload** | `--sdoffloadcpu` | Keeps image weights in RAM and moves them to VRAM when needed. | | **VRAM Limiter (MB):** | `--sdvramlimit` | Limits how much VRAM image generation plans for. Actual use can go somewhat higher. `0` means no limit. | | **VAE Tiling Threshold:** | `--sdtiledvae` | Decodes images in tiles when they have more pixels than this size squared (default `512`: above 512×512 pixels). `0` turns tiling off. | The image templates turn on **Model Offload** and keep the text encoder on the CPU. Measured on an RTX 3090 with FLUX.2 klein at 4 steps: | Setup | Peak VRAM | One 1024×1024 image | | ----------------------------------------------------- | --------- | ------------------- | | `LowSpec-ImageGen` (FLUX.2 klein 4B) | 3858 MiB | 14.2 s | | `LowSpec-ImageGen`, **Model Offload** off | 4514 MiB | 13.9 s | | `LowSpec-ImageGen`, VAE tiling off (`--sdtiledvae 0`) | 7584 MiB | 11.8 s | | `MidSpec-ImageGen` (FLUX.2 klein 9B) | 7238 MiB | 22.8 s | ## Advanced options | Launcher field | Flag | What it does | | -------------------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | **Clamp Resolution (Hard):** | `--sdclamped [px]` | Limits the longest image side, keeping the aspect ratio. Without a value it means 512. | | **(Soft):**, next to Clamp Resolution (Hard) | `--sdclampedsoft px` | Limits the image area (e.g. 640 allows 640x640, 512x768, 768x512). At `0` a default applies: 832 for SD 1.x/2.x, 1024 for others. Maximum 2048. | | **Upscaler:** | `--sdupscaler` | Loads an ESRGAN upscaler for `/sdapi/v1/upscale`. | | **PhotoMaker:** | `--sdphotomaker` | Face cloning for SDXL models. | | **SD Flash Attention** | `--sdflashattention` | Flash attention for image generation. Separate from the text model's setting. | | **Conv2D Direct:** | `--sdconvdirect` | `off` (default), `vaeonly` or `full`. May speed things up or save memory. Can crash on backends that don't support it. | | **ImgThreads:** | `--sdthreads` | CPU threads for images. `0` uses the text model's thread count. | | **ImgGPU:** | `--sdmaingpu` | GPU for the image weights. | | **CLIP dev:** | `--sdclipdevice` | Device for the text encoders. Default: CPU. | | **VAE dev:** | `--sdvaedevice` | Device for the VAE. Default: the main GPU. | Every flag is listed in the [flag reference](https://koboldcpp.net/docs/reference/flags/). Older guides use `--sdt5xxl`, `--sdvaecpu` and `--sdclipgpu`; their replacements are `--sdllm`, `--sdvaedevice` and `--sdclipdevice`. ## Related * [Vision](https://koboldcpp.net/docs/features/vision/): let the text model look at images. * [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/) * [API endpoints](https://koboldcpp.net/docs/api/endpoints/) # KoboldAI Lite: the built-in web UI > KoboldAI Lite is the web interface built into KoboldCpp. Its modes, UI styles, where the settings and samplers are, and the other bundled UIs. KoboldAI Lite is the web interface built into KoboldCpp. After you click **Launch**, it opens at `http://localhost:5001`. You need nothing else to chat, write stories or play text adventures. ## Start chatting 1. Launch KoboldCpp with a model. With **Launch Browser** ticked (the default in the launcher), Lite opens by itself. Otherwise, open `http://localhost:5001`. 2. Type into the input box at the bottom and send. 3. To change how Lite behaves, click **Settings** in the top menu. ## Modes Pick the mode in **Settings** > **General** > **Usage mode**. | Mode | Use it for | | ------------------ | -------------------------------------------------------------- | | **Instruct Mode** | Giving the AI tasks, ChatGPT-style. | | **Chat Mode** | Conversations with a character. | | **Story Mode** | Novel-style writing, where you and the AI write the same text. | | **Adventure Mode** | Interactive fiction and text RPGs. | ## UI styles Next to the mode, **UI style** changes how the text is shown. Some styles are only available in some modes. | Style | Look | | ------------------- | ------------------------------------------------------------------ | | **Classic Theme** | Plain text editor, for writing. | | **Messenger Theme** | Chat bubbles. | | **Aesthetic Theme** | Roleplay layout. The button next to it opens more display options. | | **Corpo Theme** | Assistant-style layout. | ## Where the settings are The launcher decides what the server can do: which model, how much context memory is reserved, which features are loaded. Lite decides what it sends with each request. **Settings** has these tabs: | Tab | What you find there | | ------------ | --------------------------------------------------------------------------------------------- | | **General** | Usage mode, UI style, your name and the AI's name. | | **GUI** | Appearance. | | **Samplers** | **Sampler Preset**, **Context Size**, **Max Output**, **Temperature** and the other samplers. | | **Media** | Image generation, text-to-speech (**Audio Output**) and voice input (**Audio Input**). | | **Tokens** | Token settings. | | **Tools** | MCP tool calling and web search. | | **Misc** | Save/load, advanced and experimental settings. | **Context Size** in Lite covers the text Lite sends plus the reply (**Max Output**). The server cuts it down to the context it reserved at launch. If the server reserved 16384 or more, Lite raises its own value to match. A value you lowered yourself stays until the server's context changes. See [Context size](https://koboldcpp.net/docs/settings/context-size/). The other top menu items: * **New Session** starts over. * **Scenarios** loads ready-made stories and characters. * **Save / Load** saves and loads your story as a JSON file. * **Context** (above the input box) holds memory, world info and the author's note. * **Add File** (above the input box) adds images or audio, or generates an image. ## Other bundled interfaces | Address | Interface | Available when | | ----------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `/` | KoboldAI Lite | Always. | | `/sdui` | StableUI, for images | Always. Generating images needs an image model. See [Image generation](https://koboldcpp.net/docs/features/image-generation/). | | `/musicui` | MusicUI, for music and speech | Always. Generating needs a music or TTS model. See [Music](https://koboldcpp.net/docs/features/music/). | | `/lcpp/` | The llama.cpp web UI | Always. It can connect to MCP servers. | | `/noscript` | A plain page without JavaScript, with story, chat and image modes | Always. For old or restricted browsers. | | `/api` | The API documentation | Always. | If you load only an image model, Lite offers to open StableUI. If you load only a music or TTS model, it offers MusicUI. ## Lite without KoboldCpp Lite also runs at [lite.koboldai.net](https://lite.koboldai.net). That copy can connect to your KoboldCpp, to the AI Horde, or to online AI services. To use the bundled Lite without a local model, tick **Allow Launch Without Models** on the **Loaded Files** tab (`--nomodel`). Lite then asks whether to connect to an external service. ## Advanced * **TextDB** (**Context** > **TextDB**) is Lite's document lookup (RAG). **Local TextDB** searches in the browser. **KoboldCpp Embeddings** uses the loaded [embeddings model](https://koboldcpp.net/docs/features/embeddings/). * Lite loads Tavern character cards, and imports SillyTavern chat exports (JSONL) and several other save formats. * In **Settings** > **Samplers**, **Sampler Preset** switches between curated sampler sets. ## Related * [Chat in your browser](https://koboldcpp.net/getting-started/chat/) * [Context size](https://koboldcpp.net/docs/settings/context-size/) * [Multiplayer and server saves](https://koboldcpp.net/docs/features/multiplayer-and-saves/) * [Connect other apps](https://koboldcpp.net/docs/api/connect-apps/) # Multiplayer and server saves > Share one story with several people in KoboldAI Lite, keep saves on the server instead of in the browser, and preload a story for everyone. KoboldAI Lite normally keeps your story in your browser. Three server features change that: * **Multiplayer:** several people work on one shared story. * **Server saves:** save slots on the KoboldCpp computer, shared by everyone who can connect. * **Preloaded story:** a story that KoboldCpp offers to everyone who connects. ## Multiplayer 1. In the launcher, open the **Network** tab and tick **Shared Multiplayer** (`--multiplayer`). 2. Make KoboldCpp reachable for the others: same network, or **Remote Tunnel**. See [Remote access](https://koboldcpp.net/docs/api/remote-access/). 3. Set a **Password:** on the **Network** tab before you share the address. 4. Click **Launch**. 5. Give everyone the address and the password. They open KoboldAI Lite at your address, enter the password in the **API Key Required** box, and click **Join Multiplayer** in the top menu. **Exit Multiplayer** leaves the session. The multiplayer endpoints need the password when one is set. ## Server saves 1. In the launcher, open the **Loaded Files** tab, tick **Enable Server Side SaveData File** and choose a file in **SaveData File:** (`--savedatafile`). 2. Click **Launch**. 3. In KoboldAI Lite, open **Save / Load** and choose **KoboldCpp Server Storage** as the location. The slots appear as **Server Slot 1**, **Server Slot 2** and so on. * There are 12 slots. Each story can be up to 10 MB. * KoboldCpp adds `.jsondb` to the file name: `--savedatafile saves` creates `saves.jsondb`. A missing file is created, including its folders. * The slots are not private. Anyone who can connect can load, overwrite or delete them. The save endpoints need the password when one is set. * Back up the `.jsondb` file to keep your saves. KoboldCpp rewrites the whole file on every save. ## Preloaded story **Preload Story:** on the **Loaded Files** tab (`--preloadstory`) takes a story saved from Lite as JSON. KoboldCpp serves it to frontends such as Lite. When you export a template (`.kcppt`) from the launcher, the preloaded story is embedded in the template. ## API | Endpoint | Needs | | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | | `POST /api/extra/multiplayer/status`, `/api/extra/multiplayer/getstory`, `/api/extra/multiplayer/setstory` | `--multiplayer` | | `POST /api/extra/data/list`, `/api/extra/data/load`, `/api/extra/data/save` | `--savedatafile` | | `GET /api/extra/preloadstory` | `--preloadstory`. Returns `{}` when none is set. | Without `--savedatafile`, `/api/extra/data/list` and `/api/extra/data/load` close the connection without an answer. `/api/extra/data/save` returns HTTP 400. ## Related * [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/) * [Remote access](https://koboldcpp.net/docs/api/remote-access/) * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) # Music Generation > Generate songs with ACE-Step in KoboldCpp. The four model files, the LowSpec-MusicGen template, MusicUI and the music API. KoboldCpp generates music with ACE-Step 1.5 and ACE-Step XL. You describe a song, and it generates the audio. ## Quick start Music needs three model files, plus an optional fourth. A template downloads them for you. 1. In the launcher, click **Get Help**. 2. Choose **Newbie Templates**, pick `LowSpec-MusicGen` and click **Load Template**. 3. Click **Launch**. KoboldCpp downloads the files. 4. Open `http://localhost:5001/musicui`. ## The model files Download the files from [huggingface.co/koboldcpp/music](https://huggingface.co/koboldcpp/music) and load them on the **Audio** tab: | File | Launcher field | Flag | Required | | ----------------------------------------------- | ------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | Music LLM, e.g. `acestep-5Hz-lm` | **MusicLLM:** | `--musicllm` | No. Without it, choose **Main LLM** as **Lyrics Planner** in MusicUI to plan the song with the loaded text model. `/api/extra/music/prepare` needs it. | | Embedding model, e.g. `Qwen3-Embedding-0.6B` | **MusicEmbeds:** | `--musicembeddings` | Yes | | Diffusion model (DiT), e.g. `acestep-v15-turbo` | **MusicDiffuser:** | `--musicdiffusion` | Yes | | VAE | **MusicVAE:** | `--musicvae` | Yes | The diffusion model does not load without the embedding model and the VAE. KoboldCpp stops with "Invalid config: Music Diffusion requires Music embedding and Music VAE models!". On the command line: Terminal ```sh koboldcpp --musicllm music-lm.gguf --musicembeddings music-embed.gguf --musicdiffusion music-dit.gguf --musicvae music-vae.gguf ``` ## Using it * **MusicUI** (`/musicui`) is the bundled interface for music and speech. It supports reference audio uploads and MP3 output. It also has a TTS tab. * **KoboldAI Lite:** **Add File** > **Launch MusicUI**. * **API:** the endpoints below. | Endpoint | Returns | | -------------------------------- | ----------------------------------------------------------------------------------------------- | | `POST /api/extra/music/prepare` | JSON with the song plan (metadata and lyrics). Add `"gen_codes": true` to also get audio codes. | | `POST /api/extra/music/generate` | WAV or MP3 audio | The API works in two steps: 1. Send `caption` (a description of the song), `lyrics` and `duration` (in seconds) to `/api/extra/music/prepare`. The plan you get back contains the rewritten caption, the lyrics, `bpm`, `duration`, `keyscale`, `timesignature`, `vocal_language`, `seed` and further generation settings. 2. Send that plan to `/api/extra/music/generate`. It returns the audio. With `--password` set, both endpoints need the password. ## Advanced options | Launcher field | Flag | What it does | | ------------------ | ---------------- | --------------------------------------------------------------------------- | | **Music Low VRAM** | `--musiclowvram` | Keeps the music models out of VRAM when idle and swaps them in when needed. | `LowSpec-MusicGen` turns **Music Low VRAM** on. Measured with that template on an RTX 3090 and a 10-second instrumental: | **Music Low VRAM** | Peak VRAM | Prepare + generate | | --------------------- | --------- | ------------------ | | On (template default) | 5644 MiB | 6.1 s + 11.1 s | | Off | 11330 MiB | 0.8 s + 2.1 s | With only **MusicLLM:** set and no other music file, KoboldCpp loads the music LLM alone. It can then only plan songs: `/api/extra/music/prepare` works, but `/api/extra/music/generate` returns an empty response instead of audio. ## Related * [Text-to-speech](https://koboldcpp.net/docs/features/text-to-speech/) * [API endpoints](https://koboldcpp.net/docs/api/endpoints/) # Speech-to-text with Whisper > Turn speech into text with a Whisper model in KoboldCpp. Where to get the model, how to load it, voice input in Lite, and the transcription API. KoboldCpp turns spoken audio into text with Whisper. You can talk to the AI in KoboldAI Lite, or send audio files to the transcription API. ## Quick start Started with a `Chatbot` newbie template? It already loads a Whisper model. Skip to step 4. 1. Download a Whisper model (`.bin` file) from [huggingface.co/koboldcpp/whisper](https://huggingface.co/koboldcpp/whisper/tree/main). A good first pick is [whisper-base.en-q5\_1.bin](https://huggingface.co/koboldcpp/whisper/resolve/main/whisper-base.en-q5_1.bin), the one the `LowSpec-Chatbot` template uses. 2. In the launcher, open the **Audio** tab and select the file in **Whisper Model (Speech-To-Text):**. 3. Click **Launch**. 4. In KoboldAI Lite, open **Settings** > **Media** and set **Voice Input** under **Audio Input**. On the command line: Terminal ```sh koboldcpp --model mymodel.gguf --whispermodel whisper-model.bin ``` ## Voice input in Lite **Settings** > **Media** > **Audio Input** > **Voice Input** has these modes: | Mode | How it works | | ------------------ | ----------------------------------------------- | | **Detect Voice** | Hands-free: Lite detects when you speak. | | **Push-To-Talk** | Lite records while you hold the voice button. | | **Toggle-To-Talk** | The voice button switches recording on and off. | The same section has **Suppress Non-Speech**, **Language** and **Delay**. The **Add File** menu also has a **Microphone** option. Browsers allow the microphone only on HTTPS or on the PC itself (`localhost`). From another device, use the **Remote Tunnel** link or [HTTPS](https://koboldcpp.net/docs/api/passwords-and-security/#https-ssl). ## Audio formats Whisper in KoboldCpp reads **WAV**, **MP3** and **FLAC**. Convert other formats, such as WebM or OGG, before you send them. Some apps send WebM by default. ## API | Endpoint | Format | | ------------------------------- | --------- | | `POST /api/extra/transcribe` | KoboldCpp | | `POST /v1/audio/transcriptions` | OpenAI | Send the audio as base64 in `audio_data`, or as a multipart `file` upload. The answer is `{"text": "..."}`. Optional fields: | Field | Meaning | | -------------------------- | ----------------------------------- | | `language` (or `langcode`) | Language code. Default `auto`. | | `prompt` | Text that guides the transcription. | | `suppress_non_speech` | Ignore sounds that are not speech. | A multipart upload reads only `language` and `prompt`. Use JSON for `langcode` and `suppress_non_speech`. With `--password` set, these endpoints need the password. ## Without a Whisper model If no Whisper model is loaded but the text model has an audio-capable mmproj, KoboldCpp transcribes with the text model instead. See [Vision and audio input](https://koboldcpp.net/docs/features/vision/). ## Related * [Text-to-speech](https://koboldcpp.net/docs/features/text-to-speech/) * [API endpoints](https://koboldcpp.net/docs/api/endpoints/) # Text-to-speech (TTS) > Let KoboldCpp read text aloud with Qwen3TTS, Kokoro, OuteTTS and other voice models. Loading, narration in Lite, voice cloning and the speech API. KoboldCpp turns text into spoken audio. KoboldAI Lite can narrate the AI's replies, and apps can use the speech API. ## Quick start Started with a `Chatbot` newbie template? It already loads a TTS model. Skip to step 4. 1. Download a TTS model (`.gguf` file) from [huggingface.co/koboldcpp/tts](https://huggingface.co/koboldcpp/tts/tree/main). A good first pick is [Kokoro\_no\_espeak\_Q4.gguf](https://huggingface.co/koboldcpp/tts/resolve/main/Kokoro_no_espeak_Q4.gguf), the one the `LowSpec-Chatbot` template uses. 2. In the launcher, open the **Audio** tab and select the file in **TTS Model (Text-To-Speech):**. Qwen3TTS and OuteTTS need a second file in **WavTokenizer Model (Required for some models):** (see below). 3. Click **Launch**. 4. In KoboldAI Lite, open **Settings** > **Media** and set **Text to speech** under **Audio Output** to **KoboldCpp TTS API**. Pick a **Voice**. On the command line: Terminal ```sh koboldcpp --model mymodel.gguf --ttsmodel tts-model.gguf ``` ## Supported engines KoboldCpp reads the engine from the model file. | Engine | Notes | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | **Qwen3TTS** | 0.6B and 1.7B sizes. Built-in voices, voice cloning and voice design. Needs its tokenizer file in **WavTokenizer Model (Required for some models):** (`--ttswavtokenizer`). Without it, loading fails. | | **Kokoro** | Runs on the CPU. | | **OuteTTS** | Needs a WavTokenizer file in **WavTokenizer Model (Required for some models):** (`--ttswavtokenizer`). Without it, loading fails. | | **Parler**, **Dia** | Run on the CPU. | ## Voices * **Built-in voices:** Qwen3TTS voices come with KoboldCpp. The voice list also has `random` and `instruct`. * **Voice design (Qwen3TTS):** describe the voice in square brackets at the start of the text, for example `[A depressed woman is crying] I can't believe it.` * **Voice cloning (Qwen3TTS):** put short `.wav` or `.mp3` recordings in a folder and select it in **TTS Voices Dir:** (`--ttsdir`). Each file becomes a voice named after the file. Only Qwen3TTS clones from these recordings, and only with a model file that includes a speaker encoder. Without one, or with a voice design description in the text, you get a normal voice instead. ## Using it * **KoboldAI Lite:** **Settings** > **Media** > **Audio Output**. Besides the voice, you set **Narration triggered for**, **Narrate only dialog** and **Narration streaming**. * **MusicUI** (`http://localhost:5001/musicui`) has a TTS tab. * **Other apps:** use the OpenAI speech API or the XTTS API. | Endpoint | Format | | ---------------------------------------- | ----------- | | `POST /api/extra/tts` | KoboldCpp | | `POST /v1/audio/speech` | OpenAI | | `POST /tts_to_audio` | XTTS | | `GET /v1/audio/voices`, `/speakers_list` | Voice lists | The audio comes back as WAV. Set `"response_format": "mp3"` for MP3. Qwen3TTS speaks several languages. Set `"language"` in the request on any of the endpoints above (default `en`). Caution The password (`--password`) protects `/api/extra/tts` and `/v1/audio/speech`, but not the XTTS endpoint `/tts_to_audio`. On a shared server, anyone who can reach KoboldCpp can use it. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Advanced options | Launcher field | Flag | What it does | | ------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------- | | **TTS Use GPU** | `--ttsgpu` | Runs OuteTTS and Qwen3TTS on the GPU. Kokoro, Parler and Dia always run on the CPU. | | **TTS Threads:** | `--ttsthreads` | CPU threads for TTS. `0` uses the text model's thread count. | | **TTS Max Tokens:** | `--ttsmaxlen` | For OuteTTS, the maximum audio tokens. For Kokoro, Parler and Dia, the maximum number of input words. Default and maximum `4096`. | | **TTS Voices Dir:** | `--ttsdir` | Folder with voice recordings for cloning. | ## Related * [Speech-to-text](https://koboldcpp.net/docs/features/speech-to-text/) * [Music](https://koboldcpp.net/docs/features/music/) * [API endpoints](https://koboldcpp.net/docs/api/endpoints/) # Vision and audio input > Let the text model see images and hear audio with a matching mmproj file. Where to get it, how to load it, and how to send images from Lite and the API. A vision model can describe and answer questions about images. Some models can also listen to audio. For this, the text model needs its matching projector file, called an **mmproj**. ## Quick start Started with a `Chatbot` newbie template? It already loads a vision model and its mmproj. Skip to step 5. 1. Use a text model that supports vision, for example [Qwen3-VL-8B](https://huggingface.co/unsloth/Qwen3-VL-8B-Instruct-GGUF/resolve/main/Qwen3-VL-8B-Instruct-Q4_K_S.gguf). 2. Download its mmproj. For Qwen3-VL-8B, that is [mmproj-BF16.gguf](https://huggingface.co/unsloth/Qwen3-VL-8B-Instruct-GGUF/resolve/main/mmproj-BF16.gguf). 3. In the launcher, open the **Loaded Files** tab and select the file in **Mmproj File:**. 4. Click **Launch**. 5. In KoboldAI Lite, click **Add File** > **Upload a File (Image / Audio)** and ask about the image. On the command line: Terminal ```sh koboldcpp --model Qwen3-VL-8B-Instruct-Q4_K_S.gguf --mmproj mmproj-BF16.gguf ``` ## Getting the right mmproj An mmproj only works with the exact model it was made for, including its size: a Gemma3 12B model needs the Gemma3 12B mmproj, and a Qwen mmproj does not work with a Gemma model. The mismatch shows as `failed to load mmproj model!` or a crash while loading. * Look on the model's Hugging Face page for a file with `mmproj` in its name. * [huggingface.co/koboldcpp/mmproj](https://huggingface.co/koboldcpp/mmproj) collects mmproj files for many models. The mmproj works only with GGUF text models. ## Audio input Some mmproj files handle audio. The launcher field accepts both ("Audio or Vision mmproj"). With an audio mmproj, you can send audio clips to the model the same way as images. If no Whisper model is loaded, KoboldCpp uses the audio mmproj for [speech-to-text](https://koboldcpp.net/docs/features/speech-to-text/) as well. ## Sending images and audio * **KoboldAI Lite:** **Add File** offers **Upload a File (Image / Audio)**, **Camera** and **Drag Drop / Paste from Clipboard**. Images appear in the chat where you added them. From another device, **Camera** works only over HTTPS; see [Remote access](https://koboldcpp.net/docs/api/remote-access/#same-network). * **OpenAI API** (`/v1/chat/completions`): send images as multimodal message content, as with OpenAI vision models. * **KoboldAI API** (`/api/v1/generate`): send them in the `images` and `audio` arrays. * **A1111 API:** `POST /sdapi/v1/interrogate` describes an image. It is not protected by `--password`. Each request can carry up to 64 images and 64 audio clips. If you send more, only the last 64 of each are used. To check what a running server supports, `GET /props` shows `modalities.vision` and `modalities.audio`. ## Advanced options All on the **Loaded Files** tab: | Launcher field | Flag | What it does | | ------------------ | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | **Vision MaxRes:** | `--visionmaxres` | Largest image size in pixels. `512` to `2048`, default `1024`. | | **V.Min/Max Tok:** | `--visionmintokens`, `--visionmaxtokens` | Tokens per image, for models with variable image sizes. `-1` uses the model's default. Setting only one of them sets both to that value. | | **V.Force CPU** | `--mmprojcpu` | Runs the mmproj on the CPU instead of the GPU. | KoboldCpp prints a warning when you combine an mmproj with a draft model or MTP. The mmproj needs VRAM on top of the model. For Qwen3-VL-8B's `mmproj-F16.gguf`, autofit estimates it at startup: `MMProj Autofit Usage: 1105 MB`. **V.Force CPU** moves it to system RAM, and images are then processed more slowly. On a Radeon RX 7600 XT, the first reply to a 1920-pixel-wide screenshot took 16.1 s with the mmproj on the GPU and 22.9 s on the CPU. ## Related * [Image generation](https://koboldcpp.net/docs/features/image-generation/): create images instead of reading them. * [Speech-to-text](https://koboldcpp.net/docs/features/speech-to-text/) # Web search and MCP tools > Let the model search the web, and connect MCP servers so it can call tools. Setup in the launcher and in KoboldAI Lite, the mcp.json format and safety. Two features give the model information and abilities beyond its own knowledge: * **Web search:** KoboldCpp searches the web, and KoboldAI Lite adds the results to the prompt. * **MCP tools:** KoboldCpp connects to MCP servers, which offer tools the model can call, such as reading files or querying services. ## Web search 1. In the launcher, open the **Network** tab and tick **Enable WebSearch** (`--websearch`). 2. Click **Launch**. 3. In KoboldAI Lite, open **Settings** > **Tools** and tick **Enable Websearch** under **KoboldCpp Classic Websearch**. Lite then searches the web for relevant information in instruct mode. A search button above the input box turns it on and off. How it works: * KoboldCpp searches DuckDuckGo and uses the top 3 results. * Queries are cut to 500 bytes. Apps can use the endpoint directly: `POST /api/extra/websearch` with `{"q": "your query"}`. It needs the password when one is set. Without `--websearch`, it returns an empty list. ## MCP tools MCP (Model Context Protocol) servers are small programs or web services that offer tools. KoboldCpp connects to them and offers their tools to KoboldAI Lite and other clients, which let the model call them. Danger A `command` MCP server is a program that runs on your computer with the same access as KoboldCpp. Only add servers you trust. 1. Write an `mcp.json` file (see below). 2. In the launcher, open the **Loaded Files** tab and select it in **MCP JSON:** (`--mcpfile`). 3. Click **Launch**. 4. In KoboldAI Lite, open **Settings** > **Tools** and tick **Enable Toolcalling** and **Include KoboldCpp MCP Bridge** under **MCP Tool Calling**. Lite calls tools only in **Instruct Mode**. It works without **Use Jinja** (`--jinja`); KoboldCpp then uses its own universal tool calling. With **Jinja for Tools** (`--jinjatools`), the model's chat template handles tool calls instead. Use a model that is good at tool calling, for example [Qwen3-VL-8B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-GGUF). ### The mcp.json format KoboldCpp reads the format from Claude Desktop (`mcpServers`) and from VS Code (`servers`). Each server is either a command that KoboldCpp starts, or a URL. In this example, `files` gives the model read and write access to a folder named `sandbox` next to `mcp.json` (create it first). It needs [Node.js](https://nodejs.org) for `npx`. `my-web-tool` shows the URL form; replace it with a real server or remove it. mcp.json ```json { "mcpServers": { "files": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "sandbox"], "env": {} }, "my-web-tool": { "url": "https://example.com/mcp", "headers": {} } } } ``` * `command` servers start in the folder that contains `mcp.json`. * If one server fails to connect, the others still load. * `--mcpfile` also accepts a URL to a JSON file. ### Where the tools are available KoboldCpp serves all connected tools at `POST /mcp` (JSON-RPC: `initialize`, `tools/list`, `tools/call`). With `--password` set, `/mcp` needs the password. * **KoboldAI Lite** uses them through **Include KoboldCpp MCP Bridge**. Lite can also connect to other MCP servers itself under **MCP Server URLs**. * The [KoboldCpp Agent](https://koboldcpp.net/docs/features/agent/) adds them to its own tools. * The llama.cpp web UI at `/lcpp/` has its own MCP support. ## Advanced * `--nocertify` turns off certificate checks for all outgoing connections, not only web search. This is insecure: others can intercept or change the traffic. Use it only as a last resort if searches fail with certificate errors. * `--mcpfile` alone counts as a model, so KoboldCpp can start with only MCP tools and no text model. * In Lite, **Automatically Execute Tools** runs tool calls without asking first. ## Related * [KoboldCpp Agent](https://koboldcpp.net/docs/features/agent/) * [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/) * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) # Apple Silicon > How KoboldCpp uses Metal on M-series Macs, what GPU layers mean on macOS, and the CPU-only failsafe mode. The Mac build, `koboldcpp-mac-arm64`, is for Apple Silicon (M-series) Macs. It uses the GPU through **Metal** automatically; there is no backend to choose. For download and first start, see [macOS](https://koboldcpp.net/docs/install/macos/). Intel Macs have no ready-made file and must [build from source](https://koboldcpp.net/docs/install/from-source/#macos). ## GPU layers on macOS On macOS, **GPU Layers:** `-1` (the default) puts **all** layers on the GPU. The console prints: ```text MacOS detected: Auto GPU layers set to maximum ``` * Autofit does not switch on by itself on macOS. KoboldCpp does not check whether the model fits; pick a model and context that fit your Mac's memory. See [How much memory a model needs](https://koboldcpp.net/docs/models/memory/). * To keep part of the model off the GPU, set **GPU Layers:** to a lower number. * `Unable to determine GPU Memory` and `Unable to determine available RAM` in the console are expected on a Mac. When the launcher opens, it can also print `Unable to detect VRAM.`. * On macOS, **Use CPU** (`--usecpu`) still puts all layers on the GPU. To run on the CPU only, set **GPU Layers:** to `0` (`--gpulayers 0`), or use `--failsafe`. ## Failsafe mode (CPU only) `--failsafe` switches to a CPU-only library that uses Apple's Accelerate framework instead of Metal: Terminal ```sh ./koboldcpp-mac-arm64 --failsafe ``` ## Vision models With Metal, the vision projectors of Qwen2-VL and Gemma 3 always run on the CPU, whatever **V.Force CPU** (`--mmprojcpu`) is set to. See [Vision](https://koboldcpp.net/docs/features/vision/). ## Related * [macOS](https://koboldcpp.net/docs/install/macos/) * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/) # GPU backends: CUDA, Vulkan, ROCm, Metal, CPU > CUDA, Vulkan, ROCm, Metal and CPU in KoboldCpp, which release file contains which, and how KoboldCpp picks a backend automatically. The backend decides where the model runs: on an NVIDIA, AMD, Intel or Apple GPU, or on the processor alone. You choose it with **Backend:** on the **Quick Launch** tab, or with a flag. If you don't choose, KoboldCpp picks one for you. | Backend | Launcher | Flag | For | | -------------- | ---------------------- | ------------- | ---------------------------------------------------- | | CUDA | **Use CUDA** | `--usecuda` | NVIDIA graphics cards | | Vulkan | **Use Vulkan** | `--usevulkan` | Any graphics card with Vulkan: NVIDIA, AMD, Intel | | ROCm (hipBLAS) | **Use hipBLAS (ROCm)** | `--usecuda` | AMD graphics cards, only in the ROCm build for Linux | | Metal | automatic | none | Apple Silicon Macs | | CPU | **Use CPU** | `--usecpu` | No graphics card, or to leave it unused | The launcher's tooltip sums it up: "CUDA runs on Nvidia GPUs, and is much faster. Vulkan works on all GPUs but is somewhat slower." On an RTX 3090 with Qwen3-VL-8B and a prompt of about 1,000 tokens, CUDA processed the prompt about 16 times as fast as Vulkan (6603 vs 414 tokens per second). Generation was closer: 82.0 vs 71.5 tokens per second. Old-processor variants (**Use CPU (Old CPU)**, **Use Vulkan (Old CPU)**, **Use Vulkan (Older CPU)**, **Failsafe Mode (Older CPU)**) are covered in [Old PCs and CPU-only](https://koboldcpp.net/docs/hardware/old-and-cpu-only/). ## Which file has which backend The launcher only lists the backends your file contains. | File | CUDA | Vulkan | ROCm | Metal | CPU | | ---------------------------------------------------- | ------- | ------ | ---- | ----- | --- | | `koboldcpp.exe`, `koboldcpp-linux-x64` | CUDA 12 | yes | | | yes | | `koboldcpp-nocuda.exe`, `koboldcpp-linux-x64-nocuda` | | yes | | | yes | | `koboldcpp-oldpc.exe`, `koboldcpp-linux-x64-oldpc` | CUDA 11 | yes | | | yes | | `koboldcpp-linux-x64-rocm` (rocm-rolling) | | yes | yes | | yes | | `koboldcpp-mac-arm64` | | | | yes | yes | * **NVIDIA:** the main file, with **Use CUDA**. * **AMD:** start with **Use Vulkan** in the nocuda file. The ROCm build for Linux is very experimental. * **Intel:** **Use Vulkan** in the nocuda file. See [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) for all files and their CPU requirements. ## Automatic selection If you set no backend, KoboldCpp picks one at startup and prints which: ```text Auto Selected CUDA Backend (flag=0) ``` It checks in this order: 1. **CUDA or ROCm**, if all of these are true: * the file contains CUDA or hipBLAS; * `nvidia-smi` (or, for AMD, `rocminfo`) finds a GPU; * the detected VRAM is more than 3.5 GB (3,500,000,000 bytes); * the processor has AVX2 (AVX is enough in the oldpc builds). 2. **Vulkan**, if `vulkaninfo` reports a **discrete** graphics card and the file contains Vulkan. 3. **CPU** otherwise ("Auto Selected Default Backend"). Consequences: * **Vulkan is picked automatically only for a discrete graphics card.** To use an integrated GPU, choose **Use Vulkan** yourself. * **NVIDIA cards with 3.5 GB of VRAM or less** are not auto-selected for CUDA; KoboldCpp falls through to Vulkan or the CPU. Choose **Use CUDA** yourself if you want it. * **AMD on Linux:** with `vulkaninfo` installed and no `rocminfo`, the nocuda file picks Vulkan. Without `vulkaninfo`, it does not find the card and runs on the CPU (both checked with a Radeon RX 7600 XT). * If `nvidia-smi`, `rocminfo` and `vulkaninfo` are all missing or fail, KoboldCpp prints "Unable to detect VRAM." and uses the CPU. Install your GPU driver's tools, or choose the backend yourself. * If the processor lacks AVX2 or AVX, KoboldCpp switches to the matching old-CPU mode. See [Old PCs and CPU-only](https://koboldcpp.net/docs/hardware/old-and-cpu-only/). * Automatic selection is skipped when you set **GPU Layers:** to `0` (`--gpulayers 0`). KoboldCpp then runs on the CPU, even with a GPU present. * On macOS, Metal is used without this check. The launcher makes the same choice when it opens, as long as you haven't changed **Backend:** yourself. A template (`.kcppt`) also lets KoboldCpp choose, unless you pass `--usecuda` or `--usevulkan`. ## Choosing a GPU **GPU ID:** next to the backend selects one GPU or **All**. The name of the selected GPU is shown in yellow. IDs start at 0. On the command line, add the ID after the backend flag (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --usecuda 0 --model mymodel.gguf koboldcpp --usevulkan 1 --model mymodel.gguf ``` Without a number, all GPUs are used. For several GPUs, see [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/). ## CUDA * `--usecuda` accepts a GPU ID from 0 to 3. * **Use MMQ** (on by default) uses dedicated kernels for prompt processing instead of cuBLAS. Turn it off with `--nommq`. It only affects CUDA and ROCm. * The first start on a new card can take a few minutes: "Initializing CUDA/HIP, please wait, the following step may take a few minutes (only for first launch)". Later starts are faster. * The oldpc builds use CUDA 11 for older NVIDIA cards. See [Release files: CUDA versions](https://koboldcpp.net/docs/install/releases/#advanced-cuda-versions-and-nvidia-cards). ## Vulkan * `--usevulkan` takes one or more device IDs, for example `--usevulkan 0 1`. Without IDs, it uses all devices. * If the environment variable `GGML_VK_VISIBLE_DEVICES` is set, it wins over the IDs given to `--usevulkan`. ## ROCm An official ROCm build for AMD cards on Linux is published under the [rocm-rolling](https://github.com/LostRuins/koboldcpp/releases/tag/rocm-rolling) tag. See [Release files: ROCm build](https://koboldcpp.net/docs/install/releases/#advanced-rocm-build-for-amd-on-linux). In it, **Use hipBLAS (ROCm)** and `--usecuda` select ROCm. KoboldCpp picks ROCm by itself only when `rocminfo` finds the card, so without ROCm installed, select it yourself. If generation is slow with Vulkan on Linux, try the ROCm build. On a Radeon RX 7600 XT with a prompt of about 1,000 tokens, it generated more than three times as fast as Vulkan (Qwen3-VL-8B: 36.7 vs 10.3 tokens per second). There is no official ROCm build for Windows. Use Vulkan there. ## Metal The Mac build uses Metal automatically. See [Apple Silicon](https://koboldcpp.net/docs/hardware/apple-silicon/). ## Advanced: removed backends * **CLBlast** was removed in favor of Vulkan. Use **Use Vulkan** instead. * **OpenBLAS** was removed. The CPU backend no longer needs it. * `--noblas` still works and means the same as `--usecpu`. ## Advanced: selecting devices by name `--device` (**Device Override** on the **Hardware** tab) takes a comma-separated list of llama.cpp device names, for example `Vulkan0,Vulkan1`, and overrides the normal device choice for the text model, TTS and embeddings. CPU names and unknown names are rejected, and then the whole override is ignored. The load log shows the device names, for example `CUDA0` and `CUDA1` for the first two CUDA GPUs, `Vulkan0` for the first Vulkan GPU and `ROCm0` for the first GPU in the ROCm build. Buffers named `CUDA_Host` in the log are in system RAM. ## Related * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/) * [Download KoboldCpp](https://koboldcpp.net/download/) # GPU layers: how many to offload > How KoboldCpp decides how much of a model goes on the GPU, what autofit does, and when to set GPU layers yourself. A model is made of layers. **GPU Layers:** sets how many of them run on the graphics card. The rest runs on the processor from system memory, which is slower. **GPU Layers:** is on the **Quick Launch** and **Hardware** tabs. It appears only when **Backend:** is a GPU backend (**Use CUDA**, **Use Vulkan** or **Use hipBLAS (ROCm)**), and always on macOS. With **Use CPU** it is hidden. See [GPU backends](https://koboldcpp.net/docs/hardware/backends/). | Setting | Launcher | Flag | | ------------------- | ----------------------------- | ---------------- | | Automatic (default) | **GPU Layers:** `-1` or empty | `--gpulayers -1` | | A fixed number | **GPU Layers:** `N` | `--gpulayers N` | | No GPU | **GPU Layers:** `0` | `--gpulayers 0` | `--gpu-layers`, `--n-gpu-layers` and `-ngl` are other names for `--gpulayers`. Next to the field, the launcher shows the model's layer count in yellow, for example "(Auto) (N Total Layers)". ## Automatic: autofit Leave **GPU Layers:** at `-1` unless you have a reason to change it. With a GPU backend, KoboldCpp then uses llama.cpp's **autofit**: it calculates what fits in your VRAM and puts as much of the model on the GPU as possible. The console shows: ```text Auto Recommended GPU Layers: GPU layers is default: Will enable AutoFit for increased estimation accuracy. Autofit Success: 1, Autofit Result: -c -ngl ``` Examples at the default context: | Model | GPU | Autofit Result | VRAM used | | ----------------------------------- | ------------------------ | ------------------ | ----------------- | | Qwen3-VL-8B Q4\_K\_S (4.80 GB file) | Radeon RX 7600 XT, 16 GB | `-c 16512 -ngl -1` | 6813 MiB | | Qwen3-VL-8B Q4\_K\_S | RTX 3090, 24 GB | `-c 16512 -ngl -1` | 7192 MiB | | Qwen3-32B Q4\_K\_M (19.8 GB file) | RTX 3090, 24 GB | `-c 16512 -ngl 64` | 22842 MiB | | Qwen3-32B Q4\_K\_M | 2x RTX 3090 | `-c 16512 -ngl -1` | 11828 + 11888 MiB | Qwen3-32B has 65 layers (64 plus the output layer), so `-ngl 64` on one RTX 3090 leaves one layer on the CPU. * The number after `-ngl` is the number of GPU layers autofit chose; `-1` means all layers. The number after `-c` is the context size plus 128 tokens of headroom. With several GPUs, `-ts` shows the split autofit chose. If the model fits without changes, as in the 2x RTX 3090 example, the line has no `-ts`. * "Auto Recommended GPU Layers" is KoboldCpp's own rough estimate, printed before autofit runs. It is used only if autofit fails (`Autofit Success: 0`). * Autofit takes the context size, other loaded models, the vision projector and a draft model into account. * It keeps 1024 MB of VRAM free on each GPU as a safety margin. `-1` means something different in two cases: * **No GPU backend** (CPU selected, or no GPU found): `-1` becomes `0`. The console prints "No GPU backend found, or could not automatically determine GPU layers. You may prefer to set layers manually." * **macOS:** `-1` puts all layers on the GPU. See [Apple Silicon](https://koboldcpp.net/docs/hardware/apple-silicon/). Autofit does not switch on by itself when you also set **Tensor Split:** (`--tensor_split`), **Override Tensors:** (`--overridetensors`), **MoE CPU Layers:** (`--moecpu`) or **FFN CPU Layers:** (`--ffncpu`). Then only the rough estimate is used, so set **GPU Layers:** yourself. ## Setting layers yourself A number other than `-1` turns autofit off and puts exactly that many layers on the GPU. 1. Start with the automatic setting and note the number after `-ngl` in the "Autofit Result" line. 2. Set **GPU Layers:** to a number. A number at least as high as the model's layer count puts the whole model on the GPU. 3. If loading fails with an out-of-memory error, reduce the number by a few layers and try again. The launcher's tooltip warns: "The auto estimation is often inaccurate! Please set layers yourself for best results!" * `0` runs everything on the CPU. If you set no backend, it also skips automatic backend selection, so the CPU backend loads even when a GPU is present. * `--gpulayers` without a number means **1** layer, not automatic. * With **Use CPU** (`--usecpu`), a layer count is ignored (except on macOS and in [RPC](https://koboldcpp.net/docs/hardware/rpc/) connect mode) and KoboldCpp prints "WARNING: GPU layers is set, but a GPU backend was not selected! GPU will not be used!". ## Force AutoFit **Force AutoFit** on the **Quick Launch** and **Hardware** tabs (`--autofit`) runs autofit no matter what else is set. It hides the **GPU Layers:** field. * It overrides your layer count and tensor split. * It ignores **MoE CPU Layers:**, **FFN CPU Layers:** and **Override Tensors:**, and says so in the console. * The launcher marks it as experimental and "Not recommended for multi model setups". ## Advanced: autofit padding **Autofit Padding (MB):** on the **Hardware** tab (`--autofitpadding`) sets how much VRAM autofit keeps free on the first GPU. The default is 1024. Only works with Force AutoFit The padding is only used when **Force AutoFit** (`--autofit`) is on. When autofit switches on automatically because **GPU Layers:** is `-1`, the padding is reset to 1024 MB. For example (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --model mymodel.gguf --autofit --autofitpadding 2048 ``` The console then shows the reserved amount: "Autofit Reserve Space: N MB". It includes other loaded models on top of the padding. ## Advanced: the rough estimate The fallback estimate is a simple formula based on the file size, the context size, the batch size and the model's layer and head counts. * It keeps at least 1.25 GiB of VRAM free, or 0.5 GiB plus what other programs use, whichever is more. * It warns when other programs use more than 2.5 GiB of VRAM. * With several GPUs, it uses the VRAM of the **smallest** one. * For split GGUF files it is less accurate and says so. * An estimate of 2 layers or fewer becomes 0. ## Related * [How much memory a model needs](https://koboldcpp.net/docs/models/memory/) * [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/) * [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/) # Multiple GPUs > Run one model across several graphics cards in KoboldCpp with CUDA or Vulkan, and control the split, the main GPU and the split mode. KoboldCpp can spread one model over several graphics cards. This works with CUDA and with Vulkan. ## Use all GPUs In the launcher, set **GPU ID:** to **All**: by default the launcher picks one card (with CUDA the first, `0`). On the command line, give the backend flag without a number (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --usecuda --model mymodel.gguf koboldcpp --usevulkan --model mymodel.gguf ``` Leave **GPU Layers:** at `-1`. Autofit then distributes the model over the GPUs by itself. The "Autofit Result" line in the console shows the GPU layers after `-ngl` (`-1` means all) and, if autofit changed the split, the split after `-ts`. See [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/). Qwen3-32B Q4\_K\_M at the default context, prompt of about 1,000 tokens: | GPUs | Autofit Result | VRAM used | Generation (tokens/s) | | ------------ | ------------------------------------ | ----------------- | --------------------- | | One RTX 3090 | `-c 16512 -ngl 64` (64 of 65 layers) | 22842 MiB | 18.9 | | Two RTX 3090 | `-c 16512 -ngl -1` | 11828 + 11888 MiB | 33.5 | ## Use some of the GPUs | Goal | Flag | | ----------------- | ----------------- | | One CUDA GPU only | `--usecuda 1` | | Some Vulkan GPUs | `--usevulkan 0 2` | * `--usecuda` accepts one ID from 0 to 3. Without **Tensor Split:**, KoboldCpp hides all other GPUs from CUDA, so the chosen GPU becomes the only one. The load log then calls it `CUDA0`. * `--usevulkan` accepts several IDs. * The launcher's **GPU ID:** picks one GPU or **All**. * CUDA GPUs are numbered in PCI bus order. On a PC with two RTX 3090, this was the same order `nvidia-smi` shows. ## Tensor split **Tensor Split:** on the **Hardware** tab (`--tensor_split`, `-ts`) sets how much of the model each GPU gets, as proportions in GPU order. Terminal ```sh koboldcpp --usecuda --tensor_split 3 2 --gpulayers 99 --model mymodel.gguf ``` `3 2` gives 60% to GPU 0 and 40% to GPU 1. In the launcher, separate the values with commas or spaces. * With a tensor split, autofit does not switch on by itself. Set **GPU Layers:** yourself. * **Force AutoFit** ignores the tensor split. * With a tensor split, `--usecuda N` does not hide the other GPUs; all of them stay in use. ## Main GPU **Main GPU:** on the **Hardware** tab (`--maingpu`, `-mg`) sets which GPU is the main one (`-1` means default). It has no effect on GGUF models in this version. Use **Tensor Split:** to control how much each GPU gets. ## Split mode **SplitMode:** on the **Hardware** tab (`--splitmode`) sets how the model is divided. | Mode | What it does | | ----------------- | ------------------------------------------------------------------------------------------------------ | | `layer` (default) | Each GPU gets whole layers. | | `tensor` | Tensors are split across the GPUs. Experimental. | | `row` | Removed. KoboldCpp prints "split mode row was removed! Using tensor split instead!" and uses `tensor`. | The old `--usecuda rowsplit` also ends up as `tensor`. Qwen3-32B Q4\_K\_M on two RTX 3090, prompt of about 1,000 tokens: | Split mode | VRAM used | Prompt (tokens/s) | Generation (tokens/s) | | ------------------------ | ----------------- | ----------------- | --------------------- | | `layer` | 11828 + 11888 MiB | 1694 | 33.5 | | `tensor` | 11944 + 11944 MiB | 1313 | 39.4 | | `row` (runs as `tensor`) | 11944 + 11944 MiB | 879 | 40.0 | `tensor` generated faster but processed the prompt slower. With `tensor`, the load log shows both cards as one device: `using device Meta() (Meta()) (unknown id) - 47746 MiB free`. ## Advanced: pipeline parallelism With more than one GPU, KoboldCpp turns on pipeline parallelism automatically when the physical batch size is smaller than the batch size: **Physical Batch Size:** (`--ubatchsize`) below **Batch Size:** (`--batchsize`, default 512). By default both are equal, so it is off. It also needs all layers on the GPUs, the `layer` split mode, the KV cache on the GPUs (no `--lowvram`) and no tensor overrides. Terminal ```sh koboldcpp --usecuda --batchsize 512 --ubatchsize 256 --model mymodel.gguf ``` The old `--pipelineparallel` and `--nopipelineparallel` flags have no effect. With Qwen3-32B Q4\_K\_M on two RTX 3090, `--batchsize 512 --ubatchsize 256` processed 1833 instead of 1694 prompt tokens per second and generated 33.7 instead of 33.5 tokens per second (single runs). ## Advanced: GPUs on other computers To use GPUs in other computers over the network, see [RPC](https://koboldcpp.net/docs/hardware/rpc/). ## Related * [GPU backends](https://koboldcpp.net/docs/hardware/backends/) * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/) # Old PCs and CPU-only > Run KoboldCpp on the processor alone or on older PCs without AVX2 or AVX, and set threads and batch size for CPU use. KoboldCpp runs without a graphics card. Every release file can run on the processor (CPU) alone. It is slower than a GPU, so smaller models and quants work best. See [GGUF and quantization](https://koboldcpp.net/docs/models/gguf-and-quantization/). ## Run on the CPU only Choose **Use CPU** under **Backend:**, or pass `--usecpu` (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --usecpu --model mymodel.gguf ``` On a PC without a supported GPU, KoboldCpp picks the CPU by itself ("Auto Selected Default Backend") and sets **GPU Layers:** to `0`. ## Older processors The main and nocuda builds run at full speed on processors with **AVX2**. For older processors, KoboldCpp has slower compatibility modes: | Launcher backend | Flag | CPU needs | | ----------------------------- | ------------------------ | ---------------------------------- | | **Use CPU** | `--usecpu` | AVX2 | | **Use CPU (Old CPU)** | `--usecpu --noavx2` | AVX | | **Use Vulkan (Old CPU)** | `--usevulkan --noavx2` | AVX | | **Use Vulkan (Older CPU)** | `--usevulkan --failsafe` | SSE3 and SSSE3 (oldpc builds only) | | **Failsafe Mode (Older CPU)** | `--usecpu --failsafe` | Any x86-64 CPU | * `--noavx2` is a slower compatibility mode for processors without AVX2. * `--failsafe` is an "extremely old CPU compatibility mode that should work on all devices". It is much slower and implies `--noavx2`. * `--noavx2` and `--failsafe` take priority over `--usecuda`: with them, CUDA is not loaded. Without a backend flag, KoboldCpp can still pick Vulkan for a discrete GPU; add `--usecpu` to stay on the CPU. * In the launcher, **Failsafe Mode (Older CPU)** also turns off **Use MMAP** and **Direct I/O**. The `--failsafe` flag does not. If KoboldCpp crashes at startup, try `--usecpu --noavx2`, then `--usecpu --failsafe`. ### Automatic detection When you set no backend, KoboldCpp checks your processor and switches to the matching mode by itself: `--noavx2` without AVX2, `--noavx2 --failsafe` without AVX. It reads `/proc/cpuinfo` on Linux and uses a bundled helper on Windows. On other systems (for example ARM) it does not check. In Docker, this detection can be wrong and load the failsafe mode on a capable CPU. Set the backend yourself there. ### oldpc builds The oldpc files (`koboldcpp-oldpc.exe`, `koboldcpp-linux-x64-oldpc`) are built for AVX instead of AVX2 and use CUDA 11. Use them for an older processor, an older NVIDIA card, or when the main build crashes. They are also the only builds with **Use Vulkan (Older CPU)**, for GPU use on processors without AVX. See [Release files and system requirements](https://koboldcpp.net/docs/install/releases/#processor-avx2-avx-no-avx). ## Threads **Threads:** on the **Hardware** tab (`--threads`, `-t`) sets how many CPU threads generate text. Empty or `0` means automatic. The launcher fills in the automatic value for your PC; clear the field to keep it automatic in a config you use on another PC. The automatic value is: * Half of the logical processors, minus one, but at least 3. With 7 or fewer logical processors, exactly half (rounded down). * At most 8 on Windows with an Intel processor, to avoid its efficiency cores. Linux and macOS do not report the processor maker the way KoboldCpp checks it, so the cap does not apply there. * At most 64. For example, a 16-thread processor gets 7 threads. The console shows the result: ```text Threadpool set to 7 threads and 7 blasthreads... ``` **Batch Threads:** (`--blasthreads`) sets the threads for processing the prompt. By default it is the same as **Threads:**. ## Batch size **Batch Size:** on the **Hardware** tab (`--batchsize`) sets how many prompt tokens are processed at once. The default is 512; allowed values are 16 to 4096 in powers of two, or `-1`. * `-1` ("Don't Batch") turns batched processing off but keeps GPU offload. * **Physical Batch Size:** (`--ubatchsize`) defaults to the batch size. ## Measure speed **Run Benchmark** on the **Hardware** tab (`--benchmark`) fills the context with a test prompt, generates text and prints the processing and generation speed, without starting the server. `--benchmark results.csv` also appends the result to a CSV file. Terminal ```sh koboldcpp --model mymodel.gguf --benchmark ``` ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [GPU backends](https://koboldcpp.net/docs/hardware/backends/) * [How much memory a model needs](https://koboldcpp.net/docs/models/memory/) # RPC (GPUs over the network) > Share a GPU from one computer and use it from KoboldCpp on another with RPC host and connect mode, and keep the RPC port off the internet. RPC lets KoboldCpp use GPUs in other computers over the network. One computer shares its devices (**host**); the computer that loads the model uses them (**connect**). Keep RPC on a trusted network The RPC server does not ask for a password. By default it listens on all network interfaces (`0.0.0.0`). Don't expose the RPC port to the internet. Run hosts only on a network you trust, and set `--rpchost` to a specific address where you can. ## Settings The settings are on the **Network** tab, under **RPC Mode:**. | Setting | Launcher | Flag | Default | | ------------------------------------- | ------------------ | -------------- | -------------------------- | | Mode: `disabled`, `connect` or `host` | **RPC Mode:** | `--rpcmode` | `disabled` | | Host: listen address | **RPC Host IP:** | `--rpchost` | `0.0.0.0` (all interfaces) | | Host: port | **RPC Host Port:** | `--rpcport` | `5551` | | Host: devices to share | **RPC Devices:** | `--rpcdevice` | automatic | | Connect: hosts to use | **RPC Endpoints:** | `--rpctargets` | none | ## Share a GPU (host) On the computer with the GPU to share (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --rpcmode host --rpchost 192.168.1.20 --rpcport 5551 ``` Use the computer's own network address for `--rpchost`, or `127.0.0.1` to test on one machine. * Host mode needs no model and starts no web interface or API. It only runs the RPC server and prints "Starting RPC server on …". * It shares all discrete GPUs by default. Without one, it shares other accelerators such as integrated graphics, and without those, the CPU. * `--rpcdevice` shares specific devices by name, for example `Vulkan0`. CPU names are rejected; KoboldCpp then falls back to the automatic choice. * The host prints "Note: It's not advised to expose RPC server to the open internet." ## Use a remote GPU (connect) On the computer that loads the model, list the hosts in `--rpctargets`, separated by commas: Terminal ```sh koboldcpp --rpcmode connect --rpctargets 192.168.1.20:5551,192.168.1.21:5551 --model mymodel.gguf --gpulayers 99 ``` * `--rpctargets` only works with `--rpcmode connect`. Otherwise KoboldCpp exits with "Error: rpctargets can only be used in connect mode". * `--rpctargets` and `--rpcport` can't be used together. * In connect mode, **GPU Layers:** is kept even with **Use CPU** (`--usecpu`). * The connection is made when the text model loads. Other models that use the GPU, such as embedding models, can then use the remote devices too. When it works, the host prints `Accepted client connection`, and the connecting KoboldCpp lists the remote device as `RPC0` with its address: ```text llama_prepare_model_devices: using device RPC0 (192.168.1.20:5551) (unknown id) - 23873 MiB free load_tensors: offloaded 37/37 layers to GPU ``` In a test with an RTX 3090 shared over `127.0.0.1` and a connecting KoboldCpp without its own GPU (`--usecpu`), all layers of Qwen3-VL-8B went to `RPC0`, with or without `--gpulayers 99`. ## Compatibility KoboldCpp's RPC is compatible with llama.cpp's: a llama.cpp `rpc-server` can serve KoboldCpp, and a KoboldCpp host can serve llama.cpp. This compatibility was a breaking change at the time, so older KoboldCpp versions don't work with newer ones. Use the same KoboldCpp release on all computers. ## Related * [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/) * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Remote access](https://koboldcpp.net/docs/api/remote-access/) # Saving VRAM > Fit bigger models or longer contexts in KoboldCpp with KV cache quantization, flash attention, SWA, MoE CPU offload and other memory options. When a model does not fit on your graphics card, these options reduce how much VRAM it needs. | Option | Launcher | Flag | Cost | | --------------------------- | ------------------------------------ | --------------- | ----------------------------------------------- | | Smaller context | **Context Size:** | `--contextsize` | The model keeps less text in mind | | Quantized KV cache | **Quantize KV Cache:** (Context tab) | `--quantkv` | Works best with flash attention (on by default) | | Smaller quant | pick another file | | Some quality | | MoE experts on the CPU | **MoE CPU Layers:** (Context tab) | `--moecpu` | Slower, only for MoE models | | Vision projector on the CPU | **V.Force CPU** (Loaded Files tab) | `--mmprojcpu` | Images are processed on the CPU | | Fewer GPU layers | **GPU Layers:** | `--gpulayers` | Slower; autofit does this for you | | Smaller batch size | **Batch Size:** (Hardware tab) | `--batchsize` | Slower prompt processing | | KV cache in RAM | **No KV offload** (Hardware tab) | `--lowvram` | Much slower | Measured with Qwen3-VL-8B Q4\_K\_S at the default context (16384) on an RTX 3090 (CUDA, KoboldCpp 1.122.1), with a prompt of about 1,000 tokens. VRAM is what `nvidia-smi` showed for the card: | Setting | VRAM | Prompt (tokens/s) | Generation (tokens/s) | | -------------------------------------------------------- | -------- | ----------------- | --------------------- | | Default (all 37 layers, `f16` KV cache, flash attention) | 7192 MiB | 6789 | 86.9 | | `--quantkv q8_0` | 6096 MiB | 5842 | 84.9 | | `--quantkv q4_0` | 5512 MiB | 5807 | 84.0 | | `--gpulayers 30` | 5988 MiB | 3235 | 45.2 | | `--batchsize 256` | 7038 MiB | 4247 | 86.7 | | `--lowvram` | 4860 MiB | 3324 | 38.3 | | `--noflashattention` | 8064 MiB | 5074 | 51.5 | A quantized KV cache saved 1.1 to 1.7 GB here; generation was 2–3% slower and prompt processing about 15% slower. On a Radeon RX 7600 XT (Vulkan) the VRAM savings were similar. See [How much memory a model needs](https://koboldcpp.net/docs/models/memory/) for where the memory goes. ## Quantize the KV cache The KV cache holds the context. **Quantize KV Cache:** on the **Context** tab (`--quantkv`) stores it in a smaller format. The last column is the KV cache of Qwen3-VL-8B at the default context, measured on a Radeon RX 7600 XT. | Value | Size compared with `f16` | Qwen3-VL-8B | | --------------- | ------------------------ | ------------ | | `f16` (default) | 100% | 2340 MiB | | `bf16` | 100% | not measured | | `q8_0` | about 53% | 1243 MiB | | `q5_1` | about 38% | 877.5 MiB | | `q4_0` | about 28% | 658.1 MiB | For example (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --model mymodel.gguf --quantkv q8_0 ``` * It needs flash attention for full effect. Without flash attention, only the K half of the cache is quantized (except `bf16`), and KoboldCpp warns: "Quantized KV was used without flash attention! This is NOT RECOMMENDED! … In some cases, it might even use more VRAM when doing a full offload." * With Qwen3-VL-8B on a Radeon RX 7600 XT, `q8_0` without flash attention used 7947 MiB of VRAM, more than the default `f16` cache with flash attention (6813 MiB), because the compute buffer grew from 337 to 2156.6 MiB. * It works together with [ContextShift](https://koboldcpp.net/docs/settings/context-size/#reusing-context-between-requests). * Old numeric values still work: `0` = `f16`, `1` = `q8_0`, `2` = `q4_0`, `3` = `bf16`. KV cache of Gemma 3 4B at the default context, measured on KoboldCpp 1.122.1 with a Radeon RX 7600 XT. Gemma 3 uses SWA: 5 of its 34 layers keep the whole context, the other 29 keep only 1664 tokens. | `--quantkv` | 5 full-context layers | 29 SWA layers | | --------------- | --------------------- | ------------- | | `f16` (default) | 325 MiB | 188.5 MiB | | `q8_0` | 172.7 MiB | 100.1 MiB | | `q4_0` | 91.4 MiB | 53.0 MiB | ## Flash attention Flash attention is **on by default**. **Use FlashAttention** on the **Quick Launch** and **Hardware** tabs turns it off when unchecked (`--noflashattention`, `-nofa`). Leave it on, especially with a quantized KV cache. With Gemma 3 4B on a Radeon RX 7600 XT, turning flash attention off left the `f16` KV cache the same size and made generation slower. The old `--flashattention` flag has no effect. An old `.kcpps` file with `"flashattention": false` turns flash attention **off**, and one with `"useswa": false` turns SWA off; check these settings when you reuse old config files. ## SWA Some models, such as the Gemma 3 family, use sliding window attention (SWA). KoboldCpp uses it by default, which makes their KV cache much smaller. * **Allow SWA** on the **Context** tab controls it. Uncheck it or pass `--noswa` for a full-size cache. * With SWA on, ContextShift cannot be used. The console says "Note that using SWA Mode cannot be used with Context Shifting!". * **SWA Padding Tokens:** (`--swapadding`) adds room to the SWA cache. More padding lets KoboldCpp rewind further before it has to reprocess the prompt, at the cost of some memory. ## MoE models Mixture-of-Experts (MoE) models have many "expert" weights, of which only a few are used per token. Keeping the experts in system RAM and the rest on the GPU often lets a large MoE model run on a small GPU. Autofit does this by itself when the model does not fit: it keeps all layers on the GPU and moves the expert weights of the last layers to the CPU. For example, Qwen3-30B-A3B at 16k context on a 16 GB Radeon RX 7600 XT (Vulkan, shortened): ```text Autofit Success: 1, Autofit Result: -c 16512 -ngl 49 -ot blk\.25\.ffn_(gate|gate_up|down).*=CPU,blk\.26\.ffn_(up|down|gate_up|gate)_(ch|)exps=CPU,... ``` `-ngl 49` means all layers. The `-ot …=CPU` patterns move the expert weights from layer 25 on to the CPU. **MoE CPU Layers:** on the **Context** tab (`--moecpu N`) keeps the expert weights of the first N layers on the CPU. `--moecpu` without a number keeps all of them there. Terminal ```sh koboldcpp --model my-moe-model.gguf --usecuda --moecpu --gpulayers 99 ``` * With `--moecpu`, autofit does not switch on by itself. Set **GPU Layers:** yourself; a number at least as high as the layer count puts everything that is not an expert on the GPU. * **Force AutoFit** ignores `--moecpu`. * It only takes effect when KoboldCpp uses a GPU besides the CPU. * The value is capped at 200. With Qwen3-30B-A3B Q4\_K\_M at 16k context on a Radeon RX 7600 XT (Vulkan), `--moecpu --gpulayers 99` used 2724 MiB of VRAM instead of 11472 MiB with autofit, and generated 15.1 instead of 17.2 tokens per second. **FFN CPU Layers:** (`--ffncpu N`) does the same for the feed-forward weights of normal (dense) models. **MoE Experts:** (`--moeexperts N`) changes how many experts are used per token. The default follows the model file. This changes the model's output quality and speed. ## KV cache in system RAM **No KV offload** on the **Hardware** tab (`--lowvram`, `-nkvo`) keeps the KV cache in system RAM while the layers run on the GPU. More layers fit, but it is much slower. It works with CUDA and Vulkan. Use it as a last resort. ## Advanced: override tensors **Override Tensors:** on the **Context** tab (`--overridetensors`, `-ot`) places tensors whose names match a pattern on a chosen device, as in llama.cpp: `regex=buffer type`, separated by commas. `--moecpu` and `--ffncpu` are shortcuts that add such patterns. Like them, it stops autofit from switching on by itself, and **Force AutoFit** ignores it. The buffer type is a device name: `CUDA0` or `CPU` with CUDA, `Vulkan0` or `CPU` with Vulkan, `ROCm0` or `CPU` with ROCm. The console lists the accepted names after `Handling Override Tensors for backends:`. An unknown name prints `Unknown Buffer Type: `, and that pattern is ignored. ## Advanced: loading options (mmap, mlock, direct I/O) These change how the model file is read into memory, not how much VRAM it uses. | Option | Launcher | Flag | Effect | | ---------- | ----------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------- | | mmap | **Use MMAP** | `--usemmap` | Maps the file into memory instead of reading it. Off by default. The launcher notes that the model "will not be unloadable". | | mlock | **Use mlock** (Hardware tab) | `--usemlock` | Keeps the model's RAM from being paged out. "Not usually recommended." | | Direct I/O | **Direct I/O** (Hardware tab) | `--usedirectio` | Reads the file with direct I/O on Linux, which may load faster from some drives. Ignored on other systems. | * mmap and direct I/O can't be combined. Direct I/O wins over mlock. * With mmap or direct I/O, the CPU backend does not repack the weights. * The old `--nommap` flag has no effect, since mmap is off by default. With Qwen3-VL-8B and all layers on a Radeon RX 7600 XT, the 334 MiB of weights that stay in RAM were mapped from the file with mmap (`CPU_Mapped` in the log). The process used 504 MB of RAM with mmap and 187 MB with direct I/O. ## Related * [How much memory a model needs](https://koboldcpp.net/docs/models/memory/) * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/) # Install on Android with Termux > Build and run KoboldCpp on an Android phone or tablet with Termux and the official quick setup script. On Android, KoboldCpp runs inside the Termux terminal app and is compiled on the device. An official script does the setup for you. 1. Install [Termux from F-Droid](https://f-droid.org/en/packages/com.termux/). 2. Open Termux and run the setup script: Termux ```sh curl -sSL https://raw.githubusercontent.com/LostRuins/koboldcpp/concedo/android_install.sh | sh ``` Run this way, the script installs KoboldCpp and starts it with a small Gemma3-1B model. 3. When it has loaded, open `http://localhost:5001` in your phone's browser. ## Choosing a different model Download the script and run it yourself to get a menu: Termux ```sh curl -sSLO https://raw.githubusercontent.com/LostRuins/koboldcpp/concedo/android_install.sh chmod +x android_install.sh ./android_install.sh ``` | Option | What it does | | ------ | ----------------------------------------------- | | 1 | Install and launch with Gemma3-1B | | 2 | Install without a model | | 3 | Download a GGUF model from a URL | | 4 | Load a GGUF model that is already on the device | | 5 | Exit | Options 3 and 4 need an existing install. Run them from the `koboldcpp` folder, which has its own copy of the script. Option 4 only lists `.gguf` files in that folder. Termux ```sh cd koboldcpp bash android_install.sh ``` Use a small model. See [Choose a model](https://koboldcpp.net/getting-started/model/). ## What the script does 1. Stops if it is not running on Android. 2. If `wget`, `git` or `python` is missing, runs `apt update`, installs `openssl`, `wget`, `git` and `python`, and runs `pkg upgrade`. 3. Clones the KoboldCpp repository, unless it finds an existing copy. 4. Compiles it with `make -j 2`, unless a build already exists. 5. Starts it with `python koboldcpp.py --model `. ## Updating Running the script again does **not** rebuild KoboldCpp: it skips compiling when a build already exists. To update, pull the new source and compile it again: Termux ```sh cd koboldcpp git pull make ``` ## Advanced: manual setup Termux ```sh pkg update pkg upgrade pkg install openssl wget git python clang make git clone https://github.com/LostRuins/koboldcpp.git cd koboldcpp make python koboldcpp.py --model mymodel.gguf ``` Download a small GGUF model into the folder first, or pass a model URL to `--model`. Then open `http://localhost:5001`. * **Packages fail to install:** run `termux-change-repo` and pick another mirror. * **`Illegal instruction` on your device:** rebuild with `make clean`, then `make LLAMA_PORTABLE=1`, which turns off tuning for your specific processor. * **GPU:** these instructions cover CPU builds. GPU acceleration depends on the device and its drivers. More: [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/#android-illegal-instruction). ## Related * [Build from source](https://koboldcpp.net/docs/install/from-source/) * [Updating](https://koboldcpp.net/docs/install/updating/) # Run on Google Colab or Docker > Run KoboldCpp in the cloud with the official Google Colab notebook or the official Docker image, and its environment variables. Two official ways run KoboldCpp without installing it on your own computer: a Google Colab notebook for trying it in the browser, and a Docker image for cloud GPU servers. ## Google Colab The [official Colab notebook](https://colab.research.google.com/github/LostRuins/koboldcpp/blob/concedo/colab.ipynb) runs KoboldCpp on a cloud GPU from Google. The short link is `https://koboldai.org/colabcpp`. 1. Open the notebook and pick a model: choose a template from the dropdown, or tick the model options yourself. 2. Press the two **Play** buttons. 3. Open the Cloudflare URL shown at the end. KoboldAI Lite runs there. * Keep the notebook page open, and check it now and then for captchas. * On a phone, also run the silent-audio cell so the session stays alive. * If Colab gives you no GPU, the notebook stops with "Colab did not give you a GPU due to usage limits". * The notebook always downloads the latest release. * You are responsible for following Google Colab's terms of use. ### Colab options | Option | What it does | | ------------------------------- | ---------------------------------------------------- | | Google Drive save storage | Keeps your saves in your Google Drive. | | LocalTunnel | A fallback when the Cloudflare tunnel does not work. | | Delete cached models on restart | On by default. | ## Docker (experts) The official image is [`koboldai/koboldcpp`](https://hub.docker.com/r/koboldai/koboldcpp) on Docker Hub. It is intended for experts, mainly for people who rent cloud GPUs. For KoboldCpp on your own computer, use the [normal downloads](https://koboldcpp.net/download/) instead. * It runs x86-64 Ubuntu inside and expects an NVIDIA or AMD GPU. * It may perform poorly on some Windows and macOS machines, and may fail outright on ARM. * Its AVX detection is crude. It can fall back to the failsafe libraries, which are extremely slow. * By default it downloads the latest KoboldCpp for your GPU when it starts; for AMD GPUs that is the experimental ROCm build. The image itself only changes when its Docker setup changes. ### Environment variables | Variable | Value | | --------------- | ---------------------------------------------------------------------------------------------------- | | `KCPP_MODEL` | Download URL of the text model. For a model split into several files, separate the URLs with commas. | | `KCPP_IMGMODEL` | Download URL of the image generation model. | | `KCPP_MMPROJ` | Download URL of the vision projector (mmproj). | | `KCPP_ARGS` | Extra KoboldCpp flags, for example `--lora` with a mounted file. | ### Minimal example The image prints this example: Terminal ```sh docker run --rm -e KCPP_DONT_TUNNEL=true -p 5001:5001 -it koboldai/koboldcpp ``` * `-p 5001:5001` makes KoboldCpp reachable on port 5001. * `KCPP_DONT_TUNNEL=true` turns off the public Cloudflare tunnel. The image opens it by default on purpose, because it is made for cloud GPU rentals. * If you set neither a model variable nor `KCPP_ARGS`, it loads a tiny demo model after one minute. * For an NVIDIA GPU, add `--gpus all`. This needs the NVIDIA Container Toolkit on the host. ### Compose example The image prints its official Docker Compose example: Terminal ```sh docker run --rm -it koboldai/koboldcpp compose-example ``` It turns the tunnel off, and shows how to pass an NVIDIA GPU, or an AMD or Intel GPU through `/dev/dri`. It also turns on admin mode with the password `ChangeMe`; change it before use. ## Hosted GPU services KoboldCpp has official short links for two GPU rental services: * RunPod: `https://koboldai.org/runpodcpp` * SimplePod: `https://koboldai.org/simplepod` ## Advanced: unofficial Docker images Community Docker images by korewaChino and noneabove1182 exist. They are unofficial and get no official support. ## Related * [Updating Colab and Docker](https://koboldcpp.net/docs/install/updating/#colab-and-docker) * [Staying safe](https://koboldcpp.net/docs/install/staying-safe/) * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) # Build from source > Compile KoboldCpp yourself on Linux, macOS or Windows, with make flags, koboldcpp.sh and the KCPP_PORTABLE=1 change. Most people don't need to build KoboldCpp: the [release files](https://koboldcpp.net/docs/install/releases/) are ready to run. Build it yourself for an Intel Mac, ARM Linux, Android, or to change how it is compiled. There is no `pip install koboldcpp`; KoboldCpp is not on PyPI. ## Linux Terminal ```sh git clone https://github.com/LostRuins/koboldcpp.git cd koboldcpp make python3 koboldcpp.py --model /path/to/model.gguf ``` ### `make` flags | Flag | Effect | | ------------------ | ------------------------------------------------------------------------------- | | `LLAMA_VULKAN=1` | Build the Vulkan backend. | | `LLAMA_CUBLAS=1` | Build the CUDA backend (NVIDIA). | | `LLAMA_HIPBLAS=1` | Build the ROCm backend (AMD). | | `LLAMA_PORTABLE=1` | Build for other machines, not only your own. | | `LLAMA_NOAVX2=1` | Together with `LLAMA_PORTABLE=1`: build without AVX2, as the oldpc releases do. | Without `LLAMA_PORTABLE=1`, the build is optimized for your own processor (`-march=native` on x86, `-mcpu=native` on ARM) and may not run on other machines. On ARM, `LLAMA_PORTABLE=1` turns off `-mcpu=native`, so the compiler targets its default architecture. If you start `koboldcpp.py` before running `make`, it stops with `No Backends Available!`. ### Python packages `requirements.txt` lists the Python packages KoboldCpp uses. Install them with `python -m pip install -r requirements.txt`. Optional packages include `customtkinter` and Tk for the launcher, `jinja2` for chat templates and `psutil` for system information. Tk may need a separate package from your operating system. Without the launcher packages, run KoboldCpp from the command line. `koboldcpp.sh` manages its own dependencies. ## macOS Terminal ```sh git clone https://github.com/LostRuins/koboldcpp.git cd koboldcpp make LLAMA_METAL=1 python3 koboldcpp.py --model /path/to/model.gguf ``` Plain `make` also works. This is the way to run KoboldCpp on an Intel Mac. ## Windows 1. Install [w64devkit](https://github.com/skeeto/w64devkit/releases), the 64-bit version: `w64devkit-x64-….7z.exe` in current releases, or `w64devkit-1.22.0.zip`, which the official builds use. The 32-bit versions (x86, i686) conflict with the bundled libraries. 2. Clone the repository (`git clone https://github.com/LostRuins/koboldcpp.git`). In the w64devkit shell, go to the `koboldcpp` folder and run `make`, or `make LLAMA_VULKAN=1` for Vulkan. 3. To package an exe, build with `make LLAMA_VULKAN=1 LLAMA_PORTABLE=1` (the script bundles all of those libraries), install PyInstaller and the packages in `requirements.txt` with `pip`, then run `make_pyinstaller.bat`. ### CUDA on Windows CUDA builds on Windows need Visual Studio with its C++ and CMake tools, and the CUDA Toolkit. The official builds use Visual Studio 2019 and CUDA 12.1. In the `koboldcpp` folder, run: Command Prompt ```sh mkdir build cd build cmake .. -DLLAMA_CUBLAS=ON cmake --build . --config Release ``` The build copies `koboldcpp_cublas.dll` into the `koboldcpp` folder, next to `koboldcpp.py`. To package an exe with CUDA, also copy the matching `cublas`, `cublasLt` and `cudart` libraries from the CUDA Toolkit used for the build there (for CUDA 12: `cublas64_12.dll`, `cublasLt64_12.dll` and `cudart64_12.dll` from its `bin` folder), then run `make_pyinstaller_cuda.bat`. ## `koboldcpp.sh` (Linux) `koboldcpp.sh` fetches all build dependencies into a local micromamba/conda environment, builds KoboldCpp and runs it. It works on x86\_64 and aarch64 and needs `curl` and `bzip2`. | Command | What it does | | ------------------------ | ----------------------------------------------------------------------------------------------- | | `./koboldcpp.sh` | Opens the launcher (needs X11). | | `./koboldcpp.sh --help` | Lists the flags. Any argument other than `rebuild` or `dist` is passed to `koboldcpp.py`. | | `./koboldcpp.sh rebuild` | Recreates the environment and recompiles. Run it after updating. | | `./koboldcpp.sh dist` | Builds your own single-file binary. It only runs on distributions equal to or newer than yours. | The script picks the backend itself: with an NVIDIA GPU it uses CUDA 11.4 or 12.1 depending on what `nvidia-smi` reports, and ROCm when it finds ROCm on the system. Override this with `KCPP_CUDA=` or `KCPP_CUDA=rocm`. ### `KCPP_PORTABLE=1` (changed in v1.122) Since v1.122, `koboldcpp.sh` optimizes for the machine it runs on. To build binaries that run on other systems, set `KCPP_PORTABLE=1`: Terminal ```sh KCPP_PORTABLE=1 ./koboldcpp.sh dist ``` Without it, `dist` warns "THIS BINARY WILL ONLY RUN ON YOUR SYSTEM!!". Portable mode is forced when no NVIDIA GPU is visible (except for ROCm builds), and for x64 builds with `NOAVX1` or `NOAVX2`. The script also reads `NOAVX2`, `NOAVX1`, `ARCHES_CU11`, `ARCHES_CU12`, `ARCHES_CU13` and `KCPP_APPEND`; see the top of `koboldcpp.sh`. ## Other systems * **Android:** see [Android (Termux)](https://koboldcpp.net/docs/install/android/). * **OpenBSD:** build with `gmake`. The [README](https://github.com/LostRuins/koboldcpp) has OpenBSD notes on Vulkan and `ulimit -d`. ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [Updating](https://koboldcpp.net/docs/install/updating/) # Install on Linux, desktop or headless > Download KoboldCpp on Linux, make it executable and run it, with notes on the launcher, file pickers and headless servers. KoboldCpp for Linux is a single file. There is no installer and no package to add. 1. Pick your file. See [Download KoboldCpp](https://koboldcpp.net/download/) if you are unsure. | Your PC | File | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | | NVIDIA graphics card | [`koboldcpp-linux-x64`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64) | | AMD, Intel or no graphics card | [`koboldcpp-linux-x64-nocuda`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64-nocuda) | | Older processor or older NVIDIA card | [`koboldcpp-linux-x64-oldpc`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64-oldpc) | 2. Download it with your browser. It usually lands in `~/Downloads`. 3. In a terminal, go to the folder with the file, make it executable and run it. This example uses the NVIDIA file; replace the name with yours: Terminal ```sh cd ~/Downloads chmod +x koboldcpp-linux-x64 ./koboldcpp-linux-x64 ``` The launcher opens. Continue with [Choose a model](https://koboldcpp.net/getting-started/model/). To download from the terminal instead, for example on a server: Terminal ```sh curl -fLO https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64 ``` "Permission denied" means the file is not executable yet; run `chmod +x` on it. If the main build fails on an older system, try `koboldcpp-linux-x64-oldpc`, the build with the greatest compatibility. ## Programs the launcher uses | Program | Needed for | | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `yad` or `zenity` | A better file picker. `yad` is used if both are installed; without either, the launcher uses its built-in picker. | | `vulkan-tools` | Detecting your graphics card and its memory with `vulkaninfo`. NVIDIA cards are also detected with `nvidia-smi`, and AMD cards with `rocminfo` if ROCm is installed. If none of these works, you see "Unable to detect VRAM." | | `xdg-open` | Opening the browser after the model has loaded. | ## Launcher problems * **The file picker does nothing (often on Wayland).** Install `yad`, or turn on **Use Classic FilePicker** on the launcher's **Extra** tab. The console may show `Zenity/YAD sanity check failed`. * **"Warning, GUI failed to start".** The launcher could not open a window, for example because there is no display. KoboldCpp then tells you to use the command line. See [Headless use](#headless-use). * **You want to see the console output.** **Spawn Terminal** on the **Extra** tab opens an `xterm` window that mirrors it. More: [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/#linux-the-file-picker-does-nothing). ## AMD graphics cards Start with the **Vulkan** backend in `koboldcpp-linux-x64-nocuda`. Install `vulkan-tools` first, so the launcher can detect your card and select **Use Vulkan** by itself. Without it, KoboldCpp does not find the card and runs on the CPU. If generation is slow with Vulkan, try the experimental official ROCm build. It does not need ROCm installed. See [ROCm build for AMD on Linux](https://koboldcpp.net/docs/install/releases/#advanced-rocm-build-for-amd-on-linux) and [GPU backends: ROCm](https://koboldcpp.net/docs/hardware/backends/#rocm). ## Headless use With a model on the command line, KoboldCpp skips the launcher and needs no display: Terminal ```sh ./koboldcpp-linux-x64 --model mymodel.gguf ``` * `./koboldcpp-linux-x64 --help` lists all flags. * `--config mysettings.kcpps` starts with a saved configuration. A config that contains a model also skips the launcher. * `--skiplauncher` overrides `--showgui`, including a `showgui` saved in a config. It does not pick a model: without a model from the command line or a config, KoboldCpp exits with an error. * By default KoboldCpp listens on all network interfaces, so other devices on your network can reach it. Add `--host 127.0.0.1` to allow connections from this machine only. More: [Command line](https://koboldcpp.net/docs/settings/command-line/), [Remote access](https://koboldcpp.net/docs/api/remote-access/), [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Advanced: ARM and other systems There is no ready-made file for ARM Linux. [Build from source](https://koboldcpp.net/docs/install/from-source/); `koboldcpp.sh` supports aarch64. The x64 files need glibc 2.29 or newer, for example Ubuntu 20.04 or newer. `ldd --version` shows your glibc version. ## Advanced: unofficial packages The community maintains packages that are unofficial and get no official support: `koboldcpp-cuda` and `koboldcpp-hipblas` in the AUR, and `koboldcpp` in Nixpkgs. ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [Updating](https://koboldcpp.net/docs/install/updating/) * [Build from source](https://koboldcpp.net/docs/install/from-source/) # Install on macOS (Apple Silicon) > Run KoboldCpp on an Apple Silicon Mac, allow it in Privacy & Security, and what to do on an Intel Mac. KoboldCpp has a ready-made file for Macs with Apple Silicon (M-series) and macOS 14 (Sonoma) or newer. It is a single file that you run from Terminal. 1. Download [`koboldcpp-mac-arm64`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-mac-arm64). 2. In Terminal, go to the folder with the file, make it executable and run it: Terminal ```sh cd ~/Downloads chmod +x koboldcpp-mac-arm64 ./koboldcpp-mac-arm64 ``` 3. The first time, macOS shows "Apple could not verify “koboldcpp-mac-arm64” is free of malware…". Click **Done**, not **Move to Trash**. Open **System Settings → Privacy & Security**, scroll down to **Security** and click **Open Anyway** next to the message about `koboldcpp-mac-arm64`. Run the file again and confirm. After that, it starts without asking. To skip the prompt, remove the download mark in Terminal before the first start: Terminal ```sh xattr -d com.apple.quarantine koboldcpp-mac-arm64 ``` The launcher opens. Continue with [Choose a model](https://koboldcpp.net/getting-started/model/). [Apple's guide](https://support.apple.com/en-us/102445) and a [video guide](https://youtube.com/watch?v=NOW5dyA_JgY) show how to allow the file. ## GPU (Metal) The Mac build uses Metal on the GPU automatically. * With **GPU Layers** at -1 (the default), all layers go to the GPU. The console prints: ```text MacOS detected: Auto GPU layers set to maximum ``` * `Unable to determine GPU Memory` and `Unable to determine available RAM` in the console are expected on Apple Silicon and not a problem. When the launcher opens, it can also print `Unable to detect VRAM.`. More: [Apple Silicon](https://koboldcpp.net/docs/hardware/apple-silicon/). ## Advanced: failsafe mode (no Metal) `--failsafe` switches to a CPU-only library that uses Apple's Accelerate framework instead of Metal: Terminal ```sh ./koboldcpp-mac-arm64 --failsafe ``` ## Intel Macs There is no ready-made file for Intel (x86) Macs. Clone the repository and compile it yourself; see [Build from source](https://koboldcpp.net/docs/install/from-source/#macos). Intel Macs are poorly supported. ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [Updating](https://koboldcpp.net/docs/install/updating/) # Release files and system requirements > Every file in a KoboldCpp release, which system and GPU it is for, and the CPU and CUDA requirements of each build. Each release on GitHub contains one ready-to-run file per system and GPU type. You need **one** of them. For a quick pick, see [Download KoboldCpp](https://koboldcpp.net/download/). All files come from the [latest release](https://github.com/LostRuins/koboldcpp/releases/latest). The **Source code** archives that GitHub adds to every release are not programs; don't download them to run KoboldCpp. ## The files | File | System | GPU backends | CPU | | ---------------------------- | -------------------- | --------------- | ----------------------------- | | `koboldcpp.exe` | Windows x64 | CUDA 12, Vulkan | AVX2 (old-CPU modes included) | | `koboldcpp-nocuda.exe` | Windows x64 | Vulkan | AVX2 (old-CPU modes included) | | `koboldcpp-oldpc.exe` | Windows x64 | CUDA 11, Vulkan | AVX1 (no-AVX modes included) | | `koboldcpp-linux-x64` | Linux x64 | CUDA 12, Vulkan | AVX2 (old-CPU modes included) | | `koboldcpp-linux-x64-nocuda` | Linux x64 | Vulkan | AVX2 (old-CPU modes included) | | `koboldcpp-linux-x64-oldpc` | Linux x64 | CUDA 11, Vulkan | AVX1 (no-AVX modes included) | | `koboldcpp-mac-arm64` | macOS, Apple Silicon | Metal | not applicable | Every file can also run on the CPU alone. * **Main builds** (`koboldcpp.exe`, `koboldcpp-linux-x64`): for NVIDIA graphics cards on newer PCs. * **nocuda builds**: the same without CUDA, and much smaller. For AMD or Intel graphics, no graphics card, or when you don't need CUDA. AMD users should try the **Vulkan** backend in this build first. * **oldpc builds**: CUDA 11 and AVX1, for older processors and older NVIDIA cards, or when the main build crashes. They are also the only builds with GPU support (Vulkan) on processors without AVX. * **Mac build**: for Apple Silicon (M-series) Macs. Intel Macs have no ready-made file; see [macOS](https://koboldcpp.net/docs/install/macos/). There are no ready-made files for Windows on ARM or Linux on ARM. On ARM Linux, [build from source](https://koboldcpp.net/docs/install/from-source/). ## System requirements KoboldCpp has no fixed RAM or VRAM minimum; what you need depends on the model. The launcher's newbie templates give a rough guide: LowSpec recommends 6 GB VRAM, MidSpec 12 GB, HighSpec 24 GB. See [Choose a model](https://koboldcpp.net/getting-started/model/). More: [How much memory a model needs](https://koboldcpp.net/docs/models/memory/). ### Processor The main and nocuda builds run at full speed on processors with **AVX2**. For older processors, every x64 build includes slower compatibility modes, and KoboldCpp usually switches to them automatically when it detects that your CPU lacks AVX2 or AVX. See [Advanced: processor modes](#processor-avx2-avx-no-avx). ### Operating system * **Windows:** x64. Windows 7 is not recommended; see [Windows 7](https://koboldcpp.net/docs/install/windows/#advanced-windows-7). * **Linux:** x64 with glibc 2.29 or newer, for example Ubuntu 20.04 or newer. `ldd --version` shows your glibc version. * **macOS:** Apple Silicon only, macOS 14 (Sonoma) or newer. ## Advanced: processor modes You can pick a mode yourself, in the launcher's backend list or with a flag: | Launcher backend | Flag | CPU needs | In builds | | ----------------------------- | ------------------------ | ------------------------- | -------------- | | **Use CUDA** | `--usecuda` | AVX2 (main), AVX1 (oldpc) | main, oldpc | | **Use Vulkan** | `--usevulkan` | AVX2 | main, nocuda | | **Use CPU** | `--usecpu` | AVX2 | main, nocuda | | **Use CPU (Old CPU)** | `--noavx2` | AVX1 | all x64 builds | | **Use Vulkan (Old CPU)** | `--usevulkan --noavx2` | AVX1 | all x64 builds | | **Use Vulkan (Older CPU)** | `--usevulkan --failsafe` | SSE3 and SSSE3 | oldpc only | | **Failsafe Mode (Older CPU)** | `--failsafe` | any x86-64 CPU | all x64 builds | The launcher only lists backends that your build contains. * `--noavx2` is a slower compatibility mode for processors without AVX2. * `--failsafe` is an extremely slow mode that runs on any x86-64 processor. It implies `--noavx2`. Without `--usevulkan` it uses no GPU. * On a processor with no AVX at all that should still use a graphics card, use an oldpc build and select **Use Vulkan (Older CPU)** yourself. The launcher may pick **Use Vulkan (Old CPU)**, which needs AVX. More: [Old PCs and CPU-only](https://koboldcpp.net/docs/hardware/old-and-cpu-only/). ## Advanced: CUDA versions and NVIDIA cards | Build | CUDA toolkit | Minimum NVIDIA driver | Compute capability compiled | | ---------------------------------------------------------- | ------------ | ----------------------------------- | --------------------------- | | Main (`koboldcpp.exe`, `koboldcpp-linux-x64`) | 12.1 | 531.14 (Windows), 530.30.02 (Linux) | 5.0, 6.1, 7.5, 8.0 | | oldpc (`koboldcpp-oldpc.exe`, `koboldcpp-linux-x64-oldpc`) | 11.4 | 472.50 (Windows), 470.42.01 (Linux) | 3.5, 5.0, 6.1, 7.5 | * The code is compiled as PTX, so newer cards compile it on first launch. That first start prints "Initializing CUDA/HIP, please wait, the following step may take a few minutes (only for first launch)". * Kepler cards with compute capability 3.5 or higher (for example K40 and K80) are only covered by the oldpc builds. Compute capability 3.0 cards are not covered by any build; try Vulkan instead. * If `nvidia-smi` reports "CUDA Version: 11.x" or "12.0", use the oldpc build, or update the driver. ## Advanced: the Mac build `koboldcpp-mac-arm64` uses Metal. It also contains a CPU-only fallback that uses Accelerate without Metal; turn it on with `--failsafe`. See [macOS](https://koboldcpp.net/docs/install/macos/). ## Advanced: rolling builds [Rolling builds](https://github.com/LostRuins/koboldcpp/releases/tag/rolling) are experimental pre-release builds that are updated automatically. They use the same file names as a normal release. * They may be unstable, and sometimes don't start at all. * They can support a new model architecture before the next release does. * For stability and proper support, use the official releases. ## Advanced: ROCm build for AMD on Linux An official ROCm build for AMD graphics cards on Linux, `koboldcpp-linux-x64-rocm`, is published under the [rocm-rolling](https://github.com/LostRuins/koboldcpp/releases/tag/rocm-rolling) tag. The official short link is `https://koboldai.org/cpplinuxrocm`. * It is very experimental. * It needs x64 Linux with glibc from Ubuntu 22.04 or newer. * It brings its own ROCm 7 libraries. You don't need to install ROCm; the normal `amdgpu` kernel driver is enough. * It is updated separately from the releases and can lag behind them: the file tested for these docs reported version 1.121 while the latest release was 1.122.1. * Support is limited, because the maintainers don't have AMD devices themselves. * There is no official ROCm build for Windows. It is built for the Radeon RX 9000 series (gfx1200, gfx1201), RX 7000 series (gfx1100 to gfx1102), RX 6600 to RX 6950 XT (gfx1030 to gfx1032) and RX 5600/5700 (gfx1010), for older cards (RX 400/500 series: gfx803, Vega: gfx900, Radeon VII: gfx906) and for Instinct datacenter cards (gfx906, gfx908, gfx90a, gfx942). To use ROCm, set **Backend:** to **Use hipBLAS (ROCm)**, or pass `--usecuda`. For most AMD users, the **Vulkan** backend in the nocuda build is the recommended start. If generation is slow with Vulkan, try the ROCm build; see [GPU backends: ROCm](https://koboldcpp.net/docs/hardware/backends/#rocm). ## Advanced: old file names Scripts that download older file names no longer work. The files were renamed and the old names were removed in v1.94: | Old name | Current name | | ------------------------------ | --------------------------- | | `koboldcpp_cu12.exe` | `koboldcpp.exe` | | `koboldcpp_nocuda.exe` | `koboldcpp-nocuda.exe` | | `koboldcpp_oldcpu.exe` | `koboldcpp-oldpc.exe` | | `koboldcpp-linux-x64-cuda1210` | `koboldcpp-linux-x64` | | `koboldcpp-linux-x64-cuda1150` | `koboldcpp-linux-x64-oldpc` | To always get the newest file, download from this address, with the file name at the end: ```text https://github.com/LostRuins/koboldcpp/releases/latest/download/ ``` ## Other tools The release notes link [conversion and quantization tools](https://kcpptools.concedo.workers.dev/) for making GGUF files. ## Related * [Windows](https://koboldcpp.net/docs/install/windows/), [Linux](https://koboldcpp.net/docs/install/linux/), [macOS](https://koboldcpp.net/docs/install/macos/) * [Updating](https://koboldcpp.net/docs/install/updating/) * [Staying safe](https://koboldcpp.net/docs/install/staying-safe/) # Staying safe: where to download KoboldCpp, and known fake sites > Where to get KoboldCpp safely, how to check a downloaded file, and why antivirus may flag the Windows exe. Download KoboldCpp only from legitimate sources. The recommended is the official GitHub releases: [github.com/LostRuins/koboldcpp/releases/latest](https://github.com/LostRuins/koboldcpp/releases/latest). Beware of fake sites You should **ONLY** trust official downloads from the release binaries linked here and the official KoboldCpp Github at ## Official sources | What | Where | | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Project | [github.com/LostRuins/koboldcpp](https://github.com/LostRuins/koboldcpp) | | Downloads | [Latest stable release](https://github.com/LostRuins/koboldcpp/releases/latest), experimental builds at [rolling](https://github.com/LostRuins/koboldcpp/releases/tag/rolling) and [rocm-rolling](https://github.com/LostRuins/koboldcpp/releases/tag/rocm-rolling) tags on GitHub | | Colab notebook | [Official KoboldCpp Colab Notebook](https://colab.research.google.com/github/LostRuins/koboldcpp/blob/concedo/colab.ipynb) | | Docker image | [hub.docker.com/r/koboldai/koboldcpp](https://hub.docker.com/r/koboldai/koboldcpp) | | Website | | | Short links | Anything starting with `koboldai.org`, e.g. `koboldai.org/cpplinuxrocm`, `koboldai.org/colabcpp`, `koboldai.org/runpodcpp`, `koboldai.org/discord` | | Official resources | [Official links and mirrors](https://koboldcpp.net/links/) | The official downloads are on the [KoboldCpp Github releases](https://github.com/LostRuins/koboldcpp/releases/latest) page, koboldcpp.net links directly to them. Files from any other site are not official and may contain malware. ## Known fake sites Here is an incomplete list of fake websites we know about. **Do not visit or download KoboldCpp from any of these sites**: * koboldcpp\[.]com : Fake site that actively serves malicious downloads through javascript pop-ups. * koboldcpp\[.]cc : Fake site that actively serves malicious downloads through javascript pop-ups. Same owner as the above. * kobold-ai\[.]com : Fake site that redirects to a fake chatbot site called CrushOn. * koboldcpp\[.]store : Fake site filled with AI generated misinformation, harvests emails and directs to fake downloads. * koboldcpp\[.]org : Fake site filled with AI generated misinformation. ## Why antivirus may flag KoboldCpp Some antivirus programs report KoboldCpp's Windows exe as a trojan or "suspicious". For a file from the official releases, this is a false positive: * The exe is a self-extracting bundle that unpacks libraries into a temporary folder when it starts, which heuristic and machine-learning scanners can flag. * The files are not code-signed. The maintainers don't buy signing certificates. What to do: 1. Check that the file came from the [official releases](https://github.com/LostRuins/koboldcpp/releases/latest), for example by [comparing its checksum](#check-a-downloaded-file). 2. Add it to your antivirus exceptions, and report the false positive to your antivirus vendor. 3. If the file was quarantined or damaged, download it again. On Windows, SmartScreen can show "Windows protected your PC"; see [Windows](https://koboldcpp.net/docs/install/windows/#smartscreen-and-antivirus-warnings). On macOS, Gatekeeper blocks unsigned files until you allow them; see [macOS](https://koboldcpp.net/docs/install/macos/). ## Check a downloaded file The release page shows a SHA-256 checksum (`sha256:…`) next to each file. In a terminal, in the folder with your file, compute its checksum (use your file name) and compare the two: | System | Command | | -------------------- | ----------------------------------- | | Windows (PowerShell) | `Get-FileHash koboldcpp.exe` | | Linux | `sha256sum koboldcpp-linux-x64` | | macOS | `shasum -a 256 koboldcpp-mac-arm64` | Letter case doesn't matter. If the checksums differ, the file is damaged or not the official one; delete it and download it again from the [official releases](https://github.com/LostRuins/koboldcpp/releases/latest). ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [Download KoboldCpp](https://koboldcpp.net/download/) # Update to a new version > Update KoboldCpp by downloading the new release file. Your saved .kcpps configs and your models carry over. KoboldCpp has no automatic updater. To update, download the new file and use it instead of the old one. 1. If you haven't yet, save your settings: click **Save Config** in the launcher. It writes a `.kcpps` file. 2. Click **Update** in the launcher, or go to the [latest release](https://github.com/LostRuins/koboldcpp/releases/latest). **Update** only opens that page in your browser. 3. Download the same file you use now, for example `koboldcpp.exe`. See [Release files](https://koboldcpp.net/docs/install/releases/) if you are unsure. 4. Replace the old file with the new one. On Linux and macOS, run `chmod +x` on the new file. 5. Start it and load your settings with **Load Config**. Your models are separate files and stay where they are. ## Which version you have * The launcher's window title shows it: `KoboldCpp v…`. * `--version` on its own prints the version and exits: Terminal ```sh ./koboldcpp --version ``` ## Why update New model architectures need a newer KoboldCpp. If a model fails with `unknown model architecture`, update first. ## Your settings A `.kcpps` config holds your launch settings. You can load it three ways: * **Load Config** in the launcher * drag the `.kcpps` file onto the exe (Windows) * `--config mysettings.kcpps` on the command line Configs saved by older versions can keep old settings; see [Config files (.kcpps)](https://koboldcpp.net/docs/settings/config-files/#old-config-files). ## Old file names The file names changed in the past, and the old names no longer exist. If a script downloads `koboldcpp_cu12.exe` or a similar name, update it; see [old file names](https://koboldcpp.net/docs/install/releases/#advanced-old-file-names). ## Colab and Docker * **Colab:** the notebook downloads the latest release every time it runs. * **Docker:** the image downloads the latest KoboldCpp when the container starts, unless `KCPP_DONT_UPDATE=true` is set. The image itself only changes when its Docker setup changes; when it does, get it with `docker pull koboldai/koboldcpp`. ## Advanced: rolling builds [Rolling builds](https://koboldcpp.net/docs/install/releases/#advanced-rolling-builds) are updated automatically and may be unstable. For stability and proper support, use the official releases. ## Advanced: source builds and Termux * **`koboldcpp.sh`:** after pulling the new source, run `./koboldcpp.sh rebuild`. See [Build from source](https://koboldcpp.net/docs/install/from-source/#koboldcppsh-linux). * **Android (Termux):** re-running the setup script does not rebuild an existing install. See [Android](https://koboldcpp.net/docs/install/android/#updating). ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [Staying safe](https://koboldcpp.net/docs/install/staying-safe/) # Install on Windows (SmartScreen, antivirus) > Download and run KoboldCpp on Windows, get past SmartScreen and antivirus warnings, and use it from the command line. KoboldCpp for Windows is a single `.exe` file. There is no installer. 1. Pick your file. Most NVIDIA users need `koboldcpp.exe`; see [Download KoboldCpp](https://koboldcpp.net/download/) for the others. | Your PC | File | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------- | | NVIDIA graphics card | [`koboldcpp.exe`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp.exe) | | AMD, Intel or no graphics card | [`koboldcpp-nocuda.exe`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-nocuda.exe) | | Older processor or older NVIDIA card | [`koboldcpp-oldpc.exe`](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-oldpc.exe) | 2. Put the file in a folder of its own, for example `C:\mystuff`. When you start it by double-clicking, models that KoboldCpp downloads for you are saved in this folder. **Download Dir:** on the **Loaded Files** tab changes that. Use a path with plain ASCII characters (no umlauts or other accented letters). 3. Double-click the file. A console window opens, then the launcher. If Windows shows "Windows protected your PC", click **More info**, then **Run anyway**. This is expected: the file is not signed. Continue with [Choose a model](https://koboldcpp.net/getting-started/model/). ## SmartScreen and antivirus warnings KoboldCpp's exe files are not code-signed, and they unpack their libraries into a temporary folder when they start. Some antivirus programs flag this as suspicious. These are false positives, as long as the file came from the [official GitHub releases](https://github.com/LostRuins/koboldcpp/releases/latest). See [Staying safe](https://koboldcpp.net/docs/install/staying-safe/). | What you see | What to do | | ---------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | "Windows protected your PC" (SmartScreen) | Click **More info**, then **Run anyway**. | | Microsoft Defender or another antivirus reports a trojan or "suspicious" file, or deletes it | Restore or re-download the file, add it to your antivirus exceptions, and report the false positive to your antivirus vendor. | | The exe shrinks to 0 bytes, or "Failed to extract … decompression resulted in return code -3!" | The file is damaged, often by your antivirus. Download it again; if it happens again, add an exception. | | Smart App Control blocks it | Smart App Control has no exception list. It blocks KoboldCpp for as long as it is turned on. | ## If the window closes straight away When KoboldCpp crashes, the console window can close before you can read the error. Run it from Command Prompt instead, so the message stays on screen: 1. Press the Windows key, type `cmd` and press Enter. 2. Type `cd` followed by the folder with your file and press Enter. Then type your file's name and press Enter: Command Prompt ```sh cd C:\mystuff koboldcpp.exe ``` KoboldCpp writes no log file by itself. Errors from the launcher appear in a message box. Common causes: * **Your processor lacks AVX2, or your NVIDIA card or driver is old.** Errors like `WinError 1114` or `0xc000001d` often mean this. Use `koboldcpp-oldpc.exe`, or update your NVIDIA driver. See [System requirements](https://koboldcpp.net/docs/install/releases/#system-requirements). * **The console stays blank and the launcher never appears.** KoboldCpp could not unpack itself. It needs about 1 GB of free space for temporary files on the system drive, and antivirus software can block the unpacking. Free up space, or try the smaller `koboldcpp-nocuda.exe`. * **Antivirus removed part of the file.** See the table above. More: [KoboldCpp won't start](https://koboldcpp.net/docs/troubleshooting/wont-start/). ## Using the command line Pass flags after the file name. With a model, KoboldCpp skips the launcher and starts straight away: Command Prompt ```sh C:\mystuff\koboldcpp.exe --model C:\models\mymodel.gguf --contextsize 8192 ``` * `koboldcpp.exe --help` lists all flags. They are also in the [flag reference](https://koboldcpp.net/docs/reference/flags/). * `--config mysettings.kcpps` starts with a saved configuration. * The launcher opens a browser after loading; on the command line, add `--launch` for the same. * The launcher is not accessible to screen readers. Screen reader users can run KoboldCpp entirely from the command line. More: [Command line](https://koboldcpp.net/docs/settings/command-line/). ## Advanced: unpack for faster startup The exe unpacks itself every time it starts. To skip that, unpack it once into an empty folder, then start `koboldcpp-launcher.exe` in that folder. It needs no Python installation. Command Prompt ```sh koboldcpp.exe --unpack C:\kobold-unpacked ``` In the launcher, the same is on the **Extra** tab: **Unpack KoboldCpp To Folder**. The target folder must be empty. ## Advanced: open files with KoboldCpp On the **Extra** tab, **Register** makes KoboldCpp the program that opens `.gguf`, `.ggml`, `.kcpps` and `.kcppt` files for your user account. **Unregister** removes this. It only works with the standalone exe. ## Advanced: Windows 7 Windows 7 is not recommended. The main builds use functions that only exist in Windows 8 and newer. * Use `koboldcpp-oldpc.exe`. Its libraries skip the Windows 8 functions. * If it still fails with an error about `msvcp140.dll` or `GetSystemTimePreciseAsFileTime`, one user fixed it by [unpacking KoboldCpp](#advanced-unpack-for-faster-startup) and replacing the `msvcp140.dll` in the unpacked folder with an older version. Don't replace the one in Windows itself. * `DLL load failed while importing pyexpat` was fixed by installing the Windows update KB3063858. * The third-party VxKex compatibility layer can make the main builds run. * CUDA on Windows 7 is untested. ## Related * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [Updating](https://koboldcpp.net/docs/install/updating/) * [Build from source on Windows](https://koboldcpp.net/docs/install/from-source/#windows) # GGUF and quantization > What GGUF files are, which older formats KoboldCpp still loads, what quant names like Q4_K_M mean, and how to pick one. KoboldCpp runs models in the **GGUF** format (files ending in `.gguf`). A GGUF file contains the model's weights and its metadata in one file. Most GGUF models work in KoboldCpp. A model with a new architecture needs a KoboldCpp version that supports it. Most models come in several versions of different sizes, called **quants**. The quant is part of the file name, for example `Q4_K_M` in `gemma-3-4b-it-Q4_K_M.gguf`. ## Choosing a quant * Start with **Q4\_K\_M** or **Q4\_K\_S**. The beginner models recommended by KoboldCpp use these. * Within the K-quants (`Q2_K` up to `Q6_K`) of the same model, a bigger file means better quality and more memory. Pick the biggest one that fits your memory together with your context. See [How much memory a model needs](https://koboldcpp.net/docs/models/memory/). * Compare file sizes only within one quant family. `Q4_1` is bigger than `Q4_K_M` but has lower quality, and `Q5_1` is bigger than `Q5_K_M` but has lower quality. * Below Q4, quality drops quickly (see the table below). ## Quant names | Family | Names | Notes | | ------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | K-quants | `Q2_K`, `Q3_K_S`, `Q3_K_M`, `Q3_K_L`, `Q4_K_S`, `Q4_K_M`, `Q5_K_S`, `Q5_K_M`, `Q6_K` | The usual choice. The number is the approximate bits per weight. | | Legacy quants | `Q4_0`, `Q4_1`, `Q5_0`, `Q5_1`, `Q8_0` | Older types. `Q8_0` is the largest quant and the closest to the original. | | I-quants | `IQ1_S`, `IQ1_M`, `IQ2_XXS`, `IQ2_XS`, `IQ2_S`, `IQ2_M`, `IQ3_XXS`, `IQ3_XS`, `IQ3_S`, `IQ3_M`, `IQ4_XS`, `IQ4_NL` | The number is the approximate bits per weight. For the same number, the suffix gives the size: `XXS` is the smallest, then `XS`, `S` and `M`. | | Unquantized | `F16`, `BF16` | 16 bits per weight, about twice the size of `Q8_0`. | `Q3_K`, `Q4_K` and `Q5_K` without a suffix are other names for `Q3_K_M`, `Q4_K_M` and `Q5_K_M`. `_S`, `_M` and `_L` (small, medium, large) mix quant types inside one file: some tensors get a larger type. That is why `Q4_K_S` and `Q4_K_M` differ in size although both are "Q4\_K". ### Size and quality loss per quant llama.cpp's quantize tool lists these reference values for Llama-3-8B. "Quality loss" is the increase in perplexity compared with the original model; lower is better. | Quant | File size | Quality loss | | -------- | --------- | ------------ | | `Q2_K` | 2.96 GB | +3.5199 | | `Q3_K_S` | 3.41 GB | +1.6321 | | `Q3_K_M` | 3.74 GB | +0.6569 | | `Q3_K_L` | 4.03 GB | +0.5562 | | `Q4_0` | 4.34 GB | +0.4685 | | `Q4_K_S` | 4.37 GB | +0.2689 | | `Q4_K_M` | 4.58 GB | +0.1754 | | `Q4_1` | 4.78 GB | +0.4511 | | `Q5_0` | 5.21 GB | +0.1316 | | `Q5_K_S` | 5.21 GB | +0.1049 | | `Q5_K_M` | 5.33 GB | +0.0569 | | `Q5_1` | 5.65 GB | +0.1062 | | `Q6_K` | 6.14 GB | +0.0217 | | `Q8_0` | 7.96 GB | +0.0026 | Other models have other file sizes; the table shows how the quants compare with each other. ## Inspect a model file On the **Extra** tab, **Analyze Model** reads the metadata, weight types and tensor names of a GGUF or safetensors file. On the command line (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --analyze mymodel.gguf ``` ## Other formats KoboldCpp does not load text models in safetensors or PyTorch `.bin` format directly. For most models, someone has already published GGUF files; see [Where to get models](https://koboldcpp.net/docs/models/where-to-get-models/). To convert a model yourself: 1. Download the [conversion and quantization tools](https://kcpptools.concedo.workers.dev/). 2. Run `convert_hf_to_gguf.py` on the model to get a GGUF file. It needs Python 3 with the packages from KoboldCpp's `requirements.txt`, including PyTorch and `transformers`. 3. Run `quantize_gguf.exe` on that file to make a smaller quant. The tools contain only the Windows exe; on Linux and macOS, build `quantize_gguf` from the [KoboldCpp source](https://koboldcpp.net/docs/install/from-source/) with `make quantize_gguf`. For example, to make a `Q4_K_M` quant of a model downloaded into the folder `mymodel`: Terminal ```sh python convert_hf_to_gguf.py mymodel --outfile mymodel-16bit.gguf quantize_gguf.exe mymodel-16bit.gguf mymodel-Q4_K_M.gguf Q4_K_M ``` * `convert_hf_to_gguf.py ` writes a 16-bit GGUF by default. `--outtype` picks another type: `f32`, `f16`, `bf16` or `q8_0`. For vision models, a second run with `--mmproj` writes the projector file; this works only for some models. * `quantize_gguf ` takes the quant type last. Run it without arguments to list all types. ## Advanced: bits per weight These are tensor types, not file quants. Each type stores weights in fixed-size blocks, which give its exact bits per weight. A file quant such as `Q4_K_M` mixes its base type (`Q4_K`) with larger types for some tensors, so the file's average is slightly higher. | Type | Bits per weight | | ------------- | --------------- | | `IQ1_S` | 1.5625 | | `IQ1_M` | 1.75 | | `IQ2_XXS` | 2.0625 | | `IQ2_XS` | 2.3125 | | `IQ2_S` | 2.5625 | | `Q2_K` | 2.625 | | `IQ3_XXS` | 3.0625 | | `Q3_K` | 3.4375 | | `IQ3_S` | 3.4375 | | `IQ4_XS` | 4.25 | | `Q4_0` | 4.5 | | `Q4_K` | 4.5 | | `IQ4_NL` | 4.5 | | `Q4_1` | 5.0 | | `Q5_0` | 5.5 | | `Q5_K` | 5.5 | | `Q5_1` | 6.0 | | `Q6_K` | 6.5625 | | `Q8_0` | 8.5 | | `F16`, `BF16` | 16 | ## Advanced: legacy GGML models KoboldCpp still loads the older GGML formats that came before GGUF, usually `.bin` files. Supported are old llama-family files (GGML, GGMF, GGJT) and old GPT-J, GPT-2, RWKV, GPT-NeoX and MPT files. * KoboldCpp shows a warning when you load one. * Some newer features might be unavailable. Reconvert or re-download the model as GGUF if you can. * GPU offload for these formats is built only into the CUDA and ROCm libraries. With Vulkan they run on the CPU. * For non-llama legacy formats, the batch size is capped at 256. ## Related * [Where to get models](https://koboldcpp.net/docs/models/where-to-get-models/) * [How much memory a model needs](https://koboldcpp.net/docs/models/memory/) * [Choose a model](https://koboldcpp.net/getting-started/model/) # How much RAM and VRAM a model needs > Estimate the RAM and VRAM a model needs from its file size, the context (KV cache) and a safety margin, and what to do if it does not fit. A model needs memory for three things: 1. **The weights:** roughly the size of the `.gguf` file. 2. **The context:** the KV cache, which holds the text the model keeps in mind. It grows with the context size (16384 tokens by default). 3. **A margin:** working buffers, plus any other models you load at the same time (image generation, speech, vision projector). KoboldCpp's own estimates work the same way: they start from the file size, add the context, and keep spare room. There is no fixed table of "X GB for a 7B model"; the numbers depend on the model, the quant and the context. For example, Qwen3-VL-8B Q4\_K\_S (a 4.80 GB file) at the default context, with all layers on a 16 GB Radeon RX 7600 XT, measured on KoboldCpp 1.122.1: | Part | Memory | | --------------- | ------------------------------- | | Weights | 4240 MiB VRAM, plus 334 MiB RAM | | KV cache | 2340 MiB VRAM | | Compute buffers | 337 MiB VRAM | On an RTX 3090 with CUDA, the weights and the KV cache took the same VRAM, and the compute buffers took 305 MiB. ## GPU memory and system memory * Whatever runs on the graphics card uses its memory (**VRAM**). The rest stays in system memory (**RAM**). * If everything fits in VRAM, the model runs fastest. * If not, KoboldCpp puts as many layers on the GPU as fit and runs the rest from RAM, which is slower. It does this automatically while **GPU Layers:** is at its default, `-1`. See [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/). On macOS, `-1` puts all layers on the GPU without this check; see [Apple Silicon](https://koboldcpp.net/docs/hardware/apple-silicon/). At startup, the console shows what KoboldCpp found: ```text Detected Available GPU Memory: MB Detected Available RAM: MB ``` ## The context The KV cache grows with the context size. On most models it grows in proportion: twice the context needs twice the KV cache. Models with sliding window attention (SWA), such as the Gemma 3 family, use much less. SWA is on by default, and the KV cache of their SWA layers stays small no matter how large the context is. In a test with Gemma 3 270M at the default context, the SWA part of the KV cache took 16.88 MiB with SWA on and 243.75 MiB with SWA off (`--noswa`). SWA turns off [ContextShift](https://koboldcpp.net/docs/settings/context-size/#reusing-context-between-requests), which avoids reprocessing the chat once the context is full. The console prints the real KV cache size when the model loads: ```text llama_kv_cache: size = ... MiB (... cells, ... layers, ... seqs), K (f16): ... MiB, V (f16): ... MiB ``` The log shows a slightly larger context than you set (for example `n_ctx = 16640` for 16384). KoboldCpp adds 128 tokens of headroom and llama.cpp rounds up to a multiple of 256. The API still reports the context you set. ## If it does not fit Try these in order: 1. **Lower the context size.** See [Context size](https://koboldcpp.net/docs/settings/context-size/). 2. **Use a smaller quant** of the same model, for example `Q4_K_S` instead of `Q5_K_M`. See [GGUF and quantization](https://koboldcpp.net/docs/models/gguf-and-quantization/). 3. **Quantize the KV cache** with **Quantize KV Cache:** (`--quantkv q8_0`). See [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/). 4. **Close other programs that use the GPU.** If they use more than 2.5 GiB of VRAM, KoboldCpp prints a note at startup. 5. **Load fewer extra models** (image generation, speech, TTS) at the same time. 6. **Use a smaller model.** For MoE models, keeping the expert weights in RAM often makes a large model fit. See [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/#moe-models). If loading fails with an out-of-memory error, see [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/). ## Advanced: estimating the KV cache For each layer, llama.cpp stores one K and one V tensor with one entry per token of context: ```text KV bytes ≈ layers × context × (K width + V width) × bytes per element ``` * **K width** and **V width** are the number of KV heads (`head_count_kv`) times the key or value length (`key_length`, `value_length`). **Analyze Model** on the **Extra** tab (`--analyze`) shows these values in the model's metadata, together with the layer count (`block_count`). * This holds for full-attention layers. SWA layers only keep about the SWA window plus one batch. Bytes per element for each KV cache type: | `--quantkv` | Bytes per element | Compared with `f16` | | --------------- | ----------------- | ------------------- | | `f16` (default) | 2 | 100% | | `bf16` | 2 | 100% | | `q8_0` | 1.0625 | about 53% | | `q5_1` | 0.75 | about 38% | | `q4_0` | 0.5625 | about 28% | Without flash attention, only the K half is quantized (except with `bf16`). See [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/#quantize-the-kv-cache). ## Advanced: the margin KoboldCpp keeps * **Autofit** (the default with a GPU backend) reserves 1024 MB of spare VRAM on the first GPU, plus the memory of other loaded models, the vision projector and a draft model. Other GPUs get a fixed margin of 1 GiB. * **The fallback estimate**, used when autofit fails, keeps at least 1.25 GiB of VRAM free, or 0.5 GiB plus what other programs already use, whichever is more. Other models loaded at the same time (image generation, Whisper, TTS, embeddings, music) are counted as extra VRAM in both. ## Related * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/) * [Context size](https://koboldcpp.net/docs/settings/context-size/) # Where to get GGUF models > Recommended GGUF models, where to find more on Hugging Face, how to download from the launcher, and how to handle split GGUF files. KoboldCpp does not include a model. Most GGUF models are on [Hugging Face](https://huggingface.co). Download **one** `.gguf` file in the quant you want, not the whole repository. The quickest start is a newbie template: in the launcher, click **Get Help** and pick one under **Newbie Templates**. It downloads a suitable model for you. See [Choose a model](https://koboldcpp.net/getting-started/model/). ## Recommended models | Model | Good for | Download | File size | | ----------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------ | --------- | | Qwen3-VL-8B | The recommended all-rounder | [Q4\_K\_S](https://huggingface.co/unsloth/Qwen3-VL-8B-Instruct-GGUF/resolve/main/Qwen3-VL-8B-Instruct-Q4_K_S.gguf) | 4.8 GB | | Gemma3-4B | Lightweight and fast | [Q4\_K\_M](https://huggingface.co/ggml-org/gemma-3-4b-it-GGUF/resolve/main/gemma-3-4b-it-Q4_K_M.gguf) | 2.5 GB | | L3-8B-Stheno-v3.2 | Creative writing and roleplay | [Q4\_K\_S](https://huggingface.co/bartowski/L3-8B-Stheno-v3.2-GGUF/resolve/main/L3-8B-Stheno-v3.2-Q4_K_S.gguf) | 4.7 GB | For image input, also download the model's vision projector (mmproj): [for Qwen3-VL-8B](https://huggingface.co/unsloth/Qwen3-VL-8B-Instruct-GGUF/resolve/main/mmproj-BF16.gguf) or [for Gemma3-4B](https://huggingface.co/koboldcpp/mmproj/resolve/main/gemma3-4b-mmproj-q8.gguf). See [Vision](https://koboldcpp.net/docs/features/vision/). ## Finding more models * Search for "GGUF" on Hugging Face. * [Bartowski's Hugging Face page](https://huggingface.co/bartowski) has GGUF files of many popular models. * The official [koboldcpp organization](https://huggingface.co/koboldcpp) has vision projectors (`mmproj`), image, Whisper, TTS and music models, and launcher templates. A model repository usually lists one file per quant. Pick one with [GGUF and quantization](https://koboldcpp.net/docs/models/gguf-and-quantization/), and check that it fits with [How much memory a model needs](https://koboldcpp.net/docs/models/memory/). ## Download from the launcher **HF Search** next to **GGUF Text Model:** on the **Quick Launch** tab (and next to **Text Model:** on **Loaded Files**) searches Hugging Face from inside the launcher. 1. Click **HF Search**. The Model File Browser opens. 2. Type a model name and click **Search Huggingface**. 3. Pick a repository, then a `.gguf` file. Sizes are shown in GiB. A Q4 quant is preselected when the repository has one. 4. Click **Confirm Selection**. The file's address appears in the model field. 5. Click **Launch**. KoboldCpp downloads the file first, then loads it. You can also paste a Hugging Face download link into any model field, or pass it on the command line (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --model https://huggingface.co/ggml-org/gemma-3-4b-it-GGUF/resolve/main/gemma-3-4b-it-Q4_K_M.gguf ``` * Links containing `/blob/main/` are changed to `/resolve/main/` for you. * Files are saved to the folder set in **Download Dir:** on the **Loaded Files** tab (`--downloaddir`). Without it, they go to the current working folder; on Windows, to the exe's folder if the working folder is `System32` or `SysWOW64`. * A file that is already there is reused, not downloaded again. * KoboldCpp downloads with `aria2c` (bundled on Windows), `curl` or `wget`. If none is available, it prints "Please install aria2, curl, or wget." ## Split GGUF files Large models are often split into several files named like `model-00001-of-00003.gguf`. * **Local files:** keep all parts in the same folder and select the **first** part (`-00001-of-…`). KoboldCpp loads the others. Selecting another part fails with "model must be loaded with the first split". * **Download links:** give the link to the first part. For the text model, KoboldCpp downloads all parts. HF Search lists only the first part of each split model. * The automatic GPU layer estimate is less accurate for split files. KoboldCpp prints "Multi-Part GGUF detected. Layer estimates may not be very accurate". See [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/). ## Related * [GGUF and quantization](https://koboldcpp.net/docs/models/gguf-and-quantization/) * [How much memory a model needs](https://koboldcpp.net/docs/models/memory/) * [Choose a model](https://koboldcpp.net/getting-started/model/) # Deprecated flags > Old KoboldCpp flags, what replaced them and whether they still do anything. Generated from KoboldCpp 1.122.1. These flags are hidden from `--help`. They still parse so that old commands and `.kcpps` files keep working; some still have an effect, others are ignored. Use the replacement listed for each. ## Deprecated ### `--hordeconfig` Value: `value` Deprecated: sets several Horde worker options at once. Use instead: `--hordemodelname`, `--hordegenlen`, `--hordemaxctx`, `--hordekey` and `--hordeworkername`. Still works and overrides those flags; the key and worker name are only taken when all five values are given. ### `--sdconfig` Value: `value` Deprecated: sets the image model and some image options at once. Use instead: `--sdmodel`, `--sdclamped`, `--sdthreads` and `--sdquant`. Still works. ### `--noblas` Deprecated: runs on the CPU only. Use instead: `--usecpu`. Still works. ### `--nommap` Also: `--no-mmap` Deprecated: turned off memory mapping. Use instead: Nothing needed: mmap is now off by default; use `--usemmap` to turn it on. Has no effect. ### `--nopipelineparallel` Deprecated: turned off pipeline parallelism across GPUs. Use instead: Nothing: pipeline parallelism is now automatic. Has no effect. ### `--pipelineparallel` Deprecated: turned on pipeline parallelism across GPUs. Use instead: Nothing: pipeline parallelism is now automatic. Has no effect. ### `--sdnotile` Deprecated: turned off VAE tiling for image generation. Use instead: `--sdtiledvae 0`. Has no effect on the command line; only old `.kcpps` files that lack `sdtiledvae` still apply it. ### `--sdt5xxl` Value: `[filename]` Deprecated: the T5-XXL text encoder for image models. Use instead: `--sdllm`. Still works when `--sdllm` is not set. ### `--sdvaecpu` Deprecated: ran the image VAE on the CPU. Use instead: `--sdvaedevice CPU`. Still works when `--sdvaedevice` is not set. ### `--sdclipgpu` Deprecated: ran the image text encoders on the GPU. Use instead: `--sdclipdevice main`. Still works when `--sdclipdevice` is not set. ### `--forceversion` Deprecated: forced a model format version. Use instead: Nothing. Has no effect. ### `--sdgendefaults` Deprecated: default parameters for image generation requests. Use instead: `--gendefaults`. The command-line flag has no effect; in an old config without `gendefaults`, its value is carried over. ### `--flashattention` Also: `--flash-attn`, `-fa` Deprecated: turned on flash attention. The `-fa` alias is still accepted, so llama.cpp-style command lines do not fail. Use instead: Nothing needed: flash attention is on by default; use `--noflashattention` to turn it off. Has no effect on the command line, but an old `.kcpps` with `flashattention` set to false turns flash attention off. ### `--useswa` Deprecated: turned on sliding-window attention (SWA). Use instead: Nothing needed: SWA is on by default; use `--noswa` to turn it off. Has no effect on the command line, but an old `.kcpps` with `useswa` set to false turns SWA off. # Command-line flags and options reference > Every KoboldCpp command-line flag with what it does, its default and its launcher setting. Generated from KoboldCpp 1.122.1. Every flag KoboldCpp 1.122.1 accepts, generated from its source code. Run `koboldcpp --help` to see the same list in a terminal. Flags go after the file name, for example `koboldcpp.exe --model mymodel.gguf --contextsize 8192`. Most flags also exist in the launcher; each entry names the tab and label. ## Most used | Flag | What it does | | --------------------------------------- | ----------------------------------------------------------------------------------------------------- | | [`--usecuda`](#usecuda) | Runs the model on an NVIDIA GPU with CUDA (or an AMD GPU with hipBLAS/ROCm in ROCm builds). | | [`--usevulkan`](#usevulkan) | Runs the model on a GPU through Vulkan, which works with NVIDIA, AMD and Intel GPUs. | | [`--usecpu`](#usecpu) | Runs the model on the CPU only, without any GPU acceleration. | | [`--model`](#model) | The text model (GGUF file) to load. | | [`--config`](#config) | Loads all settings from a saved `.kcpps` config file (or `.kcppt` template), from disk or a URL. | | [`--contextsize`](#contextsize) | How many tokens of conversation the model can keep in memory at once (default 16384). | | [`--gpulayers`](#gpulayers) | How many model layers to put on the GPU; more layers is faster but needs more VRAM. | | [`--host`](#host) | The network address KoboldCpp listens on. | | [`--launch`](#launch) | Opens the web UI in your browser once the model has loaded. | | [`--threads`](#threads) | How many CPU threads to use for generation. | | [`--port`](#port) | The port the web UI and API listen on (default 5001). | | [`--version`](#version) | Prints the KoboldCpp version and exits. | | [`--mmproj`](#mmproj) | Loads the multimodal projector file that lets a vision (or audio) model understand images (or sound). | | [`--password`](#password) | Requires an API key for text generation and most other endpoints. | | [`--remotetunnel`](#remotetunnel) | Creates a public Cloudflare URL so you can reach KoboldCpp from anywhere, even behind a firewall. | | [`--sdmodel`](#sdmodel) | The image generation model (safetensors or GGUF) to load; this is what turns image generation on. | | [`--whispermodel`](#whispermodel) | Loads a Whisper model to turn speech into text. | | [`--ttsmodel`](#ttsmodel) | Loads a text-to-speech (TTS) model so KoboldCpp can read text aloud. | | [`--ttswavtokenizer`](#ttswavtokenizer) | The WavTokenizer file that some TTS models need. | ## Basics ### `--usecuda` Also: `--usecublas`, `--usehipblas` · Value: `[main GPU ID]` · Launcher: Quick Launch → Backend (Use CUDA / Use hipBLAS (ROCm)) and GPU ID Runs the model on an NVIDIA GPU with CUDA (or an AMD GPU with hipBLAS/ROCm in ROCm builds). With no number, all GPUs are used. A number from `0` to `3` uses only that GPU, unless `--tensor_split` is also set; then all GPUs stay in use. If your build has no CUDA library, KoboldCpp falls back to the CPU without an error; check the `Initializing dynamic library:` line in the terminal. > Help text: Use CUDA for GPU Acceleration. Requires CUDA. Enter a number afterwards to select and use 1 GPU. Leaving no number will use all GPUs. ### `--usevulkan` Value: `[Device IDs]` · Launcher: Quick Launch → Backend (Use Vulkan) and GPU ID Runs the model on a GPU through Vulkan, which works with NVIDIA, AMD and Intel GPUs. With no IDs, all devices are used; give one or more device IDs (e.g. `--usevulkan 0`) to pick specific GPUs. If the `GGML_VK_VISIBLE_DEVICES` environment variable is set, it wins over the IDs. If your build has no Vulkan library, KoboldCpp falls back to the CPU without an error. > Help text: Use Vulkan for GPU Acceleration. Can optionally specify one or more GPU Device ID (e.g. --usevulkan 0), leave blank to autodetect. ### `--usecpu` Launcher: Quick Launch → Backend (Use CPU) Runs the model on the CPU only, without any GPU acceleration. Any positive `--gpulayers` value is ignored with a warning. On macOS this flag does not stop Metal GPU offload. > Help text: Do not use any GPU acceleration (CPU Only) ### `--model` Also: `-m` · Value: `[filenames]` · Launcher: Quick Launch → GGUF Text Model The text model (GGUF file) to load. You can also pass the file as the first plain argument: `koboldcpp model.gguf`. An `https://` URL ending in `.gguf` is downloaded first (all parts of a split Hugging Face model are fetched); an existing file with the same name is reused. Extra URLs after the first are only downloaded, never loaded. > Help text: Model file to load. Accepts multiple values if they are URLs. ### `--config` Value: `[filename]` · Launcher: Bottom bar → Load Config Loads all settings from a saved `.kcpps` config file (or `.kcppt` template), from disk or a URL. The help text is wrong: other flags are not ignored. A flag overrides the config value only when written exactly as `--` (e.g. `--contextsize 4096` or `--quiet`); short aliases like `-c` and the `--flag=value` form are silently ignored. An explicit `--port 5001` does not override the config's port, because 5001 is the default. > Help text: Load settings from a .kcpps file. Other arguments will be ignored ### `--contextsize` Also: `--ctx-size`, `-c` · Value: `[256 to 524288]` · Default: `16384` · Launcher: Quick Launch → Context Size How many tokens of conversation the model can keep in memory at once (default 16384). Larger values use more RAM/VRAM. Allowed range is 256 to 524288; the launcher slider stops at 262144. Requests can never use more context than this, and the terminal may show a slightly larger number because of internal padding. > Help text: Controls the memory allocated for maximum context size, only change if you need more RAM for big contexts. (default 16384). ### `--gpulayers` Also: `--gpu-layers`, `--n-gpu-layers`, `-ngl` · Value: `[GPU layers]` · Default: `-1` · Launcher: Quick Launch → GPU Layers How many model layers to put on the GPU; more layers is faster but needs more VRAM. `-1` (default) estimates the layers when a GPU backend is found, or becomes `0` when none is. It also turns on autofit, unless `--tensor_split`, `--overridetensors`, `--moecpu` or `--ffncpu` is set. On macOS, `-1` puts all layers on the GPU and does not turn on autofit. `0` keeps everything on the CPU and also skips automatic backend detection. `--gpulayers` with no number means 1 layer. > Help text: Set number of layers to offload to GPU (when using GPU). Set to -1 to enable autofit (default), set to 0 to disable GPU offload. ### `--host` Value: `[ipaddr]` · Launcher: Network → Host The network address KoboldCpp listens on. By default it listens on all interfaces, so other devices on your network can reach it. Use `--host 127.0.0.1` to allow only this computer. In router mode (`--routermode` or `--autoswapmode`) KoboldCpp listens on all interfaces whatever `--host` says, so use a firewall to keep it private. If you do expose it, set `--password`. > Help text: Host IP to listen on. If this flag is not set, all routable interfaces are accepted. ### `--launch` Launcher: Quick Launch → Launch Browser Opens the web UI in your browser once the model has loaded. Off by default on the command line, but ticked by default in the launcher. Cannot be combined with `--cli`. > Help text: Launches a web browser when load is completed. ### `--tensor_split` Also: `--tensorsplit`, `--tensor-split`, `-ts` · Value: `[Ratios]` · Launcher: Hardware → Tensor Split Sets how the model is divided across several GPUs, as a list of proportions such as `7 3`. With a split set, `--usecuda N` no longer limits KoboldCpp to one GPU. Setting a split stops autofit from turning on automatically, and a forced `--autofit` ignores it. Up to 16 values are used. > Help text: For CUDA and Vulkan only, ratio to split tensors across multiple GPUs, space-separated list of proportions, e.g. 7 3 ### `--threads` Also: `-t` · Value: `[threads]` · Default: `get_default_threads()` · Launcher: Hardware → Threads How many CPU threads to use for generation. The default is about half your CPU threads minus one (1 to 3 on small CPUs), capped at 8 on CPUs that report as Intel and at 64 overall; `0` or a negative value means automatic. It is also the default for `--blasthreads`, `--sdthreads` and `--ttsthreads`. > Help text: Use a custom number of threads if specified. Otherwise, uses an amount based on CPU cores ### `--port` Value: `[portnumber]` · Default: `5001` · Launcher: Network → Port The port the web UI and API listen on (default 5001). You can also pass it as a plain argument after the model: `koboldcpp model.gguf 5002`. If the port is already in use, the model loads fully and then startup fails. A config file's port wins over an explicit `--port 5001`. > Help text: Port to listen on. (Defaults to 5001) ### `--version` Prints the KoboldCpp version and exits. Only works as the sole argument; combined with other flags it is ignored and KoboldCpp starts normally. > Help text: Prints version and exits. ## Advanced ### `--agent` Launcher: Admin → Launch KoboldCpp Agent Starts the bundled KoboldCpp Agent, a terminal-based assistant, in a new terminal window. Alone it opens only the agent, which connects to `http://127.0.0.1:5001/v1`. With a model it also starts the server and raises the context to at least 28672, `--defaultgenamt` to at least 8192, and turns on `--jinja` and `--jinja_tools`. Add `--cli` to run the agent in the current terminal. > Help text: Launches the simple KoboldCpp Agent in a new terminal window, or the current terminal with --cli. ### `--analyze` Value: `[filename]` · Launcher: Extra → Analyze Model Prints the metadata, weight types and tensor names of a GGUF or safetensors file, then exits. Takes a file path; nothing is loaded or served. > Help text: Reads the metadata, weight types and tensor names in any GGUF or safetensors file. ### `--autofit` Also: `--fit`, `-fit` · Launcher: Quick Launch → Force AutoFit Forces autofit, which works out the best way to split the model between GPU and CPU. Autofit is already on by default when `--gpulayers` is `-1` and a GPU backend is used, unless `--tensor_split`, `--overridetensors`, `--moecpu` or `--ffncpu` is set or you are on macOS. Forcing it overrides `--gpulayers` (even `0`) and discards `--tensor_split`, `--overridetensors`, `--moecpu` and `--ffncpu`. If fitting fails, the normal layer estimate is used. > Help text: Forces autofit, which attempts to fit the model in the best possible way. Overrides everything else. ### `--autofitpadding` Value: `[padding in MB]` · Default: `1024` · Launcher: Hardware → Autofit Padding (MB) How much VRAM, in MB, autofit keeps free as a safety margin (default 1024). Only applies when `--autofit` is set explicitly; the automatic autofit always uses 1024. Raise it if loading fails with out-of-memory errors. > Help text: How much spare allowance in MB should autofit reserve? If it's too little, the load might fail. ### `--batchsize` Also: `--blasbatchsize`, `--batch-size`, `-b` · Value: `-1 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096` · Default: `512` · Launcher: Hardware → Batch Size How many prompt tokens are processed at once (default 512); larger is faster but uses more memory. Only the listed values are accepted. `-1` processes one token at a time but keeps GPU offload. Old non-llama model formats are capped at 256. > Help text: Sets the logical batch size used in batched processing (default 512). Setting it to -1 disables batched mode, but keeps other benefits like GPU offload. ### `--ubatchsize` Also: `--ubatch-size`, `-ub` · Value: `-1 | 16 | 32 | 64 | 128 | 256 | 512 | 1024 | 2048 | 4096` · Default: `-1` · Launcher: Hardware → Physical Batch Size The physical batch size actually sent to the backend in one step. `-1` (default) uses the same value as `--batchsize`; larger values are lowered to the batch size. > Help text: Sets the physical batch size used in batched processing. Setting it to -1 uses the same value as batchsize (default). ### `--benchmark` Value: `[filename]` · Launcher: Hardware → Run Benchmark Runs a speed benchmark instead of starting the server, then exits. It fills the whole context with a synthetic prompt and generates `--genlimit` tokens (100 if unset), then prints processing and generation speed. Give a filename to append the results as a CSV row. Needs a model; cannot be combined with `--cli`. > Help text: Do not start server, instead run benchmarks. If filename is provided, appends results to provided file. ### `--blasthreads` Also: `--batchthreads`, `--threadsbatch`, `--threads-batch` · Value: `[threads]` · Launcher: Hardware → Batch Threads How many CPU threads to use while processing the prompt. `0` (default) uses the same value as `--threads`. > Help text: Use a different number of threads during batching if specified. Otherwise, has the same value as --threads ### `--chatcompletionsadapter` Value: `[filename]` · Default: `AutoGuess` · Launcher: Loaded Files → Chat Adapter Sets the instruct format (chat tags) used for chat-style API requests. The default `AutoGuess` detects the format from the model's chat template and falls back to Alpaca if nothing matches. You can give a JSON file path or the name of a bundled adapter such as `ChatML` or `Llama-3`. With `--jinja`, the model's own template is used instead. > Help text: Select an optional ChatCompletions Adapter JSON file to force custom instruct tags. ### `--cli` Launcher: Hardware → CLI Terminal Only Chat with the model directly in the terminal, without starting the web server. Type `/quit` or `/exit` to leave. `--prompt` becomes the system prompt, and `--jinja` is not used. Cannot be combined with `--launch`, `--nomodel`, `--admin` or `--benchmark`. > Help text: Runs interactive terminal chat without an HTTP server. With --agent, runs the agent in this terminal using a loopback HTTP server. ### `--debugmode` Value: `int` · Launcher: Hardware → Debug Mode Prints extra diagnostic information in the terminal, including full request inputs. The flag alone means `1`; use `1` rather than higher values. It also turns off `--quiet`. KoboldCpp sets `-1` (fewer messages) automatically when Horde worker flags are used. > Help text: Shows additional debug info in the terminal. Levels: -1 (Horde-quiet, suppresses non-essential prints; auto-applied when Horde args are set), 0 (default, normal output), 1 (verbose: extra slot/cache info, larger print buffers, retains horde-debug prefix). Passing the flag without a value implies 1. ### `--defaultgenamt` Value: `check_range(int, 64, 32768)` · Default: `2048` · Launcher: Context → Default Gen Amt How many tokens to generate when a request does not say how many (default 2048). Most frontends send their own length, so this mainly affects bare API calls. The value is silently lowered to half the context size (e.g. 256 with `--contextsize 512`); the help's "must be smaller than context size" is outdated. Allowed range is 64 to 32768. > Help text: How many tokens to generate by default, if not specified. Must be smaller than context size. Usually, your frontend GUI will override this. ### `--device` Also: `-dev` · Value: `` · Launcher: Hardware → Device Override Chooses exactly which backend devices to use, by llama.cpp device name, comma-separated. CPU devices and unknown names are rejected, and one bad name cancels the whole override; loading then continues normally. `none` means no override. Only the text, TTS and embeddings models use it. > Help text: Set llama.cpp compatible device selection override. Comma separated. Overrides normal device choices. ### `--downloaddir` Value: `[directory]` · Launcher: Loaded Files → Download Dir The folder where models given as URLs are downloaded. If a file with the same name is already there, it is reused instead of downloaded again. It does not change where local file paths are looked up. Unset means the current working directory. > Help text: Specify a directory that models will be downloaded to or searched from, if unset uses the working directory. ### `--draftamount` Also: `--draft-max`, `--draft-n`, `--spec-draft-n-max` · Value: `[tokens]` · Default: `4` · Launcher: Loaded Files → Draft Amount How many tokens the draft model (or MTP) guesses ahead per step in speculative decoding (default 4). `0` or less turns speculative decoding off. > Help text: How many tokens to draft per chunk before verifying results ### `--draftgpulayers` Also: `--gpu-layers-draft`, `--n-gpu-layers-draft`, `-ngld` · Value: `[layers]` · Default: `999` · Launcher: Loaded Files → Layers (Draft Model row) How many layers of the draft model go on the GPU (default 999, meaning all). > Help text: How many layers to offload to GPU for the draft model (default=full offload) ### `--draftgpusplit` Value: `[Ratios]` · Launcher: Loaded Files → Splits (Draft Model row) How the draft model is divided across several GPUs, as a list of proportions. Without it the draft model gets llama.cpp's default split, not the main model's ratios as the help says. It works without `--tensor_split`, but the GPUs must be visible: `--usecuda N` without `--tensor_split` hides all other GPUs. > Help text: GPU layer distribution ratio for draft model (default=same as main). Only works if multi-GPUs selected for MAIN model and tensor\_split is set! ### `--draftmodel` Also: `--model-draft`, `-md` · Value: `[filename]` · Launcher: Loaded Files → Draft Model Loads a small draft model for speculative decoding, which can speed up generation. The draft model must use the same vocabulary as the main model; a large mismatch turns drafting off. A missing or broken draft file does not stop startup, it only prints an error. It takes priority over `--usemtp` and turns off `--parallelrequests` batching. > Help text: Load a small draft model for speculative decoding. It will be fully offloaded. Vocab must match the main model. ### `--enableguidance` Launcher: Context → Enable Guidance Enables classifier-free guidance, so requests can use a negative prompt. Creates a second context, which roughly doubles the memory used for context. It only takes effect for requests with a `negative_prompt` and a `guidance_scale` other than 1. It turns off `--parallelrequests` batching. > Help text: Enables the use of Classifier-Free-Guidance, which allows the use of negative prompts. Has performance and memory impact. ### `--exportconfig` Value: `[filename]` · Launcher: Bottom bar → Save Config Saves the given flags as a `.kcpps` config file and exits without loading anything. `.kcpps` is added to the name if missing. Values worked out at load time, such as automatic GPU layers or backend, are not saved. > Help text: Exports the current selected arguments as a .kcpps settings file ### `--exporttemplate` Value: `[filename]` · Launcher: Extra → Generate LaunchTemplate Saves the given flags as a shareable `.kcppt` launch template and exits. The backend, GPU layers, threads, main GPU, GPU splits, passwords, SSL and Horde worker name and key are reset, and the backend is auto-detected when the template is loaded. Other machine-specific settings are kept, such as `--device`, `--blasthreads`, `--draftgpulayers`, `--noavx2` and `--failsafe`; check them before sharing. Unlike the launcher button, the command line does not embed the chat adapter or preload story files. > Help text: Exports the current selected arguments as a .kcppt template file ### `--failsafe` Launcher: Quick Launch → Backend (Failsafe Mode (Older CPU)) Compatibility mode for very old CPUs; much slower. Selected automatically when the CPU has neither AVX nor AVX2. It implies `--noavx2` and prevents CUDA from loading. Add `--usecpu` to make sure it runs on the CPU; otherwise a GPU backend can still be selected automatically. > Help text: Use failsafe mode, extremely old CPU compatibility mode that should work on all devices. ### `--foreground` Launcher: Hardware → Keep Foreground On Windows, brings the terminal window to the front on each new generation to avoid idle slowdowns. Does nothing on Linux and macOS. > Help text: Windows only. Sends the terminal to the foreground every time a new prompt is generated. This helps avoid some idle slowdown issues. ### `--gendefaults` Value: `{"parameter":"value",...}` · Launcher: Context → Default Params Default values, as a JSON object, that are added to API requests when the request leaves them out. Example: `--gendefaults '{"max_length":512}'`. It applies to text, image, audio and embeddings requests; key names must match that endpoint's request fields. If the JSON cannot be parsed, a warning is printed on every request and no defaults apply. > Help text: Sets extra default parameters for some fields in API requests, as a JSON string. ### `--gendefaultsoverwrite` Launcher: Context → Override (next to Default Params) Makes `--gendefaults` values replace the values sent in requests, not only fill in missing ones. > Help text: Allow the gendefaults parameters to overwrite the original value in API payloads. ### `--genlimit` Also: `--promptlimit` · Value: `[token limit]` · Launcher: Context → Prompt Limit A hard upper limit on generated tokens for every request. Despite the `--promptlimit` alias and the **Prompt Limit** label, it limits output, not the prompt. `0` means no limit. It also sets the length for `--prompt` and `--benchmark`. > Help text: Sets the maximum number of generated tokens, it will restrict all generations to this or lower. Also usable with --prompt or --benchmark. ### `--highpriority` Launcher: Hardware → High Priority Tries to raise KoboldCpp's CPU priority. On Windows it sets the process to realtime priority. On Linux it currently lowers the process priority slightly (nice 0 to 1) instead of raising it, and its request for higher thread priority fails unless you have the privileges for it. > Help text: Experimental flag. If set, increases the process CPU priority, potentially speeding up generation. Use caution. ### `--ignoremissing` Skips missing files with a warning instead of stopping. Covers the config file and the model files (text, LoRA, mmproj, image, Whisper, TTS, embeddings, music). A missing text model is skipped too; if nothing is left to load, KoboldCpp exits instead of starting. > Help text: Ignores all missing non-essential files, just skipping them instead. ### `--jinja` Launcher: Quick Launch → Use Jinja Formats chat requests with the model's own chat template instead of KoboldCpp's adapter tags. Applies to chat-style endpoints (OpenAI chat, Ollama chat, Anthropic Messages); other endpoints are unaffected. Requests with tools fall back to the adapter unless `--jinja_tools` is set. Turned on automatically by `--jinja_tools`, `--jinja_kwargs` and `--jinjathink`. > Help text: Enables using jinja chat template formatting for chat completions endpoint. Other endpoints are unaffected. Tool calls are done without jinja. ### `--jinja_kwargs` Also: `--jinja-kwargs`, `--jinjakwargs`, `--chat-template-kwargs` · Value: `{"parameter":"value",...}` · Launcher: Context → Jinja Kwargs Extra variables, as a JSON object, passed to the Jinja chat template. Example: `{"enable_thinking":false}`. A request's own `chat_template_kwargs` override these. Setting it turns on `--jinja`. > Help text: Set additional fields for Jinja JSON template parser, must be a valid JSON object. ### `--jinja_tools` Also: `--jinja-tools`, `--jinjatools` · Launcher: Context → Jinja for Tools Uses the Jinja chat template also for requests that include tool calls. Turns on `--jinja`. For OpenAI chat requests with tools, the temperature defaults to 0.5 and is capped at 1.0. > Help text: Enables using jinja chat template formatting for chat completions endpoint. Other endpoints are unaffected. Tool calls are done with jinja. ### `--jinjatemplate` Also: `--chat-template-file` · Value: `[filename]` · Launcher: Loaded Files → Jinja Template Replaces the model's built-in chat template with your own Jinja template file (or URL). It does not turn on `--jinja`; without it, the template only affects the automatic chat-format detection. A missing file is skipped without an error. > Help text: Select a custom Jinja chat template, will overwrite model jinja chat template ### `--jinjathink` Value: `default | true | false` · Default: `default` · Launcher: Context → Jinja Thinking Turns thinking on (`true`) or off (`false`) for reasoning models that support it in their chat template. `true` or `false` also turns on `--jinja`. `default` leaves the model's behaviour unchanged. A request's `chat_template_kwargs` can override it. > Help text: A quick way to enable or disable thinking in the jinja template. ### `--lora` Value: `[lora_filename]` · Launcher: Loaded Files → Text Lora Applies a LoRA adapter file on top of the text model. Only one LoRA is applied; a second value is checked as a base file but not used. If the LoRA cannot be applied, the whole model load fails. > Help text: GGUF models only, applies a lora file on top of model. ### `--loramult` Value: `[amount]` · Default: `1.0` · Launcher: Loaded Files → Multiplier (next to Text Lora) How strongly the text LoRA is applied (default 1.0). Has no effect without `--lora`. > Help text: Multiplier for the Text LORA model to be applied. ### `--lowvram` Also: `-nkvo`, `--no-kv-offload` · Launcher: Hardware → No KV offload Keeps the context (KV cache) in system RAM instead of VRAM. Saves VRAM but makes generation much slower; try fewer `--gpulayers` or `--quantkv` first. > Help text: If supported by the backend, do not offload KV to GPU (lowvram mode). Not recommended, will be slow. ### `--maingpu` Also: `--main-gpu`, `-mg` · Value: `[Device ID]` · Default: `-1` · Launcher: Hardware → Main GPU Chooses which GPU is the main one in a multi-GPU setup. Has no effect on GGUF text models in this version. `-1` (default) means automatic. To keep a GGUF model on one GPU, use `--usecuda N` without `--tensor_split`. > Help text: Only used in a multi-gpu setup. Sets the index of the main GPU that will be used. ### `--maxrequestsize` Value: `[size in MB]` · Default: `32` · Launcher: Network → Max Req. Size (MB) The largest request body the server accepts, in MB (default 32). Larger requests get an HTTP 500 "Payload is too big" error. Raise it only if you send very large images or files. > Help text: Specify a max request payload size. Any requests to the server larger than this size will be dropped. Do not change if unsure. ### `--mcpfile` Value: `[mcp json file]` · Launcher: Loaded Files → MCP JSON Loads an `mcp.json` file so models can use tools from MCP servers. Accepts the Claude Desktop format (`mcpServers`) and the VS Code format (`servers`), from a path or URL. KoboldCpp serves the tools at `/mcp`. The server can start with only this flag, without a text model. > Help text: Specify path to mcp.json which contains the Cladue Desktop compatible MCP server config. ### `--mmproj` Value: `[filename]` · Launcher: Loaded Files → Mmproj File Loads the multimodal projector file that lets a vision (or audio) model understand images (or sound). The projector must match the text model, which must be a GGUF. A missing file stops startup unless `--ignoremissing` is set. > Help text: Select a multimodal projector file for vision models. ### `--mmprojcpu` Also: `--no-mmproj-offload` · Launcher: Loaded Files → V.Force CPU Keeps the multimodal projector on the CPU to save VRAM. > Help text: Force CLIP for Vision mmproj always on CPU. ### `--moecpu` Also: `--n-cpu-moe`, `-ncmoe` · Value: `[layers affected]` · Launcher: Context → MoE CPU Layers Keeps the expert weights of the first N layers of a Mixture-of-Experts model in system RAM, to fit large MoE models on a small GPU. The flag alone applies to all layers. It only has an effect when a GPU is used. Setting it stops autofit from turning on automatically, and a forced `--autofit` ignores it. > Help text: Keep the Mixture of Experts (MoE) weights of the first N layers in the CPU. If no value is provided, applies to all layers. ### `--ffncpu` Also: `--n-cpu-ffn`, `-ncffn` · Value: `[layers affected]` · Launcher: Context → FFN CPU Layers Keeps the dense feed-forward weights of the first N layers in system RAM instead of VRAM. The flag alone applies to all layers. Like `--moecpu`, it only has an effect when a GPU is used and stops autofit from turning on automatically. > Help text: Keep the dense FFN weights of the first N layers in the CPU. If no value is provided, applies to all layers. ### `--moeexperts` Value: `[num of experts]` · Default: `-1` · Launcher: Context → MoE Experts How many experts a Mixture-of-Experts model uses per token. `-1` or `0` uses the model's own setting. Changing it trades quality against speed. > Help text: How many experts to use for MoE models (default=follow gguf) ### `--multiuser` Value: `limit` · Default: `10` · Launcher: Network → Multiuser Queue Sets how many generation requests the server accepts at once: one running, the rest waiting in line (default 10). Requests are processed one at a time unless `--parallelrequests` is set. `N` allows N−1 waiting requests, and `1` behaves like 10. `0` turns queuing off so a busy server answers 503, but only for a text-only server: with an image, Whisper, TTS or embeddings model, or with `--parallelrequests`, queuing stays on. > Help text: Set maximum number of queued incoming requests allowed. ### `--multiplayer` Launcher: Network → Shared Multiplayer Hosts a shared story session that several people can join from KoboldAI Lite. If `--password` is set, joining needs it. > Help text: Hosts a shared multiplayer session that others can join. ### `--nocertify` Launcher: Network → NoCertify Mode (Insecure) Turns off certificate checks for KoboldCpp's own outgoing HTTPS connections. Affects KoboldCpp's own HTTPS requests, such as web search and MCP servers; it has nothing to do with `--ssl`. Model and config downloads run through aria2, curl or wget, which still check certificates. It removes protection against tampered connections, so use it only when a connection fails with certificate errors. > Help text: Allows insecure SSL connections. Use this if you have cert errors and need to bypass certificate restrictions. ### `--nofastforward` Launcher: Context → Use FastForwarding (unticked) Reprocesses the whole prompt on every request instead of reusing the part that has not changed. This also disables context shifting and SmartCache. Makes most requests slower. > Help text: If set, do not attempt to fast forward GGUF context (always reprocess). Will also enable noshift ### `--noflashattention` Also: `--no-flash-attn`, `-nofa` · Launcher: Quick Launch → Use FlashAttention (unticked) Turns off flash attention, which is on by default. Use it if your GPU or backend crashes or misbehaves with flash attention. With flash attention off, `--quantkv` compresses only half of the cache (the K part), except `bf16`, which compresses both. > Help text: Disables flash attention. ### `--noavx2` Launcher: Quick Launch → Backend (Use CPU (Old CPU) / Use Vulkan (Old CPU)) Uses a slower build for older CPUs without AVX2. Normally detected automatically. It prevents CUDA from loading. Add `--usecpu` for CPU only; otherwise a GPU backend such as Vulkan can still be selected automatically. > Help text: Do not use AVX2 instructions, a slower compatibility mode for older devices. ### `--nobostoken` Launcher: Context → No BOS Token Stops KoboldCpp from adding the beginning-of-sequence (BOS) token to prompts. Most models need the BOS token; leave this off unless a model's instructions say otherwise. > Help text: Prevents BOS token from being added at the start of any prompt. Usually NOT recommended for most models. ### `--nommq` Launcher: Quick Launch → Use MMQ (unticked) Turns off MMQ matrix kernels on CUDA. MMQ is on by default. Only affects CUDA/hipBLAS. > Help text: Disables MMQ, only used for cuda backend. This flag may be removed in future. ### `--nomodel` Launcher: Loaded Files → Allow Launch Without Models Lets the server and the KoboldAI Lite web UI start without a model. Models you do set are still loaded. The help says "GUI", but it means the web UI; the launcher is not shown. Useful with `--admin` to pick a model later. Cannot be combined with `--cli`. > Help text: Allows you to launch the GUI alone, without selecting any model. ### `--noshift` Also: `--no-context-shift` · Launcher: Quick Launch → Use ContextShift (unticked) Turns off context shifting, which lets long chats continue without reprocessing the whole prompt. Context shifting is on by default. It is turned off automatically for models using SWA (unless `--noswa`), for models using MRoPE such as Qwen2-VL and Qwen3-VL, and when `--parallelrequests` is above 1. > Help text: If set, do not attempt to Trim and Shift the GGUF context. ### `--noswa` Also: `--swa-full` · Launcher: Context → Allow SWA (unticked) Uses a full-size context cache on models with sliding-window attention (SWA), such as Gemma. SWA is on by default and saves a lot of memory, but disables context shifting. With `--noswa` the cache is much larger and context shifting works again. > Help text: If set, uses full-size SWA KV Cache. Otherwise, SWA will be enabled automatically on models that support it. SWA saves memory but cannot be used with context shifting. ### `--onready` Value: `[shell command]` Runs a shell command once all models have loaded. It runs about one second after loading, possibly before the server accepts connections, so poll the port if the command needs the server. A value from a config file is ignored unless `--allow-config-onready` is set. > Help text: An optional shell command to execute after the model has been loaded. ### `--allow-config-onready` Allows `.kcpps` config files to set an `--onready` shell command. Without it, `onready` values in configs are dropped, both at launch and on admin model swaps. Only use it with configs you trust, since the command runs with your user's permissions. A config cannot turn this on itself. > Help text: Allow .kcpps config files loaded after launch to set --onready commands. Only use with trusted configs. ### `--overridekv` Also: `--override-kv` · Value: `[name=type:value]` · Launcher: Context → Override KV Overrides metadata values in the GGUF model, in the form `name=type:value`. Types are `int`, `float`, `bool` and `str`; separate several overrides with commas (up to 16). Example: `tokenizer.ggml.add_bos_token=bool:false`. > Help text: Override metadata value by key. Separate multiple values with commas. Format is name=type:value. Types: int, float, bool, str ### `--overridenativecontext` Value: `[trained context]` · Launcher: Context → Override Native Context (with Custom RoPE Config ticked) Tells KoboldCpp the model's trained context length, so automatic RoPE scaling is calculated from that value. `0` (default) uses the model's own value. Takes priority over `--ropeconfig`. > Help text: Overrides the native trained context of the loaded model with a custom value to be used for Rope scaling. ### `--overridetensors` Also: `--override-tensor`, `-ot` · Value: `[tensor name pattern=buffer type]` · Launcher: Context → Override Tensors Places specific model tensors on a chosen device, using llama.cpp's `pattern=buffer type` syntax. Only has an effect when a GPU is used. Unknown buffer types are rejected. Setting it stops autofit from turning on automatically, and a forced `--autofit` ignores it. > Help text: Override selected backend for specific tensors matching tensor\_name\_regex\_pattern=buffer\_type, same as in llama.cpp. ### `--parallelrequests` Also: `--continuous-batching`, `--contbatch` · Value: `[slots]` · Default: `1` · Launcher: Network → Parallel Requests Processes up to N text requests at the same time (continuous batching); experimental. `0` and `1` mean off; the maximum is 32. It turns off context shifting. Requests that use media, grammar, tools, many advanced samplers, or a negative prompt still run one at a time, and `--smartcache` or `--draftmodel` disable batching. > Help text: Allows multiple requests to be batched and executed in parallel. Only works for basic text generation requests (Experimental, No media) ### `--password` Value: `[API key]` · Default: `os.getenv('KCPP_PASSWORD', None)` · Launcher: Network → Password Requires an API key for text generation and most other endpoints. Clients send it as `Authorization: Bearer `; it can also be set with the `KCPP_PASSWORD` environment variable. Image generation and the `/tts_to_audio` endpoint stay open, and admin functions need `--adminpassword`. Always set it before exposing KoboldCpp with `--host`, `--remotetunnel` or on a shared network. > Help text: Enter a password required to use this instance. This key will be required for all text endpoints. Image endpoints are not secured. Can also be set with env var KCPP\_PASSWORD ### `--preloadstory` Value: `[savefile]` · Launcher: Loaded Files → Preload Story Serves a saved story file that KoboldAI Lite can load from the server. > Help text: Configures a prepared story json save file to be hosted on the server, which frontends (such as KoboldAI Lite) can access over the API. ### `--prompt` Also: `-p` · Value: `[prompt]` Generates one reply to the given prompt, prints it and exits, without starting the server. The prompt is sent as raw text with no chat template, using fixed settings (low temperature) and `--genlimit` tokens (100 if unset). With `--cli` it becomes the system prompt; with `--benchmark` it replaces the benchmark text. > Help text: Passing a prompt string triggers a direct inference, loading the model, outputs the response to stdout and exits. Can be used alone or with benchmark. ### `--quantkv` Value: `[quantization level f16/bf16/q8_0/q5_1/q4_0]` · Default: `f16` · Launcher: Context → Quantize KV Cache Compresses the context (KV) cache to save memory, which allows longer contexts. Options are `f16` (default), `bf16`, `q8_0`, `q5_1` and `q4_0`. Without flash attention only part of the cache is compressed (except `bf16`). The numeric values are legacy: `1` = q8\_0, `2` = q4\_0, `3` = bf16. > Help text: Sets the KV cache data type quantization, options are f16/bf16/q8\_0/q5\_1/q4\_0. Requires Flash Attention for full effect, otherwise only K cache is quantized. ### `--quiet` Launcher: Quick Launch → Quiet Mode Hides prompts and generated text from the terminal output. Useful for privacy on shared servers. `--debugmode` turns it off. > Help text: Enable quiet mode, which hides generation inputs and outputs in the terminal. Quiet mode is automatically enabled when running a horde worker. ### `--ratelimit` Value: `[seconds]` · Launcher: Network → IP Rate Limiter (s) Limits each IP address to one generation request every N seconds. Faster requests get an HTTP 503 error. `0` (default) means no limit. > Help text: If enabled, rate limit generative request by IP address. Each IP can only send a new request once per X seconds. ### `--reasoningeffort` Value: `default | none | low | medium | high | xhigh` · Default: `default` · Launcher: Context → Think Effort Sets a default reasoning effort for thinking models; values sent in requests override it. On a normal command-line launch this flag currently has no effect; it only works through the launcher (`--showgui`). Use `--gendefaults '{"reasoning_effort":"low"}'` instead. `xhigh` sets no thinking limit. > Help text: A quick way to set the default reasoning effort. API values override this. ### `--remotetunnel` Launcher: Quick Launch → Remote Tunnel Creates a public Cloudflare URL so you can reach KoboldCpp from anywhere, even behind a firewall. KoboldCpp downloads `cloudflared` and prints a `trycloudflare.com` link. Anyone with the link can use your instance, so set `--password`; image generation stays open even then. It is skipped with `--prompt`, `--benchmark` and `--cli`. > Help text: Uses Cloudflare to create a remote tunnel, allowing you to access koboldcpp remotely over the internet even behind a firewall. ### `--ropeconfig` Value: `[rope-freq-scale] [rope-freq-base]` · Default: `[0.0, 10000.0]` · Launcher: Context → RoPE Scale and Base (with Custom RoPE Config and Manual Rope Scale ticked) Sets custom RoPE scaling (frequency scale and base) to stretch a model beyond its trained context. By default KoboldCpp scales automatically, and GGUF models with their own RoPE settings keep them. The custom values only apply if the scale is above 0; to change only the base, use scale `1.0`. `--overridenativecontext` takes priority. > Help text: If set, uses customized RoPE scaling from configured frequency scale and frequency base (e.g. --ropeconfig 0.25 10000). Otherwise, uses NTK-Aware scaling set automatically based on context size. For linear rope, simply set the freq-scale and ignore the freq-base ### `--savedatafile` Value: `[savefile]` · Launcher: Loaded Files → SaveData File Creates or opens a file on the server where KoboldAI Lite users can save and load their stories. `.jsondb` is added to the name if missing. It holds 12 slots of up to 10 MB each. If `--password` is set, saving and loading need it. > Help text: If enabled, creates or opens a persistent database file on the server, that allows users to save and load their data remotely. A new file is created if it does not exist. ### `--singleinstance` Launcher: Admin → SingleInstance Mode Lets a new KoboldCpp started on the same port shut this one down, so two servers never clash. Both the old and the new instance need the flag. Don't combine it with `--remotetunnel`. > Help text: Allows this KoboldCpp instance to be shut down by any new instance requesting the same port, preventing duplicate servers from clashing on a port. ### `--smartcache` Value: `limit` · Launcher: Context → Use SmartCache Saves snapshots of the context cache in RAM so switching between chats needs less reprocessing. The flag alone or `1` keeps 5 snapshots; a higher number sets how many. It needs fast forwarding and turns off `--parallelrequests` batching. It turns on automatically for recurrent and hybrid models while fast forwarding and context shifting are on. > Help text: Enables intelligent context switching by saving KV cache snapshots to RAM. Requires fast forwarding. ### `--smartcontext` Launcher: Context → Use SmartContext Outdated method that reserves part of the context to reprocess less often. Has no effect while context shifting is on; use context shifting instead. > Help text: Reserving a portion of context to try processing less frequently. Outdated. Not recommended. ### `--splitmode` Also: `-sm`, `--split-mode` · Value: `[split mode]` · Default: `splitmode_choices[0]` · Launcher: Hardware → SplitMode How the model is split across several GPUs: by `layer` (default) or by `tensor`. `row` was removed and now uses `tensor` with a warning. > Help text: How to split the model across multiple GPUs ### `--ssl` Value: `[cert_pem] [key_pem]` · Launcher: Network → SSL Cert and SSL Key Serves KoboldCpp over HTTPS using your certificate and key files. Give two unencrypted PEM files: `--ssl cert.pem key.pem`. If a file is missing, KoboldCpp prints a warning and keeps running over plain HTTP. The `SSL configuration is valid` line only means both files exist; a file with an invalid certificate or key can still stop KoboldCpp from starting. > Help text: Allows all content to be served over SSL instead. A valid UNENCRYPTED SSL cert and key .pem files must be provided ### `--swapadding` Value: `int` · Launcher: Context → SWA Padding Tokens Adds extra room to the sliding-window (SWA) cache so you can edit or regenerate further back before a full reprocess. Uses more memory. Ignored with `--noswa`. > Help text: How much extra to pad the SWA KV cache, this affects the rewind limit before reprocessing is forced. ### `--unpack` Value: `destination` · Launcher: Extra → Unpack KoboldCpp To Folder Extracts the files bundled inside the KoboldCpp executable into a folder, then exits. The target folder must be empty or not exist yet. > Help text: Extracts the file contents of the KoboldCpp binary into a target directory. ### `--usemtp` Launcher: Loaded Files → Use MTP Uses the model's built-in multi-token prediction (MTP) layers for speculative decoding, if it has them. `--draftmodel` takes priority if both are set. Turns off `--parallelrequests` batching. > Help text: Enables MTP layers to be used for drafting (speculative decoding) if present ### `--usemlock` Also: `--mlock` · Launcher: Hardware → Use mlock Locks the model in RAM so the operating system cannot swap it to disk. Ignored when `--usedirectio` is set. > Help text: Enables mlock, preventing the RAM used to load the model from being paged out. Not usually recommended. ### `--usemmap` Launcher: Quick Launch → Use MMAP Loads the model with memory mapping (mmap), which is off by default in KoboldCpp. llama.cpp uses mmap by default; KoboldCpp does not. Cannot be combined with `--usedirectio`. > Help text: If set, uses mmap to load model. ### `--usedirectio` Also: `--directio`, `--direct-io`, `-dio` · Launcher: Hardware → Direct I/O Loads the model with direct I/O, which can speed up the first load on some drives. Only has an effect on Linux, and falls back to normal loading if direct I/O is not possible. Cannot be combined with `--usemmap`. > Help text: Use direct I/O to load GGUF models if available. May improve cold-load times on some storage. ### `--visionmaxres` Value: `[max px]` · Default: `1024` · Launcher: Loaded Files → Vision MaxRes The largest image resolution passed to a vision model, in pixels (default 1024). Values outside 512 to 2048 are clamped. > Help text: Clamp MMProj vision maximum allowed resolution. Allowed values are between 512 to 2048 px (default 1024). ### `--visionmaxtokens` Also: `--image-max-tokens` · Value: `[tokens]` · Default: `-1` · Launcher: Loaded Files → V.Min/Max Tok (second box) Overrides the maximum number of tokens an image may use in a vision model. `-1` uses the model's default. If you set only this value, the minimum is set to the same number. The actual token count still depends on the model's image processing, and some vision models ignore these limits. > Help text: Override the maximum tokens for the MMProj embedding (default -1). ### `--visionmintokens` Also: `--image-min-tokens` · Value: `[tokens]` · Default: `-1` · Launcher: Loaded Files → V.Min/Max Tok (first box) Overrides the minimum number of tokens an image uses in a vision model. `-1` uses the model's default. If you set only this value, the maximum is set to the same number. > Help text: Override the minimum tokens for the MMProj embedding (default -1). ### `--websearch` Launcher: Network → Enable WebSearch Enables the built-in web search proxy used by KoboldAI Lite's web search option. Searches go through DuckDuckGo. If `--password` is set, the search endpoint needs it. > Help text: Enable the local search engine proxy so Web Searches can be done. ### `--showgui` Opens the full launcher, pre-filled with your command-line flags or config, instead of starting right away. Works with any flags, not only with `.kcpps` files. Handy for adjusting a saved config visually. > Help text: Always show the GUI instead of launching the model right away when loading settings from a .kcpps file. ### `--skiplauncher` Asks KoboldCpp not to show the graphical launcher. Any command-line flag already skips the full launcher. Without a model, a file picker still appears on a desktop, and on a system without a display KoboldCpp exits with an error. Pass a model flag such as `--model` with it, or `--nomodel` to start without one. > Help text: Doesn't display or use the GUI launcher. Overrides showgui. ## Horde Worker ### `--hordemodelname` Value: `[name]` · Launcher: Horde Worker → Horde Model Name The model name your AI Horde worker advertises. It also renames the model in KoboldCpp's own APIs (`/api/v1/model`, `/v1/models`). Setting a Horde model name, worker name or API key reduces terminal output. > Help text: Sets your AI Horde display model name. ### `--hordeworkername` Value: `[name]` · Launcher: Horde Worker → Horde Worker Name The name of your AI Horde worker. The worker only starts when both this and `--hordekey` are set. > Help text: Sets your AI Horde worker name. ### `--hordekey` Value: `[apikey]` · Launcher: Horde Worker → API Key (If Embedded Worker) Your AI Horde API key, used to run KoboldCpp as a Horde worker. The worker only takes Horde jobs after 20 seconds without local requests. The key is stored in plain text in saved `.kcpps` files, so do not share those. > Help text: Sets your AI Horde API key. ### `--hordemaxctx` Value: `[amount]` · Launcher: Horde Worker → Max Context The largest context your Horde worker accepts from a job. `0` uses `--contextsize`; it can never exceed it. It also changes the value reported by `/api/v1/config/max_context_length`. > Help text: Sets the maximum context length your worker will accept from an AI Horde job. If 0, matches main context limit. ### `--hordegenlen` Value: `[amount]` · Launcher: Horde Worker → Gen. Length The most tokens your Horde worker generates per job. `0` means 1024. It also changes the value reported by `/api/v1/config/max_length`. > Help text: Sets the maximum number of tokens your worker will generate from an AI horde job. ## Image Generation ### `--sdaudiovae` Value: `[filename]` · Launcher: Image Gen → Audio VAE The audio VAE file for LTX 2.3 video generation. > Help text: Specify an image generation audio VAE for LTX2.3 video generation. ### `--sdclamped` Value: `[maxres]` · Launcher: Image Gen → Clamp Resolution (Hard) Limits the longest side of generated images, for shared instances. The flag alone means 512; the other side is scaled to keep the aspect ratio. The help is wrong on two points: it does not limit steps, and the minimum is 64 px, not 512. > Help text: If specified, limit generation steps and image size for shared use. Accepts an extra optional parameter that indicates maximum resolution (eg. 768 clamps to 768x768, min 512px, disabled if 0). ### `--sdclampedsoft` Value: `[maxres]` · Launcher: Image Gen → (Soft), next to Clamp Resolution (Hard) Limits the total pixel area of generated images to save memory, while allowing any aspect ratio. `640` allows 640×640 or the same area in other shapes. `0` still applies a model default (832 for SD1.x/2.x, 1024 for others); the maximum is 2048. > Help text: If specified, limit max image size to curb memory usage. Similar to --sdclamped, but less strict, allows trade-offs between width and height (e.g. 640 would allow 640x640, 512x768 and 768x512 images). ### `--sdclip1` Also: `--sdclipl` · Value: `[filename]` · Launcher: Image Gen → Clip-1 File The first separate encoder file for image models that ship without one built in: Clip-L for SD3 or Flux, or the vision encoder for WAN or Qwen-Image. .gguf files work too, not only safetensors. > Help text: Specify first safetensors Clip model (SD3 or Flux Clip-L, WAN or QwenImg vision). Leave blank if prebaked or unused. ### `--sdclip2` Also: `--sdclipg` · Value: `[filename]` · Launcher: Image Gen → Clip-2 File The second separate text-encoder file for image models that need one (e.g. Clip-G for SD3). Some other model families also use this slot. .gguf files work too. > Help text: Specify second safetensors Clip model (SD3 Clip-G). Leave blank if prebaked or unused. ### `--sdclipdevice` Value: `[Device ID]` · Launcher: Image Gen → CLIP dev Where the image model's text encoders run: `CPU` (default), `main` GPU or a GPU number. Unrecognised values silently mean the main GPU. > Help text: CLIP / T5 / LLM device for image generation. GPU index, -1 or 'main' for the main GPU, or 'CPU' (default: CPU). ### `--sdconvdirect` Value: `off | vaeonly | full` · Default: `sd_convdirect_choices[0]` · Launcher: Image Gen → Conv2D Direct Enables direct 2D convolution for image generation, which may speed it up or save memory. `off` (default), `vaeonly` or `full`. May crash on backends that do not support it. > Help text: Enables Conv2D Direct. May improve performance or reduce memory usage. Might crash if not supported by the backend. Can be 'off' (default) to disable, 'full' to turn it on for all operations, or 'vaeonly' to enable only for the VAE. ### `--sdflashattention` Launcher: Image Gen → SD Flash Attention Enables flash attention for image generation. Independent of the text model's flash attention setting. > Help text: Enables Flash Attention for image generation. ### `--sdlora` Value: `[filename]` · Launcher: Image Gen → Image LoRAs Image-generation LoRA files to apply, or a folder of LoRAs to choose from per request. With a folder, LoRAs are picked in the prompt with ``. Up to 10 files are applied; a file with a non-zero multiplier is fixed and cannot be changed per request. Cannot be combined with `--sdquant` on the command line. > Help text: Specify image generation LoRAs safetensors models to be applied. Multiple LoRAs are accepted. ### `--sdloramult` Value: `[amounts]` · Default: `[1.0]` · Launcher: Image Gen → Multiplier Strength of each image LoRA, in the same order as `--sdlora`. Missing entries reuse the first multiplier. A multiplier of `0` leaves that LoRA adjustable per request. > Help text: Multipliers for the image LoRA model to be applied. ### `--sdmaingpu` Value: `[Device ID]` · Launcher: Image Gen → ImgGPU Which GPU holds the image model: `main` (default), a GPU number, or `CPU`. Unrecognised values silently mean the main GPU. > Help text: If specified, Image Generation weights will be placed on the selected GPU index. GPU index, -1 or 'main' for the main GPU, or 'CPU' (default: 'main') ### `--sdmodel` Value: `[filename]` · Launcher: Image Gen → Image Model The image generation model (safetensors or GGUF) to load; this is what turns image generation on. The server can start with only this flag, without a text model. A missing file stops startup unless `--ignoremissing` is set. > Help text: Specify an image generation safetensors or gguf model to enable image generation. ### `--sdoffloadcpu` Launcher: Image Gen → Model Offload Keeps image model weights in system RAM and moves them to VRAM only when needed, to save VRAM. > Help text: Offload image weights in RAM to save VRAM, swap into VRAM when needed. ### `--sdphotomaker` Value: `[filename]` · Launcher: Image Gen → PhotoMaker Loads a PhotoMaker model for face cloning with SDXL models; input images are then used as face references instead of for img2img. > Help text: PhotoMaker is a model that allows face cloning. Specify a PhotoMaker safetensors model which will be applied replacing img2img. SDXL models only. Leave blank if unused. ### `--sdquant` Value: `[quantization level 0/1/2]` · Launcher: Image Gen → Compress Weights Compresses the image model while loading to save memory: `1` = q8, `2` = q4. The flag alone means `2`. Loading a model that is already quantized is faster. Cannot be combined with `--sdlora` on the command line. > Help text: If specified, loads the model quantized to save memory. 0=off, 1=q8, 2=q4 ### `--sdllm` Value: `[filename]` · Launcher: Image Gen → Image LLM The text encoder or LLM file needed by image models such as Flux, Qwen-Image or Z-Image. The terminal labels it `T5-XXL` even when it is an LLM. > Help text: Specify an image generation text encoder or LLM (.safetensors or .gguf). Leave blank if prebaked or unused. ### `--sdthreads` Value: `[threads]` · Launcher: Image Gen → ImgThreads How many CPU threads image generation uses. `0` uses the same value as `--threads`. > Help text: Use a different number of threads for image generation if specified. Otherwise, has the same value as --threads. ### `--sdtiledvae` Value: `[maxres]` · Default: `512` · Launcher: Image Gen → VAE Tiling Threshold Decodes images larger than this size (default 512) in tiles to save memory. Tiling starts when width × height is larger than this value squared. `0` disables tiling. `--sdvaeauto` always disables it. > Help text: Adjust the automatic VAE tiling trigger for images above this size. 0 disables vae tiling. ### `--sdupscaler` Value: `[filename]` · Launcher: Image Gen → Upscaler Loads an ESRGAN upscaler model for enlarging generated images. Needs `--sdmodel`. > Help text: You can use ESRGAN as an upscaling model to resize images. Leave blank if unused. ### `--sdvae` Value: `[filename]` · Launcher: Image Gen → Image VAE Replaces the image model's built-in VAE with a separate VAE file. .gguf files work too. Cannot be combined with `--sdvaeauto`. > Help text: Specify an image generation safetensors VAE which replaces the one in the model. ### `--sdvaeauto` Launcher: Image Gen → Automatic VAE (TAE SD) Uses a small built-in VAE (TAESD) that decodes images much faster and can replace a broken VAE. Disables VAE tiling. Cannot be combined with `--sdvae`. > Help text: Uses a built-in tiny VAE via TAE SD, which is very fast, and fixed bad VAEs. ### `--sdvaedevice` Value: `[Device ID]` · Launcher: Image Gen → VAE dev Where the image VAE runs: `main` GPU (default), a GPU number, or `CPU`. > Help text: VAE device for image generation. GPU index, -1 or 'main' for the main GPU, or 'CPU' (default: main). ### `--sdvramlimit` Value: `[limit MB]` · Launcher: Image Gen → VRAM Limiter (MB) Caps how much VRAM image generation may use, in MB. `0` (default) means no limit. > Help text: If set, prevent VRAM usage from image gen from using more than this many MB. ## Whisper Transcription ### `--whispermodel` Value: `[filename]` · Launcher: Audio → Whisper Model (Speech-To-Text) Loads a Whisper model to turn speech into text. The server can start with only this flag, without a text model. > Help text: Specify a Whisper .bin model to enable Speech-To-Text transcription. ## TTS Narration ### `--ttsmodel` Value: `[filename]` · Launcher: Audio → TTS Model (Text-To-Speech) Loads a text-to-speech (TTS) model so KoboldCpp can read text aloud. The model type is detected automatically. OuteTTS models also need `--ttswavtokenizer`. The server can start with only this flag. > Help text: Specify the TTS Text-To-Speech GGUF model. ### `--ttswavtokenizer` Value: `[filename]` · Launcher: Audio → WavTokenizer Model (Required for some models) The WavTokenizer file that some TTS models need. Required for OuteTTS models. > Help text: Specify the WavTokenizer GGUF model. ### `--ttsgpu` Launcher: Audio → TTS Use GPU Runs the TTS model on the GPU. Only OuteTTS and Qwen3-TTS models use the GPU; other TTS models such as Kokoro always run on the CPU. > Help text: Use the GPU for TTS. ### `--ttsmaxlen` Value: `int` · Default: `4096` · Launcher: Audio → TTS Max Tokens Limits how much audio TTS generates (default and maximum 4096). For OuteTTS it limits audio tokens. For Kokoro-style models it limits the input to the first N words. Qwen3-TTS models ignore it. > Help text: Limit number of audio tokens generated with TTS. ### `--ttsthreads` Value: `[threads]` · Launcher: Audio → TTS Threads How many CPU threads TTS uses. `0` uses the same value as `--threads`. Qwen3-TTS models ignore it. > Help text: Use a different number of threads for TTS if specified. Otherwise, has the same value as --threads. ### `--ttsdir` Value: `[directory]` · Launcher: Audio → TTS Voices Dir A folder of `.wav` and `.mp3` voice samples for voice cloning. Only files directly in the folder are loaded, each as a voice named after its file. Needs `--ttsmodel`. > Help text: Select directory containing voices for voice cloning. ## Music Gen ### `--musicllm` Value: `[filename]` · Launcher: Audio → MusicLLM The music planner language model (e.g. ACE-Step LM) for music generation. Alone it loads in an LLM-only mode. Combined with `--musicdiffusion`, `--musicembeddings` and `--musicvae`, it plans full songs. With embeddings or VAE but no diffusion model, nothing is loaded. > Help text: Select music LLM model (e.g acestep-5Hz-lm-0.6B) ### `--musicembeddings` Value: `[filename]` · Launcher: Audio → MusicEmbeds The embedding model required for music generation. Required with `--musicdiffusion`; without a diffusion model it is not loaded. > Help text: Select music embedding model (e.g Qwen3-Embedding-0.6B) ### `--musicdiffusion` Value: `[filename]` · Launcher: Audio → MusicDiffuser The music diffusion model; this is what turns full music generation on. Also needs `--musicembeddings` and `--musicvae`, or KoboldCpp exits with an error. > Help text: Select music diffusion (DiT) model (e.g acestep-v15-turbo) ### `--musicvae` Value: `[filename]` · Launcher: Audio → MusicVAE The VAE model required for music generation. Required with `--musicdiffusion`. > Help text: Select music VAE model ### `--musiclowvram` Launcher: Audio → Music Low VRAM Unloads the music models between uses and loads them only when needed, to save VRAM. > Help text: Unload music models when not in use ## Embeddings Model ### `--embeddingsmodel` Value: `[filename]` · Launcher: Loaded Files → Embeds Model Loads an embeddings model (GGUF) for creating embedding vectors, e.g. for search or memory features. The server can start with only this flag, without a text model. > Help text: Specify an embeddings model to be loaded for generating embedding vectors. ### `--embeddingsmaxctx` Value: `[amount]` · Default: `4096` · Launcher: Loaded Files → ECtx The longest input the embeddings model accepts (default 4096). The value is capped at the model's trained context; the help's "defaults to trained context" is wrong. `0` uses `--contextsize`, and a negative value uses the trained context. > Help text: Overrides the default maximum supported context of an embeddings model (defaults to trained context). ### `--embeddingsgpu` Launcher: Loaded Files → GPU (next to Embeds Model) Puts the embeddings model on the GPU. Usually not needed. > Help text: Attempts to offload layers of the embeddings model to GPU. Usually not needed. ## RPC ### `--rpcmode` Value: `[disabled/connect/host]` · Default: `disabled` · Launcher: Network → RPC Mode Shares GPUs over the network: `host` offers this machine's devices, `connect` uses remote ones. In `host` mode no model is loaded and no web API starts; if no GPU is found, the CPU is shared. In `connect` mode, list the remote machines with `--rpctargets`. RPC has no authentication, so use it only on a trusted network. > Help text: RPC allows GPUs to be shared over the network. connect=access a remote GPU, host=share your GPU ### `--rpcport` Value: `[portnumber]` · Default: `5551` · Launcher: Network → RPC Host Port The port the RPC server listens on in `host` mode (default 5551). Cannot be combined with `--rpctargets`. > Help text: RPC host mode only. Port for RPC server to listen on (default: 5551). ### `--rpchost` Value: `[IP address]` · Default: `0.0.0.0` · Launcher: Network → RPC Host IP The address the RPC server listens on in `host` mode (default `0.0.0.0`, all interfaces). RPC has no authentication. Use `127.0.0.1` or a private network address, and never expose the RPC port to the internet. > Help text: RPC host mode only. IP address for RPC server to listen on. Use 0.0.0.0 for all interfaces, 127.0.0.1 for localhost only. ### `--rpcdevice` Value: `` · Launcher: Network → RPC Devices Which devices to share in RPC `host` mode, comma-separated. CPU and unknown device names are ignored with an error message, and the devices are then chosen automatically. > Help text: RPC host mode only. Set specific devices to use for RPC server. Comma separated. Overrides normal RPC device choices. ### `--rpctargets` Value: `[remotehost1:port1,remotehost2:port2]` · Launcher: Network → RPC Endpoints The remote RPC servers to use, as `host:port` pairs separated by commas. Requires `--rpcmode connect`; otherwise KoboldCpp exits with an error. > Help text: RPC connect mode only. Specify a comma separated list of remote RPC endpoints to connect to e.g. 127.0.0.1:5551,127.0.0.1:5552 ## Administration ### `--admin` Launcher: Admin → Enable Model Administration Enables admin mode, so you can unload the model or switch to other configs and models without restarting KoboldCpp. Switch targets come from `--admindir` (the program's folder if unset). Always set `--adminpassword` too. > Help text: Enables admin mode, allowing you to unload and reload different configurations or models. ### `--adminpassword` Value: `[password]` · Default: `os.getenv('KCPP_ADMINPASSWORD', None)` · Launcher: Admin → Admin Password The password required for admin functions such as switching or unloading models. Clients send it as `Authorization: Bearer `; it also works in place of the normal `--password`. It can be set with the `KCPP_ADMINPASSWORD` environment variable and is stored in plain text in launcher-saved config files. Use a different value from `--password` for any instance others can reach. > Help text: Require a password to access admin functions. You are strongly advised to use one for publically accessible instances! Can also be set with env var KCPP\_ADMINPASSWORD ### `--admindir` Value: `[directory]` · Launcher: Admin → Config Directory (Required) The folder admin mode offers configs and models from. Lists `.kcpps`, `.kcppt` and `.gguf` files, including one subfolder level. A plain `.gguf` is loaded with default settings or with `--baseconfig`. > Help text: Specify a directory to look for .kcpps configs in, which can be used to swap models. ### `--adminunloadtimeout` Value: `int` · Launcher: Admin → Auto Unload Timeout Unloads the model automatically after this many idle seconds. Only works with `--admin` (or `--routermode`). `0` (default) disables it. In router mode the next request reloads the model. > Help text: Set an idle timeout in seconds after which KoboldCpp will automatically unload the current model. ### `--routermode` Launcher: Admin → Router Mode Puts a proxy in front of KoboldCpp so a request's `model` field can switch to any model or config in `--admindir`. The proxy uses `--port` and the real server moves to a port between 15001 and 15010. It turns on `--admin` automatically. > Help text: Router mode uses a reverse proxy router, allowing you to easily hotswap models and configs within a single request. Requires admin mode. ### `--reqtimeout` Value: `[seconds]` · Default: `600` · Launcher: Network → Request Timeout (s) How long, in seconds, the router-mode proxy waits for the server (default 600). Despite the help text, it only applies with `--routermode`, not to normal requests. > Help text: Timeout in seconds for HTTP requests. ### `--autoswapmode` Launcher: Admin → Autoswap Mode Loads the right kind of model (text, image, speech, TTS, embeddings, music) automatically for each request, from one config. It turns on `--routermode` and `--admin`. It starts with nothing loaded; small model types (see `--autoswapthreshold`) stay loaded alongside the active one. > Help text: Autoswap mode builds on router mode to allow switching of model types within the same config automatically. Requires admin mode and router mode. All models desired must be defined within the same config. ### `--autoswapthreshold` Value: `check_range(int, 0, 1048576)` · Default: `256` · Launcher: Admin → Autoswap Threshold (MB) In autoswap mode, model types whose files total at most this many MB stay loaded (default 256). `0` keeps only the currently needed type loaded. > Help text: Keep model families at or below this combined file size resident in autoswap mode, in MB (default 256). Only one model family above the threshold is loaded at a time. ### `--baseconfig` Value: `value` · Launcher: Admin → Base config .kcpps (Optional, for reloading) A `.kcpps` config applied first when admin mode switches models, with the chosen config or model layered on top. A base config named in the switch request replaces it. Only used with `--admin`. It is not applied when unloading or returning to the initial model. The path is relative to the working directory. > Help text: Specify a base .kcpps config to apply, if no custom base config is selected during a model swap # Admin mode > Switch KoboldCpp models and configs while it runs, from KoboldAI Lite or the API, with router mode, autoswap and automatic unloading. Admin mode lets you switch to another model or config while KoboldCpp keeps running, without going back to the launcher. You pick from a folder of prepared files, in KoboldAI Lite or through the API. On top of admin mode: * **Router mode** switches automatically, based on the model an app asks for. * **Autoswap mode** switches between model types (text, image, speech and so on) based on the request. * **Auto Unload Timeout** frees the memory when nobody has used the model for a while. ## Set up admin mode 1. Create a folder and put the files you want to switch between into it: `.kcpps` configs, `.kcppt` templates or `.gguf` models. Subfolders one level deep are included. 2. In the launcher, open the **Admin** tab. 3. Tick **Enable Model Administration**. 4. Enter an **Admin Password:**. 5. In **Config Directory (Required):**, select your folder. 6. Set up your first model as usual and click **Launch**. On the command line (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --model mymodel.gguf --admin --admindir ./configs --adminpassword mysecret ``` Without a config directory, KoboldCpp uses the folder that contains KoboldCpp itself and prints a warning. Set an admin password Always set **Admin Password:** (`--adminpassword`, or the `KCPP_ADMINPASSWORD` environment variable) when admin mode is on. The admin password also works as a normal API key, so give it only to people who may manage the server. ## Switch models in KoboldAI Lite 1. In KoboldAI Lite, click **Admin** in the top menu. The **KoboldCpp Admin Config** window opens. 2. Under **Select New Model or Config (required):**, choose a file from your folder. 3. Optional: under **Select Base Config (optional):**, choose a config to apply first (see [Base configs](#base-configs)). 4. Click **Reload KoboldCpp**. KoboldCpp restarts with the new settings. If the new config fails to load, it goes back to the one it started with. Besides your files, the list has two special entries: | Entry | What it does | | --------------- | ----------------------------------------------------------- | | `initial_model` | Goes back to the model and settings KoboldCpp started with. | | `unload_model` | Unloads the model and frees its memory. | ### What a switch cannot change Some settings stay as they were at startup, whatever the new config says. These include the port, host, passwords, admin settings (admin mode, config directory, base config, unload timeout, router mode), SSL, **Remote Tunnel**, the download folder and the RPC settings. ## Base configs A base config is applied first, and the chosen config or model is layered on top. This is most useful for plain `.gguf` files: they would otherwise load with default settings. * In Lite, choose it under **Select Base Config (optional):**. It must be in the config directory. * To use one by default, set **Base config .kcpps (Optional, for reloading):** in the launcher (`--baseconfig`). It is used whenever a switch does not name its own base config. ## Unload when idle **Auto Unload Timeout:** (`--adminunloadtimeout`) unloads the model when that many seconds have passed since the last request started. `0` (default) turns it off. It only works in admin mode. The timer does not wait for a reply that is still being written, so set it longer than your slowest replies. In router mode, the next generation request loads a model again: the one named in its `model` field, or the model KoboldCpp started with if the field is empty. A name that is not in the list loads nothing. Without router mode, nothing loads the model again by itself. Generation requests fail until you load a model in the **KoboldCpp Admin Config** window, for example `initial_model`. ## Router mode Router mode lets apps choose the model per request. It works like llama-swap. * Launcher: tick **Router Mode** on the **Admin** tab. It appears once admin mode is on. * Command line: `--routermode`. It turns on admin mode by itself. How it works: * KoboldCpp listens on your usual port through a small proxy. The actual server runs on a free port between 15001 and 15010. * `/v1/models` lists the files in your config directory. * When a generation request names one of those files in its `model` field, KoboldCpp switches to it and then answers. The request waits until the new model is loaded. Ollama requests (`/api/generate`, `/api/chat`) and Anthropic requests (`/v1/messages`) do not switch models. * The name is the file name with its extension, for example `qwen.kcpps`. For files in a subfolder, include the folder exactly as `/v1/models` lists it (`chat/qwen.kcpps`; on Windows with a backslash). `initial_model` and `unload_model` work too. * **Request Timeout (s):** (`--reqtimeout`, default 600) is how long the proxy waits for the server. It is only used in router mode. ## Autoswap mode Autoswap mode switches between model types inside one config, based on what each request needs: text, image, speech-to-text, text-to-speech, embeddings or music. Use it when the models don't all fit in memory at once. * Launcher: tick **Autoswap Mode** on the **Admin** tab. It appears once **Router Mode** is ticked. * Command line: `--autoswapmode`. It turns on router mode and admin mode by itself. * Put all models you want in the same config. * KoboldCpp starts with no model loaded and loads the right one on the first request. * **Autoswap Threshold (MB):** (`--autoswapthreshold`, default 256) keeps model types whose files add up to this size or less loaded at all times. Of the bigger ones, only one is loaded at a time. * With **Auto Unload Timeout:**, all models are unloaded when idle. ## Related settings * **SingleInstance Mode** (`--singleinstance`): a new KoboldCpp started on the same port shuts this one down. Both need the setting. * The admin API (`/api/admin/list_options`, `/api/admin/reload_config`) does the same as the Lite window, for scripts. See [Endpoints](https://koboldcpp.net/docs/api/endpoints/). ## Related * [Config files (.kcpps)](https://koboldcpp.net/docs/settings/config-files/) * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) * [Remote access](https://koboldcpp.net/docs/api/remote-access/) # Command line > Run KoboldCpp without the launcher. Basic commands for Windows, Linux and macOS, the most-used flags, headless modes and exit codes. Everything in the launcher is also a command-line flag. Use the command line to start KoboldCpp from a script, on a server without a screen, or with a screen reader (the launcher is not accessible to screen readers). ## Start with a model When you pass a model, KoboldCpp skips the launcher and starts right away. * Windows Command Prompt ```sh cd C:\mystuff koboldcpp.exe --model C:\models\mymodel.gguf --contextsize 16384 ``` * Linux Terminal ```sh ./koboldcpp-linux-x64 --model mymodel.gguf --contextsize 16384 ``` * macOS Terminal ```sh ./koboldcpp-mac-arm64 --model mymodel.gguf --contextsize 16384 ``` Use the name of the file you downloaded, for example `koboldcpp-nocuda.exe` or `./koboldcpp-linux-x64-nocuda`. Examples on other pages write `koboldcpp` for it. When the model is loaded, the terminal shows `Please connect to custom endpoint at http://localhost:5001`. Open that address in your browser, or add `--launch` to open it automatically. Other ways to start without the launcher: * `--config mysettings.kcpps` starts with a saved config. See [Config files](https://koboldcpp.net/docs/settings/config-files/). * `--model` also accepts a web address; KoboldCpp downloads the file first. * The model file and port also work without flag names: `koboldcpp.exe mymodel.gguf 5002`. ## Get help | Command | What it does | | ----------- | --------------------------------------------------------------------------------------- | | `--help` | Lists all flags with a short description. | | `--version` | Prints the version and exits. It only works on its own; with other flags it is ignored. | The [flag reference](https://koboldcpp.net/docs/reference/flags/) explains every flag in detail. ## Most-used flags | Flag | Launcher | What it does | | ----------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------ | | [`--model`](https://koboldcpp.net/docs/reference/flags/#model) | **GGUF Text Model:** | The model file or web address. | | [`--config`](https://koboldcpp.net/docs/reference/flags/#config) | **Load Config** | Loads a `.kcpps` config or `.kcppt` template. | | [`--contextsize`](https://koboldcpp.net/docs/reference/flags/#contextsize) | **Context Size:** | Context size in tokens. Default 16384. | | [`--usecuda`](https://koboldcpp.net/docs/reference/flags/#usecuda) | **Backend:** Use CUDA | Runs on an NVIDIA card. | | [`--usevulkan`](https://koboldcpp.net/docs/reference/flags/#usevulkan) | **Backend:** Use Vulkan | Runs on most graphics cards. | | [`--usecpu`](https://koboldcpp.net/docs/reference/flags/#usecpu) | **Backend:** Use CPU | Runs without a graphics card. On macOS, also set `--gpulayers 0`. | | [`--gpulayers`](https://koboldcpp.net/docs/reference/flags/#gpulayers) | **GPU Layers:** | Layers on the graphics card. `-1` (default) fits automatically. | | [`--threads`](https://koboldcpp.net/docs/reference/flags/#threads) | **Threads:** | CPU threads. Automatic by default. | | [`--port`](https://koboldcpp.net/docs/reference/flags/#port) | **Port:** | Default 5001. | | [`--host`](https://koboldcpp.net/docs/reference/flags/#host) | **Host:** | Address to listen on. Default: all addresses. `127.0.0.1` allows only this computer. | | [`--launch`](https://koboldcpp.net/docs/reference/flags/#launch) | **Launch Browser** | Opens the browser after loading. Off on the command line, on in the launcher. | | [`--password`](https://koboldcpp.net/docs/reference/flags/#password) | **Password:** | API key for the text endpoints. | | [`--quantkv`](https://koboldcpp.net/docs/reference/flags/#quantkv) | **Quantize KV Cache:** | Stores the context in a smaller format. | | [`--mmproj`](https://koboldcpp.net/docs/reference/flags/#mmproj) | **Mmproj File:** | Vision projector for image input. | | [`--quiet`](https://koboldcpp.net/docs/reference/flags/#quiet) | **Quiet Mode** | Hides generation output. | | [`--debugmode`](https://koboldcpp.net/docs/reference/flags/#debugmode) | **Debug Mode** | Prints extra details for troubleshooting. | Without `--usecuda`, `--usevulkan` or `--usecpu`, KoboldCpp chooses a backend for your hardware. Use the full flag names Many flags also have short llama.cpp-style names, such as `-c` for `--contextsize` or `-ngl` for `--gpulayers`. Together with `--config`, only the full names override the config's values; see [Config files](https://koboldcpp.net/docs/settings/config-files/#change-one-setting-from-the-command-line). ## Passwords from environment variables Passwords can also be set as environment variables instead of flags: | Variable | Same as | | -------------------- | ----------------- | | `KCPP_PASSWORD` | `--password` | | `KCPP_ADMINPASSWORD` | `--adminpassword` | ## Modes without the web server | Flag | What it does | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--cli` | Chat with the model in the terminal. Type `/quit` or `/exit` to end. With `--agent`, it runs the KoboldCpp Agent in the terminal instead, and the web server starts as usual. Cannot be combined with `--launch`, `--nomodel`, `--admin` or `--benchmark`. | | `--prompt "text"` | Generates one reply to the text, prints it and exits. With `--cli`, the text becomes the system prompt instead. | | `--benchmark` | Measures prompt processing and generation speed instead of starting the server. `--benchmark results.csv` appends the results to a file. | The opposite also exists: `--nomodel` starts the web server and KoboldAI Lite without a local model, for use with online services. ## Showing or skipping the launcher * `--showgui` opens the launcher filled in with the flags and config you passed, instead of starting right away. * `--skiplauncher` cancels a `showgui` setting saved in a config. It does not replace a model: without one, KoboldCpp still asks for a file. On a system without a screen, it prints `Note: In order to use --skiplauncher, you need to specify a model with --model` and exits. If you pass flags but no model, KoboldCpp shows a file picker for a model or `.kcpps` file instead of the full launcher. ## Exit codes | Code | When | | ---- | --------------------------------------------------------------------------------------------- | | `0` | `--version` printed the version. | | `1` | The port is already in use (`no socket could bind`). This happens after the model has loaded. | | `2` | A flag or value is invalid, for example a context size outside 256 to 524288. | | `2` | The model file does not exist (`Cannot find text model file`). | | `2` | `--skiplauncher` without a model, on a system without a screen. | ## Related * [Config files (.kcpps)](https://koboldcpp.net/docs/settings/config-files/) * [Launcher tour](https://koboldcpp.net/docs/settings/launcher-tour/): every launcher setting and its flag * [Flag reference](https://koboldcpp.net/docs/reference/flags/) # Config files (.kcpps) > Save KoboldCpp launcher settings to a .kcpps file, load them again, and override single settings from the command line. A `.kcpps` file stores all launcher settings: model, backend, context size, network and everything else. Save one to reuse your setup, move it to a new KoboldCpp version, or start KoboldCpp without the launcher. ## Save and load in the launcher * **Save Config** writes all current settings to a `.kcpps` file. * **Load Config** fills the launcher with the settings from a `.kcpps` file (or a `.kcppt` [template](https://koboldcpp.net/docs/settings/templates/)). It does not launch; check the settings, then click **Launch**. Selecting a `.kcpps` file in a model field (for example with **Browse** next to **GGUF Text Model:**) loads it as a config too. The launcher does not remember settings between runs. To keep them, use **Save Config**. ### Old config files An old config with `"flashattention": false` or `"useswa": false` turns flash attention or SWA off, although both are on by default now. After updating, load the config, tick **Use FlashAttention** and **Allow SWA**, and save it again. ## Start with a config These start KoboldCpp with the saved settings, without the launcher: * **Drag the file onto the KoboldCpp exe.** * **Command line:** `--config`. - Windows Command Prompt ```sh C:\mystuff\koboldcpp.exe --config mysettings.kcpps ``` - Linux Terminal ```sh ./koboldcpp-linux-x64 --config mysettings.kcpps ``` - macOS Terminal ```sh ./koboldcpp-mac-arm64 --config mysettings.kcpps ``` The file name also works without `--config`: `koboldcpp.exe mysettings.kcpps`. `--config` also accepts an `http://` or `https://` URL that ends in `.kcpps` or `.kcppt`; KoboldCpp downloads the file first. The examples below write `koboldcpp` for your KoboldCpp file. To open a config in the launcher and change it before launching, add `--showgui`: Terminal ```sh koboldcpp --config mysettings.kcpps --showgui ``` On Windows, **Register** on the **Extra** tab makes `.kcpps` files open with KoboldCpp. Opening a file starts KoboldCpp with it right away; the file's **Edit** action opens it in the launcher instead. ## Change one setting from the command line Flags after `--config` override the value in the file. The terminal confirms each one with `Overriding Config Value: `. Terminal ```sh koboldcpp --config mysettings.kcpps --contextsize 4096 ``` Only the exact flag name overrides The override works only when you write the flag exactly as the setting is named in the file, with two dashes (`--contextsize`). Short or alternative spellings (`-c`, `--ctx-size`) and the `--flag=value` form are ignored without a warning, and the value from the file stays. Tested with a config saved with context size 2048: | Added to `--config` | Context size used | | -------------------- | ----------------- | | `--contextsize 4096` | 4096 | | `--ctx-size 4096` | 2048 | | `-c 4096` | 2048 | | `--contextsize=4096` | 2048 | Other rules: * `--model` overrides the model in the file. * `--port 5001` does not override a different port saved in the file, because 5001 is the default. Change the port in the file, or in the launcher with `--showgui`. * `--help` says other arguments are ignored when you use `--config`. The rule above is what actually happens. ## Create a config from the command line `--exportconfig` writes the given flags to a `.kcpps` file and exits without loading anything. `.kcpps` is added to the name if missing. Terminal ```sh koboldcpp --model mymodel.gguf --contextsize 8192 --exportconfig mysettings ``` The file stores the flags as given. Values KoboldCpp works out at launch, such as automatic GPU layers or the automatically chosen backend, are not in it. ## What is stored A `.kcpps` file is plain JSON. It has one entry per command-line setting, named like the flag without dashes, for example `contextsize`, `gpulayers` or `model_param` (the model). * **Passwords are stored as plain text.** This includes **Password:** and **Admin Password:**. Don't share `.kcpps` files that contain them. To share a setup, export a [template](https://koboldcpp.net/docs/settings/templates/) instead. It removes the passwords and resets most PC-specific settings, but local file paths stay in it, so check the file before you share it. * These are never stored: `--config`, `--exportconfig`, `--exporttemplate`, `--analyze`, `--unpack`, `--version` and `--allow-config-onready`. ## Advanced ### Shell commands in configs `--onready` runs a shell command after the model has loaded. A config file can contain one, so KoboldCpp ignores `onready` from a config unless you also pass `--allow-config-onready` on the command line. Only use that flag with configs you trust. A config cannot turn it on by itself. ### Errors | Message | Cause | | ------------------------------------------------------------- | ----------------------------------------------------------------- | | `Specified kcpp config file invalid or not found.` | The file does not exist, or the URL could not be downloaded. | | A long Python error mentioning `json` | The file exists but is not valid JSON, usually after a hand edit. | | `The selected config file seems to be invalid.` (Load Config) | The file is missing, nearly empty, or larger than 50 MB. | ## Related * [Templates (.kcppt)](https://koboldcpp.net/docs/settings/templates/) * [Command line](https://koboldcpp.net/docs/settings/command-line/) * [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/): switch between configs while KoboldCpp runs # Context size > What KoboldCpp's context size does, its default of 16384 and its range, how it uses memory, and how ContextShift, FastForwarding and SWA reuse it. The context size is how much text the model can keep in mind at once: your prompt, the conversation so far and the reply. It is counted in tokens (pieces of words). A bigger context lets the model remember more of a long chat or story, but uses more memory. | Setting | Details | | ------------ | ------------------------------------------------------------------------------------------ | | Launcher | **Context Size:** slider on the **Quick Launch** and **Context** tabs (both move together) | | Command line | `--contextsize N` (also `--ctx-size`, `-c`) | | Default | 16384 tokens | ## Choosing a value * Each model supports a maximum context. The model card on Hugging Face usually states it. Stay at or below it. * KoboldCpp does not lower your setting to fit the model. If you set more than the model was trained for, the terminal shows a `possible training context overflow` warning while loading. * More context needs more memory. If the model no longer fits, see [Memory](#memory) below. ## KoboldAI Lite The launcher setting is how much context KoboldCpp reserves. KoboldAI Lite has its own **Context Size** setting for how much text it sends: **Settings** → **Samplers** → **Context Settings**. * When KoboldCpp's context is 16384 or more, the Lite that comes with KoboldCpp raises its own value to match when it connects. * Below 16384 (for example with the `LowSpec-Chatbot` template, which uses 12288), or after you lowered it yourself, set Lite's **Context Size** by hand. * If an app asks for more context than KoboldCpp reserved, KoboldCpp cuts the request down to fit and prints a warning once. ## Memory The context is stored in the **KV cache**, which comes on top of the memory for the model itself. On most models it grows in step with the context size: twice the context, twice the KV cache. Models with SWA (see below) need less. KV cache of Qwen3-VL-8B (no SWA), measured on KoboldCpp 1.122.1 with a Radeon RX 7600 XT: | Context | `--quantkv` | KV cache | | --------------- | ----------- | -------- | | 8192 | `f16` | 1188 MiB | | 16384 (default) | `f16` | 2340 MiB | | 16384 (default) | `q8_0` | 1243 MiB | | 32768 | `f16` | 4644 MiB | If you run out of memory: | What to change | Launcher | Flag | | ------------------------------------- | -------------------------------------------------------- | ----------------------------- | | Lower the context size | **Context Size:** | `--contextsize` | | Store the context in a smaller format | **Quantize KV Cache:** (Context tab) | `--quantkv` | | Lower the batch size | **Batch Size:**, **Physical Batch Size:** (Hardware tab) | `--batchsize`, `--ubatchsize` | `--quantkv` accepts `f16` (default), `bf16`, `q8_0`, `q5_1` and `q4_0`. Full KV quantization needs flash attention, which is on by default. With flash attention off (`--noflashattention`), only the K half of the cache is quantized, and it can even use more graphics memory. Older guides use numbers; they still work: `0` = `f16`, `1` = `q8_0`, `2` = `q4_0`, `3` = `bf16`. See [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/) and [Memory](https://koboldcpp.net/docs/models/memory/) for more. ## Reusing context between requests Each reply normally requires the model to read the whole prompt again. KoboldCpp has several ways to avoid that. The defaults work well; leave **Use FastForwarding** and **Use ContextShift** on. On some models, including Gemma 3 and Qwen3-VL, KoboldCpp turns ContextShift off by itself (see below). | Launcher (Context tab) | Flag | Default | What it does | | ------------------------------------ | ------------------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | | **Use FastForwarding** | `--nofastforward` turns it off | on | Reuses the start of the prompt that has not changed since the last request. | | **Use ContextShift** | `--noshift` turns it off | on | When the context is full, drops the oldest text and keeps the rest instead of reprocessing everything. | | **Allow SWA** | `--noswa` turns it off | on | On models with sliding window attention (SWA), such as Gemma 3, uses a much smaller KV cache. | | **Use SmartCache** / **CacheSlots:** | `--smartcache [slots]` | off | Keeps snapshots of recent contexts in RAM (5 slots by default), so switching back to a recent chat needs little or no reprocessing. | | **Use SmartContext** | `--smartcontext` | off | Outdated and not recommended. Only shown when ContextShift is off. | How they depend on each other: * ContextShift and SmartCache need FastForwarding. Turning FastForwarding off turns them off too; in the launcher, turning ContextShift on turns FastForwarding back on. * **SWA and ContextShift do not work together.** On SWA models, KoboldCpp uses SWA and turns ContextShift off; the terminal shows `SWA Mode is ENABLED!`. To use ContextShift on such a model instead, turn off **Allow SWA**. This makes the KV cache much bigger. * ContextShift is also turned off when **Parallel Requests:** (`--parallelrequests`) is above 1, and on models that use MRoPE position encoding, such as Qwen2-VL, Qwen3-VL and Qwen3.5. The terminal then shows `MRope is used, context shift will be disabled!`. * SmartContext has no effect while ContextShift is active. In a test with Gemma 3 270M at the default context, the SWA part of the KV cache used 16.88 MiB with SWA and 243.75 MiB without it. ## Advanced * **Range.** The launcher slider goes from 256 to 262144; the command line accepts 256 to 524288. For more than 262144, use `--contextsize`, or set it in a [config file](https://koboldcpp.net/docs/settings/config-files/) and start that with `--config`. The launcher cannot load a config whose context size is not one of its slider steps. * **The load log shows a slightly bigger number.** At the default 16384, the log reads `n_ctx = 16640`. KoboldCpp adds a small margin and rounds up. The API still reports 16384. * **SWA padding.** **SWA Padding Tokens:** (`--swapadding`) adds room to the SWA cache. More padding lets the chat change further back before KoboldCpp has to reprocess it. * **The default reply length is capped at half the context.** **Default Gen Amt:** (`--defaultgenamt`, default 2048) is lowered to half the context size if it is bigger. * **The KoboldCpp Agent needs a large context.** With **Launch KoboldCpp Agent** (`--agent`), KoboldCpp raises the context to at least 28672 and the default reply length to at least 8192 on its own. * **Old model formats.** Models in the old GGML formats (not GGUF) are limited to 16384. * **Checking the value.** The API endpoint `/api/extra/true_max_context_length` returns the reserved context size. ## Related * [Launcher tour](https://koboldcpp.net/docs/settings/launcher-tour/) * [Config files](https://koboldcpp.net/docs/settings/config-files/) * [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/) # Launcher tour > A tour of the KoboldCpp launcher's ten tabs and bottom buttons, with the most important fields on each tab and their command-line flags. The launcher is the settings window that opens when you start KoboldCpp without a model. It has a column of tabs on the left and the settings of the active tab on the right. Hover over a label to see its tooltip. For most people, the **Quick Launch** tab is all they need. The other tabs hold the same settings in more detail, plus extra features. Each setting also exists as a command-line flag. The tables below list both; see [Command line](https://koboldcpp.net/docs/settings/command-line/) and the [flag reference](https://koboldcpp.net/docs/reference/flags/). Note The launcher is not accessible to screen readers. Everything in it is also available from the [command line](https://koboldcpp.net/docs/settings/command-line/). ## Bottom buttons | Button | What it does | | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Update** | Opens the latest release on GitHub in your browser. It does not update anything by itself; see [Updating](https://koboldcpp.net/docs/install/updating/). | | **Save Config** | Saves all current settings to a `.kcpps` file. The launcher does not remember settings otherwise. See [Config files](https://koboldcpp.net/docs/settings/config-files/). | | **Load Config** | Loads a `.kcpps` config or `.kcppt` template into the launcher. It does not launch. | | **Get Help** | Opens the Help Menu: links to the wiki and starter guides, a Hugging Face model search, and ready-made templates. See [Templates](https://koboldcpp.net/docs/settings/templates/). | | **Launch** | Starts KoboldCpp with the current settings. | If you click **Launch** without a model, KoboldCpp asks whether you want help finding one. **Yes** opens the Help Menu. ## Quick Launch The beginner tab. Pick a model and click **Launch**. [![The Quick Launch tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-start.Dobnsw9D_x7sfC.webp)](https://koboldcpp.net/_astro/launcher-start.Dobnsw9D.png) The **Quick Launch** and **Hardware** screenshots show a PC with an NVIDIA graphics card (**Use CUDA**). With **Use Vulkan** the same GPU fields appear except **Use MMQ**; with **Use CPU** they are hidden. | Label | Flag | What it does | | -------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Backend:** | `--usecuda`, `--usevulkan`, `--usecpu` | Where the model runs. CUDA is for NVIDIA cards and is the fastest. Vulkan works on most graphics cards. The CPU options run without a graphics card; on macOS, also set **GPU Layers:** to 0. KoboldCpp picks one for your hardware until you change it yourself. | | **GPU ID:** | number after `--usecuda` / `--usevulkan` | Which graphics card to use. The card's name appears next to it. | | **GPU Layers:** | `--gpulayers` | How much of the model goes on the graphics card. `-1` (default) fits it automatically. | | **Context Size:** | `--contextsize` | How much text the model keeps in mind. Default 16384. See [Context size](https://koboldcpp.net/docs/settings/context-size/). | | **GGUF Text Model:** | `--model` | The model file. **Browse** picks a file; **HF Search** finds one on Hugging Face. | Checkboxes: | Label | Flag | Default | What it does | | ---------------------- | --------------------------------- | ------- | ----------------------------------------------------------------------------------------------- | | **Launch Browser** | `--launch` | on | Opens KoboldAI Lite in your browser when loading is done. | | **Use MMAP** | `--usemmap` | off | Loads the model with memory mapping. | | **Use ContextShift** | `--noshift` turns it off | on | Avoids reprocessing the whole chat once the context is full. | | **Remote Tunnel** | `--remotetunnel` | off | Creates a public internet URL for this instance. See [Remote access](https://koboldcpp.net/docs/api/remote-access/). | | **Use FlashAttention** | `--noflashattention` turns it off | on | Faster attention that uses less memory. | | **Force AutoFit** | `--autofit` | off | Forces the automatic fit. Hides **GPU Layers:**. Marked experimental. | | **Quiet Mode** | `--quiet` | off | Hides generation output in the terminal. | | **Use Jinja** | `--jinja` | off | Formats chat requests with the model's own chat template. Other endpoints are unaffected. | | **Use MMQ** | `--nommq` turns it off | on | A CUDA option for prompt processing. | ## Hardware Backend and graphics card settings in more detail, plus CPU threads and batch sizes. [![The Hardware tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-hardware.BGGnCafE_Z1CcP4X.webp)](https://koboldcpp.net/_astro/launcher-hardware.BGGnCafE.png) **GPU ID:**, **GPU Layers:**, **SplitMode:**, **Tensor Split:**, **Main GPU:** and **No KV offload** appear with a GPU backend. **Autofit Padding (MB):** appears only with **Force AutoFit**. | Label | Flag | What it does | | ------------------------------------------------ | -------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Backend:**, **GPU ID:**, **GPU Layers:** | see Quick Launch | Same settings as on Quick Launch. | | **SplitMode:**, **Tensor Split:**, **Main GPU:** | `--splitmode`, `--tensor_split`, `--maingpu` | How to share the model across several graphics cards. See [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/). | | **Autofit Padding (MB):** | `--autofitpadding` | Spare graphics memory the automatic fit leaves free. | | **Threads:**, **Batch Threads:** | `--threads`, `--blasthreads` | CPU threads for generating and for prompt processing. Blank means automatic. The launcher fills in **Threads:** with the automatic value for your PC; clear it to keep it automatic in a config you use on another PC. | | **Batch Size:**, **Physical Batch Size:** | `--batchsize`, `--ubatchsize` | How many tokens are processed at once. Smaller values save memory but process prompts more slowly. | | **Device Override** | `--device` | Selects devices by name. | | **No KV offload** | `--lowvram` | Keeps the context memory off the graphics card. Slow. | | **Use mlock** | `--usemlock` | Keeps the model in RAM so the system cannot swap it out. | | **Direct I/O** | `--usedirectio` | Another way to load the model file. | | **Debug Mode** | `--debugmode` | Prints extra information in the terminal. Useful when something goes wrong. | | **High Priority** | `--highpriority` | Asks the system for a higher CPU priority. On Linux it lowers the priority instead. | | **Keep Foreground** | `--foreground` | Windows only: brings the terminal window to the front on each request. | | **CLI Terminal Only** | `--cli` | Chat in the terminal, without the web server. | **Run Benchmark** loads the model, measures prompt processing and generation speed, and prints the results in the terminal instead of starting the server. For help choosing these values, see [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) and [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/). ## Context How much text the model keeps in mind, how KoboldCpp reuses it between requests, and server-wide generation defaults. [![The Context tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-context.D_QfAwNs_Z1pMrA2.webp)](https://koboldcpp.net/_astro/launcher-context.D_QfAwNs.png) | Label | Flag | What it does | | -------------------------------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | | **Context Size:** | `--contextsize` | Same slider as on Quick Launch. Moving one moves the other. | | **Use FastForwarding** | `--nofastforward` turns it off | Reuses the part of the prompt that has not changed. On by default. | | **Use ContextShift** | `--noshift` turns it off | See Quick Launch. | | **Allow SWA** | `--noswa` turns it off | Smaller context memory on models that support it. On by default. | | **Use SmartCache** / **CacheSlots:** | `--smartcache` | Keeps snapshots of recent chats in RAM for quick switching. **CacheSlots:** appears once **Use SmartCache** is ticked. | | **Quantize KV Cache:** | `--quantkv` | Stores the context in a smaller format to save memory. | | **Default Gen Amt:** | `--defaultgenamt` | Reply length when the app does not set one. Default 2048. | | **Prompt Limit:** | `--genlimit` | A hard cap on reply length for every request. | | **Default Params:** / **Override** | `--gendefaults`, `--gendefaultsoverwrite` | Default generation settings for all apps, as JSON. **Override** makes them replace what the app sent. | | **Use Jinja**, **Jinja for Tools**, **Jinja Thinking:**, **Jinja Kwargs:** | `--jinja`, `--jinja_tools`, `--jinjathink`, `--jinja_kwargs` | Chat template options. The other three appear once **Use Jinja** is ticked. | | **Think Effort:** | `--reasoningeffort` | Default reasoning effort for thinking models. Apps can override it. | | **MoE CPU Layers:**, **FFN CPU Layers:** | `--moecpu`, `--ffncpu` | Keep parts of the model in RAM. See [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/). | The tab also has RoPE settings, **No BOS Token**, **Enable Guidance**, **MoE Experts:**, **Override KV:** and **Override Tensors:** for advanced use. All of these are in the [flag reference](https://koboldcpp.net/docs/reference/flags/). Details on the context options: [Context size](https://koboldcpp.net/docs/settings/context-size/). ## Loaded Files Every file KoboldCpp loads for text chat, plus a few related files. [![The Loaded Files tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-loaded-files.BfqgPx7u_SbAJS.webp)](https://koboldcpp.net/_astro/launcher-loaded-files.BfqgPx7u.png) | Label | Flag | What it does | | --------------------------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------- | | **Text Model:** | `--model` | The main model. Same as **GGUF Text Model:** on Quick Launch. | | **Text Lora:** / **Multiplier:** | `--lora`, `--loramult` | A LoRA adapter for the text model. | | **Mmproj File:** | `--mmproj` | The vision projector that lets the model see images. See [Vision](https://koboldcpp.net/docs/features/vision/). | | **Draft Model:** | `--draftmodel` | A small model that speeds up generation (speculative decoding). | | **Embeds Model:** | `--embeddingsmodel` | A model for the embeddings endpoint. See [Embeddings](https://koboldcpp.net/docs/features/embeddings/). | | **Preload Story:** | `--preloadstory` | A story that KoboldAI Lite opens on start. | | **Enable Server Side SaveData File** / **SaveData File:** | `--savedatafile` | Stores KoboldAI Lite saves on the server. See [Multiplayer and saves](https://koboldcpp.net/docs/features/multiplayer-and-saves/). | | **MCP JSON:** | `--mcpfile` | MCP tool servers. See [Web search and MCP](https://koboldcpp.net/docs/features/web-search-and-mcp/). | | **Chat Adapter:** / **Pick Premade** | `--chatcompletionsadapter` | The chat format for the chat completions endpoint. **Pick Premade** lists the bundled formats. | | **Jinja Template:** | `--jinjatemplate` | A custom Jinja chat template file. | | **Download Dir:** | `--downloaddir` | Where downloaded models are saved. | | **Allow Launch Without Models** | `--nomodel` | Starts KoboldAI Lite without a local model, for use with online services. | ## Network How apps and other devices reach KoboldCpp. [![The Network tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-network.Bdbusv5Z_Z2mpV7G.webp)](https://koboldcpp.net/_astro/launcher-network.Bdbusv5Z.png) | Label | Flag | What it does | | ------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Host:** | `--host` | The network address to listen on. Empty (default) means all addresses, so other devices on your network can connect. Enter `127.0.0.1` to allow only this computer. | | **Port:** | `--port` | Default 5001. | | **Remote Tunnel** | `--remotetunnel` | A public internet URL through Cloudflare. | | **Password:** | `--password` | An API key for the text endpoints. | | **SSL Cert:** / **SSL Key:** | `--ssl` | Serves over HTTPS. | | **Shared Multiplayer** | `--multiplayer` | Several people share one story in KoboldAI Lite. | | **Enable WebSearch** | `--websearch` | Lets the model search the web. | | **Multiuser Queue:** | `--multiuser` | How many requests it accepts at once, counting the one that is running. See [Streaming and multiple users](https://koboldcpp.net/docs/api/streaming/#several-users-at-once). | | **Max Req. Size (MB):**, **IP Rate Limiter (s):** | `--maxrequestsize`, `--ratelimit` | Limits for public instances. | | **Parallel Requests:** | `--parallelrequests` | Processes several simple text requests at once. Experimental. Turns off ContextShift. | | **Request Timeout (s):** | `--reqtimeout` | Only used in router mode. See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). | | **RPC Mode:** | `--rpcmode` | Shares or uses graphics cards across computers. See [RPC](https://koboldcpp.net/docs/hardware/rpc/). | Caution **Password:** does not protect the image generation endpoints. Before you use **Remote Tunnel** or open KoboldCpp to your network, read [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Horde Worker Shares your model with the AI Horde, a volunteer network, so other people can use it. [![The Horde Worker tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-horde-worker.yPajpauM_Bznlz.webp)](https://koboldcpp.net/_astro/launcher-horde-worker.yPajpauM.png) | Label | Flag | What it does | | ---------------------------------- | -------------------------------- | -------------------------------------------------------- | | **Configure for Horde** | | Turns on the built-in Horde worker and shows its fields. | | **Horde Model Name:** | `--hordemodelname` | The model name shown on the Horde. | | **Gen. Length:**, **Max Context:** | `--hordegenlen`, `--hordemaxctx` | Limits for Horde requests. | | **API Key (If Embedded Worker):** | `--hordekey` | Your Horde API key. | | **Horde Worker Name:** | `--hordeworkername` | Your worker's name. | See [Horde worker](https://koboldcpp.net/docs/features/horde-worker/). ## Image Gen Loads an image model next to (or instead of) the text model. [![The Image Gen tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-image-gen.CyEyt6K-_24NpV3.webp)](https://koboldcpp.net/_astro/launcher-image-gen.CyEyt6K-.png) The most important field is **Image Model:** (`--sdmodel`). The other fields hold extra files some image models need (**Image LLM:**, **Clip-1 File:**, **Clip-2 File:**, **Image VAE:**), LoRAs, an upscaler, resolution limits and memory options. See [Image generation](https://koboldcpp.net/docs/features/image-generation/). ## Audio Speech-to-text, text-to-speech and music models. [![The Audio tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-audio.BfnSOMCX_1pJlVB.webp)](https://koboldcpp.net/_astro/launcher-audio.BfnSOMCX.png) | Label | Flag | What it does | | ------------------------------------------------------------------ | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Whisper Model (Speech-To-Text):** | `--whispermodel` | Transcribes speech. See [Speech to text](https://koboldcpp.net/docs/features/speech-to-text/). | | **TTS Model (Text-To-Speech):** | `--ttsmodel` | Reads text aloud. Some TTS models also need **WavTokenizer Model (Required for some models):** (`--ttswavtokenizer`). See [Text to speech](https://koboldcpp.net/docs/features/text-to-speech/). | | **MusicLLM:**, **MusicEmbeds:**, **MusicDiffuser:**, **MusicVAE:** | `--musicllm`, `--musicembeddings`, `--musicdiffusion`, `--musicvae` | The files for music generation. See [Music](https://koboldcpp.net/docs/features/music/). | ## Admin Switching models and configs while KoboldCpp runs. [![The Admin tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-admin.l9hBeRCA_Z9LYnr.webp)](https://koboldcpp.net/_astro/launcher-admin.l9hBeRCA.png) | Label | Flag | What it does | | ---------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | | **Enable Model Administration** | `--admin` | Turns on admin mode. | | **Admin Password:** | `--adminpassword` | Protects the admin functions. Set one whenever admin mode is on. | | **Config Directory (Required):** | `--admindir` | The folder with the configs and models you can switch to. | | **Base config .kcpps (Optional, for reloading):** | `--baseconfig` | Settings applied under every switched-to config or model, unless the switch names its own base config. | | **Auto Unload Timeout:** | `--adminunloadtimeout` | Unloads the model after this many idle seconds. | | **Router Mode**, **Autoswap Mode**, **Autoswap Threshold (MB):** | `--routermode`, `--autoswapmode`, `--autoswapthreshold` | Switch models automatically per request. Each appears once the setting before it is ticked, starting with **Enable Model Administration**. | | **SingleInstance Mode** | `--singleinstance` | A new KoboldCpp on the same port can shut this one down. | | **Launch KoboldCpp Agent** | `--agent` | Starts the KoboldCpp Agent when loading is done. See [Agent](https://koboldcpp.net/docs/features/agent/). | See [Admin mode](https://koboldcpp.net/docs/settings/admin-mode/). ## Extra Tools that run right away instead of being launch settings. [![The Extra tab of the KoboldCpp launcher](https://koboldcpp.net/_astro/launcher-extra.ZMwxTwss_1lhSp5.webp)](https://koboldcpp.net/_astro/launcher-extra.ZMwxTwss.png) | Button | Flag | What it does | | ------------------------------ | ------------------ | --------------------------------------------------------------------------------------------------------- | | **Unpack KoboldCpp To Folder** | `--unpack` | Extracts KoboldCpp's files into an empty folder, for faster starts. | | **Generate LaunchTemplate** | `--exporttemplate` | Saves the current settings as a `.kcppt` template for others. See [Templates](https://koboldcpp.net/docs/settings/templates/). | | **Analyze Model** | `--analyze` | Shows the metadata and tensors of a GGUF or safetensors file. | | **Register** / **Unregister** | | Windows only: opens `.gguf`, `.ggml`, `.kcpps` and `.kcppt` files with KoboldCpp. | | **Use Classic FilePicker** | | Linux only: uses the older file dialog. | | **Spawn Terminal** | | Linux only: opens a terminal window that shows KoboldCpp's output. | ## Related * [Context size](https://koboldcpp.net/docs/settings/context-size/) * [Config files (.kcpps)](https://koboldcpp.net/docs/settings/config-files/) * [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) * [Command line](https://koboldcpp.net/docs/settings/command-line/) # Templates (.kcppt) > Use ready-made KoboldCpp templates that download their models for you, load them from the launcher or command line, and create your own. A `.kcppt` template holds launcher settings plus download links for the models. When you launch it, KoboldCpp downloads the files it needs and starts with those settings. Templates are the quickest way to a working setup, including for images, voice and music. A template is a [config file](https://koboldcpp.net/docs/settings/config-files/) meant for sharing. Most settings that depend on your PC are reset, so it works on other computers: * The backend is chosen automatically for your hardware. * GPU layers, threads, main GPU and tensor split are set to automatic. * Passwords, SSL and Horde credentials are removed. **Use MMAP**, **Use mlock** and **Direct I/O** are turned off. * Local file paths, **Download Dir:** and **Device Override** stay as they are. Check them before you share the template. ## Load a template from the launcher 1. Click **Get Help**. 2. Under "Or, Pick an Easy Template for Newbies", choose a category: **Newbie Templates** or **Popular Templates**. 3. Choose a template in the second dropdown. 4. Click **Load Template**. The launcher fills in the settings. 5. Click **Launch**. The download starts now and can take a while. ### Newbie templates Sorted by how much graphics card memory (VRAM) they need: | Prefix | Recommended VRAM | | -------- | ---------------- | | LowSpec | 6 GB | | MidSpec | 12 GB | | HighSpec | 24 GB | | Template | For | | -------------------------------------- | ------------------------------ | | `LowSpec-Chatbot`, `MidSpec-Chatbot` | Chat | | `LowSpec-ImageGen`, `MidSpec-ImageGen` | Image generation | | `LowSpec-MusicGen` | Music generation | | `HighSpec-CodingAgent` | The KoboldCpp Agent for coding | | `HighSpec-VideoGen` | Video generation | `LowSpec-Chatbot`, for example, loads Gemma 3 4B with vision, speech-to-text, text-to-speech and embeddings models, with a context size of 12288. Because that is below 16384, set KoboldAI Lite's **Context Size** to 12288 yourself; see [Context size](https://koboldcpp.net/docs/settings/context-size/#koboldai-lite). The templates live on Hugging Face: [newbie templates](https://huggingface.co/koboldcpp/newbie-templates) and [popular templates](https://huggingface.co/koboldcpp/popular-templates). The popular templates cover more models, such as Qwen3-VL 8B, Gemma 3 12B, and image and video models. More templates are in [koboldcpp/kcppt](https://huggingface.co/koboldcpp/kcppt). ## Other ways to load a template A `.kcppt` file loads like a `.kcpps` config: * **Load Config** in the launcher. * Drag the file onto the KoboldCpp exe. * `--config` with a file name or an `https://` URL (`koboldcpp` stands for your KoboldCpp file; see [Command line](https://koboldcpp.net/docs/settings/command-line/)): Terminal ```sh koboldcpp --config https://huggingface.co/koboldcpp/newbie-templates/resolve/main/LowSpec-Chatbot.kcppt ``` On the command line, the backend is chosen automatically unless you add `--usecuda` or `--usevulkan`. ## Where downloads go KoboldCpp downloads every model field that holds a web address when you launch, not when you load the template. The one exception is **Text Lora:**, which must be a local file. * Files are saved in **Download Dir:** on the **Loaded Files** tab (`--downloaddir`). If that is empty, they go into the current working folder. When you double-click the exe, that is the folder the exe is in. * A file that is already there is reused, so the next launch starts without downloading. * For text models split into several parts (`-00001-of-00003.gguf` and so on), all parts are downloaded. * KoboldCpp downloads with `aria2c` (bundled on Windows), `curl` or `wget`. If none of them works, it asks you to install one. ## Create a template Set everything up in the launcher, then go to the **Extra** tab and click **Generate LaunchTemplate**. The file is saved as `.kcppt`. The chat adapter and preload story files are copied into the template, so it works without them. For a template other people can use, enter web addresses instead of local file paths in the model fields, for example `https://huggingface.co///resolve/main/.gguf`. **HF Search** fills in addresses in this form. From the command line, `--exporttemplate` does the same, but does not copy the chat adapter and preload story files: Terminal ```sh koboldcpp --model https://huggingface.co///resolve/main/.gguf --contextsize 16384 --exporttemplate mytemplate ``` To share a template or report a broken one, use the Discussions page of the [popular templates](https://huggingface.co/koboldcpp/popular-templates) repository. ## Related * [Choose a model](https://koboldcpp.net/getting-started/model/) * [Config files (.kcpps)](https://koboldcpp.net/docs/settings/config-files/) * [Launcher tour](https://koboldcpp.net/docs/settings/launcher-tour/) # Connection and API problems > Fixes for apps and devices that can't reach KoboldCpp, Remote Tunnel errors, broken pipes, 401 Unauthorized, busy server and payload errors. KoboldCpp serves the chat UI and its API on port 5001 by default. When the model has loaded, the console shows the address: ```text Please connect to custom endpoint at http://localhost:5001 ``` ## The browser does not open after loading Open `http://localhost:5001` in any browser yourself. * The launcher opens the browser only while **Launch Browser** is on (the default). On the command line, add `--launch`. * On Linux, KoboldCpp tries `xdg-open` first, then Python's browser launcher. ## An app can't connect 1. Wait until the console shows `Please connect to custom endpoint at …`. The server starts only after the model has loaded. 2. Use the address for the app's API type: | The app speaks | Address | | -------------- | ---------------------------------------------------------------------- | | KoboldAI API | `http://localhost:5001` | | OpenAI API | `http://localhost:5001/v1` | | Ollama API | Start KoboldCpp with `--port 11434`, then use the app's Ollama default | 3. If you changed **Port:** (`--port`), use that port instead of 5001. 4. If you set a password, enter it in the app's API key field. See [below](#401-unauthorized). See [Connect apps](https://koboldcpp.net/docs/api/connect-apps/). ## Other devices on my network can't connect By default KoboldCpp accepts connections on all network interfaces. The console still prints `localhost`, which only works on the PC itself. 1. On the other device, use your PC's local network IP address: `http://:5001`. 2. Allow KoboldCpp through the firewall on the PC. See [Remote access](https://koboldcpp.net/docs/api/remote-access/#same-network). 3. Check that **Host:** on the **Network** tab (`--host`) is empty. With `127.0.0.1`, only the PC itself can connect. Set a password before other people can reach KoboldCpp. See [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/). ## Remote Tunnel fails ```text Error: Could not create cloudflare tunnel! Remote Tunnel Failed! ``` **Remote Tunnel** (`--remotetunnel`) downloads the `cloudflared` program from GitHub on first use and then connects to Cloudflare. Both need internet access. 1. Check your internet connection, and that a firewall or antivirus does not block `cloudflared`. 2. Read the lines after `More Info:` in the console for the reason. 3. Restart KoboldCpp to try again. `Could not create cloudflare tunnel!` appears when no link has arrived after about 15 seconds. If `Your remote tunnel is ready` follows later, the tunnel works. Common causes: | Cause | Fix | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | A firewall blocks `cloudflared`. | Allow outgoing connections on port 7844 (TCP and UDP). | | The download failed. The console shows `Could not find suitable download software, or all download methods failed.` | Check the internet connection. On Linux, install `curl`. | | The saved `cloudflared` file is broken or too old. | Delete it (on a Mac also `cloudflared-darwin-amd64.tgz`). KoboldCpp downloads the latest version on the next launch. | | **Download Dir:** on the **Loaded Files** tab (`--downloaddir`) is set. KoboldCpp then saves `cloudflared` there, but starts it from the folder KoboldCpp was started from. | Leave **Download Dir:** empty when you use **Remote Tunnel**. | | On a Mac with Apple silicon, KoboldCpp downloads the Intel version of `cloudflared`, which needs Rosetta. | Run `softwareupdate --install-rosetta`. | KoboldCpp saves `cloudflared` in the folder you start KoboldCpp from: `cloudflared.exe` on Windows, `cloudflared-linux-amd64` or `cloudflared-linux-arm64` on Linux, `cloudflared` on macOS. It reuses that file on every launch and does not update it. Cloudflare supports `cloudflared` versions up to one year old. See [Remote access](https://koboldcpp.net/docs/api/remote-access/). ## "Network error" or "Broken pipe" during long prompts The app shows `Network error when attempting to fetch resource`, or the console shows `[Errno 32] Broken pipe` and: ```text Generate: The response could not be sent, maybe connection was terminated? ``` The app gave up waiting. This happens most often when a long prompt is processed again near the context limit. 1. Raise the timeout in your app, if it has one. 2. Make processing faster: put more layers on the graphics card. See [GPU not used or slow](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/). 3. Raise **Context Size:**, so the prompt is processed again less often. ## 401 Unauthorized ```json {"detail": {"error": "Unauthorized", "msg": "Authentication key is missing or invalid.", "type": "unauthorized"}} ``` KoboldCpp runs with a password (**Password:**, `--password`), and the request did not send it. 1. Enter the password in the app's API key field. 2. For your own requests, send the header `Authorization: Bearer `. KoboldCpp accepts the key only in the `Authorization` header. Apps built on the Anthropic SDK send `x-api-key`, which KoboldCpp does not accept. Without the key, `/api/v1/model` shows the model name as `koboldcpp/protected-model`. That is expected. `/v1/models` still shows the real name. ## "Server is busy; please try again later." KoboldCpp answers with HTTP 503. It handles one request at a time and queues the others, up to **Multiuser Queue:** (`--multiuser`, default 10) requests in total. This message means the queue is full, or queueing is off (`--multiuser 0`). `--multiuser 0` keeps a queue anyway while an image, Whisper, TTS or embeddings model is loaded, or when **Parallel Requests:** is above 1. With [parallel requests](https://koboldcpp.net/docs/api/streaming/#advanced-parallel-requests), simple text requests can run at the same time. 1. Wait for the running requests to finish. 2. Leave **Multiuser Queue:** at its default, or raise it. With **IP Rate Limiter (s):** (`--ratelimit`) set, too many requests from one address get `You are sending requests too quickly.` instead. ## "Payload is too big" ```text Payload is too big. Max payload size is 32MB. ``` The request, for example with large images, is bigger than the limit. Raise **Max Req. Size (MB):** on the **Network** tab (`--maxrequestsize`, default 32). ## Advanced: SSL does not work ```text Your SSL configuration is INVALID. SSL will not be used. ``` KoboldCpp then serves plain HTTP. 1. Give both files: **SSL Cert:** and **SSL Key:** (`--ssl cert.pem key.pem`), and check that both paths exist. 2. Use an unencrypted key file (no passphrase), in `.pem` format. Certificate errors from the Horde worker, web search or MCP servers are about outgoing connections. **NoCertify Mode (Insecure)** (`--nocertify`) turns off those checks; it does not affect KoboldCpp's own certificate. ## Related * [Connect apps](https://koboldcpp.net/docs/api/connect-apps/) * [Remote access](https://koboldcpp.net/docs/api/remote-access/) * [Passwords and security](https://koboldcpp.net/docs/api/passwords-and-security/) * [Replies are cut short](https://koboldcpp.net/docs/troubleshooting/output-quality/#replies-are-cut-short) # GPU not used or generation slow > Fixes for KoboldCpp ignoring your graphics card, "Unable to detect VRAM", CUDA errors, old NVIDIA cards and slow generation. The console shows which backend KoboldCpp uses and how many layers went to the graphics card. Check it first when replies are slow. ## The graphics card is not used ```text Unable to detect VRAM. Auto Selected Default Backend (flag=0) No GPU backend found, or could not automatically determine GPU layers. You may prefer to set layers manually. ``` `Auto Selected Default Backend` means KoboldCpp chose the CPU. When you don't pick a backend, KoboldCpp picks one itself: * **CUDA** for an NVIDIA card with more than 3.5 GB of VRAM. * Otherwise **Vulkan**, but only for a dedicated graphics card. * Otherwise the CPU. On Linux, KoboldCpp finds the graphics card with `nvidia-smi` (NVIDIA), `rocminfo` (AMD with ROCm) or `vulkaninfo`. For Vulkan, detection fails without `vulkaninfo`. 1. Pick the backend yourself: on **Quick Launch**, set **Backend:** to **Use CUDA** (NVIDIA) or **Use Vulkan** (any graphics card). On the command line: `--usecuda` or `--usevulkan`. 2. On Linux, install the `vulkan-tools` package. 3. If **Use CUDA** is missing from the list, you have the wrong file. See [below](#use-cuda-is-missing). 4. If KoboldCpp still puts no layers on the graphics card, set **GPU Layers:** to a number yourself (`--gpulayers 20`), and lower it if you run [out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/). On a Mac with Apple Silicon, `Unable to detect VRAM.` is normal. The Mac build puts all layers on the GPU automatically. ## "GPU layers is set, but a GPU backend was not selected" ```text WARNING: GPU layers is set, but a GPU backend was not selected! GPU will not be used! ``` **Backend:** is set to a CPU option (**Use CPU** or `--usecpu`), so the layers stay on the CPU. Choose **Use CUDA** or **Use Vulkan** instead. ## "Use CUDA" is missing The launcher only lists backends that your file contains. `koboldcpp-nocuda.exe` and `koboldcpp-linux-x64-nocuda` contain no CUDA. With `--usecuda` on the command line, they fall back to the CPU without an error. 1. For an NVIDIA card, download `koboldcpp.exe` (Linux: `koboldcpp-linux-x64`), or the `oldpc` file for an older card. 2. For AMD and Intel cards, use **Use Vulkan**. Every Windows and Linux file includes Vulkan. See [Download KoboldCpp](https://koboldcpp.net/download/) ## Old NVIDIA card: "no device code compatible" ```text ERROR: CUDA kernel mul_mat_vec has no device code compatible with CUDA arch 520 ggml-cuda was compiled without support for the current GPU architecture ``` The CUDA 12 builds support NVIDIA cards from compute capability 5.0. The `oldpc` builds use CUDA 11 and go down to compute capability 3.5. 1. Use `koboldcpp-oldpc.exe` or `koboldcpp-linux-x64-oldpc`. 2. If that fails too, use **Use Vulkan**. See [CUDA versions and NVIDIA cards](https://koboldcpp.net/docs/install/releases/#advanced-cuda-versions-and-nvidia-cards). ## The first start with CUDA takes minutes ```text Initializing CUDA/HIP, please wait, the following step may take a few minutes (only for first launch)... ``` On the first launch, CUDA prepares its code for your graphics card. This is normal and happens once. Wait for it to finish. On a PC with an RTX 3090, the first launch took 54 seconds and later launches about 10 seconds. ## "CUDA error" while generating ```text CUDA error: an illegal memory access was encountered current device: 0, in function … at … ``` Other variants include `CUBLAS_STATUS_NOT_SUPPORTED`. 1. Update your NVIDIA driver and [update KoboldCpp](https://koboldcpp.net/docs/install/updating/). 2. With several graphics cards, try one card only: `--usecuda 0`. 3. Turn off **Use MMQ** (`--nommq`). 4. Switch to **Use Vulkan**. ## Replies are slow 1. Check that the graphics card is used (see [above](#the-graphics-card-is-not-used)). On NVIDIA, **Use CUDA** is faster than **Use Vulkan**. On Linux with an AMD card, try the [ROCm build](https://koboldcpp.net/docs/hardware/backends/#rocm). 2. Check how much of the model is on the graphics card. The more layers on the graphics card, the faster it runs. If only part fits, use a smaller quant or model, or lower **Context Size:** so more layers fit. 3. Keep **Use FlashAttention** on (the default). 4. For MoE models, leave **GPU Layers:** at `-1`. If the model does not fit, KoboldCpp then keeps part of the expert weights on the CPU and the rest on the graphics card by itself. 5. If the console processes the whole prompt again on every message, see [The whole prompt is processed again](https://koboldcpp.net/docs/troubleshooting/output-quality/#the-whole-prompt-is-processed-again-on-every-message). For example, Qwen3-VL-8B Q4\_K\_S on a PC with an RTX 3090 generated 82.0 tokens per second with all 37 layers on the graphics card, 45.2 with 30 layers, 23.9 with 20 and 11.9 on the CPU alone (prompt of about 1,000 tokens). Your numbers will differ. See [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) and [GPU backends](https://koboldcpp.net/docs/hardware/backends/). ## Slow when the window is in the background (Windows) On Intel processors of the 12th generation and newer, Windows can run a background KoboldCpp on the slower efficiency cores. Generation then slows down when the window is minimized or in the background. 1. Set **Threads:** on the **Hardware** tab (`--threads`) to the number of performance cores of your processor. 2. Turn on **Keep Foreground** (`--foreground`, Windows only). It brings the console to the front for every new request. ## Integrated graphics KoboldCpp does not pick Vulkan automatically for integrated graphics. You can select **Use Vulkan** yourself. Compare its speed with the CPU alone and keep the faster one. ## Vulkan got slower, or stutters Reports include slowdowns after playing games, which a restart fixed. 1. Restart KoboldCpp, or the PC. 2. Update your graphics driver. 3. Update KoboldCpp. If a new version got slower, try the previous one and report it. ## Advanced: several graphics cards If CUDA errors appear only with several cards, test one card at a time with `--usecuda 0`, then `--usecuda 1`. Both CUDA and Vulkan support several cards. See [Multiple GPUs](https://koboldcpp.net/docs/hardware/multi-gpu/). ## Related * [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/) * [Release files and system requirements](https://koboldcpp.net/docs/install/releases/) * [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/) # Model won't load > Fixes for "Could not load text model", unknown model architecture, non-GGUF files, broken downloads, mismatched mmproj files and access violations. KoboldCpp starts, but loading the model fails. The last error line is usually generic; the real cause is printed a few lines above it. If loading stops with an "out of memory" or allocation error, see [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/). ## "Could not load text model" ```text Could not load text model: C:\models\mymodel.gguf ``` Sometimes also `failed to load model`. This is the final message for any load failure. 1. Scroll up in the console and find the first error above this line. 2. Look it up in the sections below or in [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/). ## "unknown model architecture" ```text llama_model_load: error loading model: unknown model architecture: '' ``` Older versions print `error loading model architecture:` instead. Your KoboldCpp does not know this model's architecture, usually because the model is newer. 1. [Update KoboldCpp](https://koboldcpp.net/docs/install/updating/) to the latest release. 2. If the latest release does not support it yet, wait for the next release, or try a [rolling build](https://koboldcpp.net/docs/install/releases/#advanced-rolling-builds). Rolling builds are updated automatically and can support a new model earlier, but may be unstable. ## "does not seem to be a GGUF file" ```text WARNING: Selected Text Model does not seem to be a GGUF file! Are you sure you picked the right file? ``` The file name does not end in `.gguf`. KoboldCpp runs text models only as GGUF files (and legacy GGML `.bin` files). It cannot load `.safetensors` or PyTorch text models. 1. Download the GGUF version of the model. Search for the model name plus "GGUF" on Hugging Face. 2. Download one single `.gguf` file, not the whole repository. If the quant is split into parts (`-00001-of-00003.gguf`), download all parts and select the first. See [Choose a model](https://koboldcpp.net/getting-started/model/). A model that exists only as safetensors must be converted to GGUF first. See [GGUF and quantization](https://koboldcpp.net/docs/models/gguf-and-quantization/). ## "all download methods failed" ```text Could not find suitable download software, or all download methods failed. Please install aria2, curl, or wget. ``` KoboldCpp could not download a model file from a template or URL. The lines above it, such as `curl failed: …`, show why. 1. Check your internet connection. 2. On Linux, install `curl`, `wget` or `aria2`. 3. Launch again. Files that finished downloading are reused. ## The download is broken or incomplete ```text llama_model_load: error loading model: read error: Input/output error error: failed to read GGUF file ``` The file is damaged: the download stopped early, or the disk has read errors. 1. Compare the file size with the size on the download page. 2. Download the model again. If KoboldCpp downloaded it from a URL, delete that file first; otherwise KoboldCpp reuses it and prints `already exists, using existing file.` 3. If a fresh copy fails with `Input/output error` too, check the drive for errors, or move the model to another drive. `--analyze mymodel.gguf` prints the file's metadata and tensors, which shows whether KoboldCpp can read it. In the launcher: **Analyze Model** on the **Extra** tab. ## The vision file (mmproj) fails to load ```text error: failed to load mmproj model! ``` Loading can also crash without this message. A vision or audio projector (mmproj) works only with the model it was made for. For example, a Qwen mmproj cannot work with a Gemma model. 1. Use the mmproj made for your exact base model and size. A Gemma3 12B model needs the Gemma3 12B mmproj. 2. Ready-made projectors for popular models are in the [koboldcpp/mmproj](https://huggingface.co/koboldcpp/mmproj/tree/main) repository. See [Vision and audio input](https://koboldcpp.net/docs/features/vision/). ## Access violation while loading (Windows) ```text OSError: exception: access violation reading 0x… ``` This has several causes, among them a graphics driver problem (reported with AMD cards on Vulkan), an unstable overclock, and non-ASCII characters in a path. 1. Update your graphics driver. 2. Try another backend. With an AMD card, try **Use Vulkan (Old CPU)**; otherwise try **Use CPU** to rule out the graphics card. 3. Lower **Context Size:** and try a small model to see if it loads at all. 4. Use folder and file names with plain ASCII characters. For image models, this can include your Windows user name; see [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/#windows-a-user-name-or-folder-with-accented-letters). 5. If you overclock your CPU, GPU or RAM, test at stock speeds. ## Advanced: old GGML (.bin) models GGML is the format before GGUF. KoboldCpp still loads it, but with limits: ```text Warning: Your model may be an OUTDATED format (ver 3). Please reconvert it for better results! Warning: Only GGUF models can use max context above 16k. Max context lowered to 16k. ``` Get a current GGUF version of the model instead. If a GGML model is detected as the wrong type, download a fresh copy; the file may be damaged or badly converted. ## Related * [Out of memory](https://koboldcpp.net/docs/troubleshooting/out-of-memory/) * [Choose a model](https://koboldcpp.net/getting-started/model/) * [Updating](https://koboldcpp.net/docs/install/updating/) # OS-specific problems > KoboldCpp problems that only happen on Windows, Linux, macOS, Android or Docker, from Windows 7 and Wayland file pickers to Gatekeeper. Problems that affect every system are on the other Troubleshooting pages. This page collects the ones specific to one system. ## Windows: antivirus, SmartScreen or Smart App Control See [Antivirus or Windows blocks or deletes the file](https://koboldcpp.net/docs/troubleshooting/wont-start/#antivirus-or-windows-blocks-or-deletes-the-file). ## Windows: a user name or folder with accented letters Paths with non-ASCII characters (umlauts, accents, other alphabets) can break model loading. Put KoboldCpp and your models in a folder with a plain ASCII path, for example `C:\mystuff`. A Windows user name with such characters has been reported to make image models fail with an access violation, because KoboldCpp unpacks itself into the temporary folder inside the user profile. The latest release contains a fix for this that has not been confirmed yet. If image models still fail this way, a Windows user account with a plain ASCII name avoids the problem. ## Windows 7: KoboldCpp does not start ```text DLL load failed while importing pyexpat ``` Or an error about a missing entry point such as `GetSystemTimePreciseAsFileTime`. The main builds use functions that exist only in Windows 8 and newer. 1. Use `koboldcpp-oldpc.exe`. Its libraries skip the Windows 8 functions. 2. For the `pyexpat` error, install the Windows update KB3063858. 3. If `msvcp140.dll` still reports `GetSystemTimePreciseAsFileTime`, one user fixed it this way: unpack KoboldCpp with **Unpack KoboldCpp To Folder** on the **Extra** tab, then replace the `msvcp140.dll` in that folder with an older version. Do not replace the one in the Windows system folders. The third-party VxKex compatibility layer can make the main builds run. CUDA on Windows 7 is untested. See [Windows 7](https://koboldcpp.net/docs/install/windows/#advanced-windows-7). ## Windows: slow when the window is in the background See [Slow when the window is in the background](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/#slow-when-the-window-is-in-the-background-windows). ## Linux: "Permission denied" The file is not executable yet. Terminal ```sh chmod +x koboldcpp-linux-x64 ./koboldcpp-linux-x64 ``` If the main build still fails on an older system, try `koboldcpp-linux-x64-oldpc`. ## Linux: "Unable to detect VRAM." KoboldCpp finds your graphics card and its memory with `nvidia-smi` (NVIDIA), `rocminfo` (AMD with ROCm) or `vulkaninfo`. For Vulkan, install the `vulkan-tools` package, then restart KoboldCpp. See [The graphics card is not used](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/#the-graphics-card-is-not-used). ## Linux: the file picker does nothing Often on Wayland. The console may show: ```text Zenity/YAD sanity check failed ``` 1. Install `yad`. KoboldCpp prefers it over `zenity`. 2. Or turn on **Use Classic FilePicker** on the launcher's **Extra** tab. ## Linux: the launcher does not open See ["Warning, GUI failed to start"](https://koboldcpp.net/docs/troubleshooting/wont-start/#warning-gui-failed-to-start). On a server without a display, run KoboldCpp from the command line; see [Headless use](https://koboldcpp.net/docs/install/linux/#headless-use). ## Linux: the browser does not open KoboldCpp tries `xdg-open` first, then Python's browser launcher. If neither works, open `http://localhost:5001` yourself. ## Linux: AMD graphics card Use **Use Vulkan** in `koboldcpp-linux-x64-nocuda`. An experimental official ROCm build also exists; see [ROCm build for AMD on Linux](https://koboldcpp.net/docs/install/releases/#advanced-rocm-build-for-amd-on-linux). ## Linux: a self-built binary does not run on another PC Since v1.122, `koboldcpp.sh` builds portable binaries only with `KCPP_PORTABLE=1`. See [Build from source](https://koboldcpp.net/docs/install/from-source/). ## macOS: nothing happens, or macOS blocks the file The file is not executable yet, or Gatekeeper blocks it because it is not signed. 1. In Terminal, make it executable and run it: Terminal ```sh chmod +x koboldcpp-mac-arm64 ./koboldcpp-mac-arm64 ``` 2. If macOS blocks it, allow it in **System Settings → Privacy & Security**, then run it again. See [macOS](https://koboldcpp.net/docs/install/macos/). ## macOS: "Unable to detect VRAM." This is normal on Apple Silicon. KoboldCpp puts all layers on the GPU (Metal) anyway: ```text MacOS detected: Auto GPU layers set to maximum ``` ## macOS: Intel Mac There is no ready-made file for Intel Macs, and they are poorly supported. You can [build from source](https://koboldcpp.net/docs/install/from-source/#macos). ## macOS: run without Metal `--failsafe` switches to a CPU-only library that uses Apple's Accelerate framework instead of Metal. ## Android: "Illegal instruction" Some devices crash with `Illegal instruction`. Compile with `make LLAMA_PORTABLE=1`, which turns off ARM-specific instructions. See [Android (Termux)](https://koboldcpp.net/docs/install/android/). ## Android: packages fail to install Run `termux-change-repo` and pick another mirror, then run the setup again. ## Docker: very slow The Docker image detects processor features only roughly and can fall back to the failsafe libraries, which are extremely slow. Choose the backend yourself, for example `--usecuda` or `--usevulkan` in `KCPP_ARGS`. See [Docker](https://koboldcpp.net/docs/install/colab-docker/#docker-experts). ## Related * [KoboldCpp won't start](https://koboldcpp.net/docs/troubleshooting/wont-start/) * [Windows](https://koboldcpp.net/docs/install/windows/), [Linux](https://koboldcpp.net/docs/install/linux/), [macOS](https://koboldcpp.net/docs/install/macos/), [Android (Termux)](https://koboldcpp.net/docs/install/android/) # Out of memory errors (VRAM and RAM) > Fixes for KoboldCpp running out of VRAM or RAM, including cudaMalloc failed, ErrorOutOfDeviceMemory and being killed while loading. A model needs memory for its weights (roughly the file size), for the context (the KV cache, which grows with **Context Size:**) and for working buffers. When that is more than your graphics card or PC has, loading fails. See [How much memory a model needs](https://koboldcpp.net/docs/models/memory/). ## "cudaMalloc failed: out of memory" (NVIDIA) ```text ggml_backend_cuda_buffer_type_alloc_buffer: allocating … MiB on device 0: cudaMalloc failed: out of memory ``` Followed by one of these: ```text unable to allocate CUDA0 buffer failed to allocate buffer for kv cache failed to allocate compute pp buffers ``` The layers on the graphics card, the context and the buffers together need more VRAM than is free. Try these in order, and relaunch after each: 1. Leave **GPU Layers:** at `-1` (`--gpulayers -1`). KoboldCpp then fits as many layers as possible into VRAM. If you set a number yourself, lower it. 2. Lower **Context Size:** (`--contextsize`). The default is 16384. See [Context size](https://koboldcpp.net/docs/settings/context-size/). 3. Close other programs that use the graphics card. KoboldCpp warns you about them: ```text Note: KoboldCpp has detected that a significant amount of GPU VRAM (… MB) is currently used by another application. ``` 4. Quantize the context: set **Quantize KV Cache:** on the **Context** tab to `q8_0`, or `q4_0` for more savings (`--quantkv q8_0`). Keep **Use FlashAttention** on; without it, only part of the cache is quantized, and it can even use more VRAM. 5. Use a smaller quant of the model, or a smaller model. See [Choosing a quant](https://koboldcpp.net/docs/models/gguf-and-quantization/). 6. Lower **Batch Size:** on the **Hardware** tab (`--batchsize`, default 512). 7. As a last resort, `--lowvram` keeps the context in system RAM. It is slow and not recommended. More options: [GPU layers](https://koboldcpp.net/docs/hardware/gpu-layers/) and [Saving VRAM](https://koboldcpp.net/docs/hardware/saving-vram/). ## "ErrorOutOfDeviceMemory" (Vulkan) ```text ggml_vulkan: Device memory allocation of size … failed. vk::Device::allocateMemory: ErrorOutOfDeviceMemory alloc_tensor_range: failed to allocate Vulkan0 buffer of size … ``` The Vulkan backend ran out of VRAM. The fixes are the same as for [NVIDIA](#cudamalloc-failed-out-of-memory-nvidia): put fewer layers on the graphics card, lower the context size, close other programs. Some Vulkan devices cannot allocate more than about 2 GB in one piece, even with more VRAM free. For image generation, these flags help: `--sdvaeauto`, `--sdquant`, and `--sdconvdirect vaeonly`. See [Image generation](https://koboldcpp.net/docs/features/image-generation/). ## KoboldCpp is killed while loading The console shows `Terminated`, or KoboldCpp ends without an error, while system memory (RAM) is almost full. The model does not fit into RAM. 1. Use a smaller quant or a smaller model. 2. Close other programs. 3. Turn on **Use MMAP** (`--usemmap`). The system then reads the model file from disk as needed, instead of loading it all into RAM first. 4. Lower **Context Size:**. ## Advanced: "not enough space in the scratch memory" Messages like `not enough space in the context's memory pool` or `scratch memory` come from old GGML models and very old versions. Current versions show the CUDA or Vulkan errors above. Update KoboldCpp and use a GGUF model. ## Related * [Context size](https://koboldcpp.net/docs/settings/context-size/) * [GPU not used or slow](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/) * [Your first model: how much memory you need](https://koboldcpp.net/docs/models/memory/) # Bad or strange output > Fixes for gibberish output, a model that never stops, the AI replying as you, cut-off replies, ignored images and context warnings in KoboldCpp. The model loads, but its replies are wrong. Most settings on this page are in KoboldAI Lite's settings, not in the launcher. ## The AI writes gibberish Replies are random characters, repeated symbols or nonsense words. Known causes are graphics driver bugs (often AMD cards with Vulkan), a badly converted model file, and bugs in a KoboldCpp version with specific models. 1. Update your graphics driver. 2. Try another backend. With AMD on Vulkan, try **Use Vulkan (Old CPU)**. To rule out the graphics card, try **Use CPU**. 3. Download the model again, from a well-known uploader. 4. [Update KoboldCpp](https://koboldcpp.net/docs/install/updating/). 5. Try a different **Batch Size:** on the **Hardware** tab (`--batchsize`). 6. Turn off **Use FlashAttention** (`--noflashattention`). 7. If you set a custom RoPE configuration, remove it. The default scales automatically. If a model still produces gibberish, report it with the model name and your settings. ## The AI never stops, or keeps rambling The model's end token (EOS) is banned, or the instruct format does not match the model. The reply then runs until the output length is used up. 1. In KoboldAI Lite, open **Settings** > **Misc**. Under **Advanced Settings**, set **EOS token ban** to **Auto** (the default) or **Unban**. 2. In instruct mode, check that the instruct tags match the model. Lite's default placeholder tags adapt to the model automatically. The old `--unbantokens` flag no longer exists; KoboldCpp exits with `unrecognized arguments` if you pass it. ## The AI replies as me in chat mode The model writes your lines as well as its own. 1. Retry the reply. 2. In KoboldAI Lite, open **Settings** > **General** and turn off **Allow multiline replies**. 3. Use a model that was trained for chat. 4. Check the character card and the start of the chat: consistent, correctly spelled names and a few good example messages help. ## Replies are cut short In other apps that use the API, replies stop after a fixed length when the app does not send a length. KoboldCpp then uses its default, **Default Gen Amt:** on the **Context** tab (`--defaultgenamt`, 2048 tokens). It is capped at half the context size. 1. Set the reply length (`max_tokens` or "max length") in your app. 2. Or raise **Default Gen Amt:**, and raise **Context Size:** if half of it is below what you need. 3. Check that **Prompt Limit:** (`--genlimit`) is not set; it caps every reply. In KoboldAI Lite chat mode, turning off **Allow multiline replies** (**Settings** > **General**) also shortens replies to one line. ## Badly formatted replies over the Chat Completions API ```text Chat template heuristics failed to identify chat completions format. Alpaca will be used. ``` KoboldCpp could not tell which chat format the model uses and fell back to Alpaca, which may not match. 1. Turn on **Use Jinja** on the launcher's **Context** tab (`--jinja`). KoboldCpp then uses the chat template stored in the model file. 2. Or pick the format yourself: **Chat Adapter:** on the **Loaded Files** tab, with **Pick Premade** (`--chatcompletionsadapter`). See [Chat formatting](https://koboldcpp.net/docs/api/overview/#chat-formatting). ## The whole prompt is processed again on every message Normally KoboldCpp reuses the processed text and, when the context is full, shifts it (ContextShift). On models with sliding window attention (SWA), such as Gemma 3, SWA is on by default and turns ContextShift off: ```text SWA Mode is ENABLED! Note that using SWA Mode cannot be used with Context Shifting! ``` 1. Keep **Use FastForwarding** and **Use ContextShift** on (the defaults). 2. To get ContextShift back on an SWA model, turn off **Allow SWA** on the **Context** tab (`--noswa`). This uses much more memory for the context. 3. **Parallel Requests:** above 1 also turns ContextShift off. Set it to 1 if you don't need parallel requests. ## The AI ignores my image or audio ```text Warning: Media excluded - Context size too low or not enough mtmd tokens! (needed …) Media will be IGNORED! You probably want to relaunch with a larger context size! ``` The image or audio did not fit into the context. Relaunch with a larger **Context Size:**. Long audio clips need a lot of context. Without a vision file (mmproj) loaded, the model cannot see images at all. See [Vision and audio input](https://koboldcpp.net/docs/features/vision/). ## Warnings about the context size ```text Warning! Request max_context_length=32768 exceeds allocated context size of 16384. It will be reduced to fit. Warning: You are trying to generate text with max_length (10000) near or exceeding max_context_length limit (16384). ``` Your app asked for more context than KoboldCpp reserved at launch, or for a reply almost as long as the whole context. Most of the story is then cut off, and replies lose coherence. 1. Relaunch with a larger **Context Size:** (`--contextsize`). An app's context setting cannot go above the launch value. 2. Or lower the context size and reply length in your app. See [Context size](https://koboldcpp.net/docs/settings/context-size/). ## "Quantized KV was used without flash attention" ```text Warning: Quantized KV was used without flash attention! This is NOT RECOMMENDED! ``` With **Use FlashAttention** off, a quantized context cache (**Quantize KV Cache:**, `--quantkv`) only partly works and can even use more VRAM. Turn **Use FlashAttention** back on, or set **Quantize KV Cache:** to `f16`. ## Advanced: sampler settings Extreme sampler values also produce bad output. KoboldAI Lite's defaults are a good reset point: | Setting | Lite default | | ------------------ | ----------------- | | Temperature | 0.75 | | Repetition penalty | 1.05 | | Top-P | 0.92 | | Sampler order | `[6,0,1,3,4,2,5]` | An API request with an invalid order logs `ERROR: sampler_order must be a list of integers`. See [KoboldAI Lite](https://koboldcpp.net/docs/features/lite/). ## Related * [Context size](https://koboldcpp.net/docs/settings/context-size/) * [GPU not used or slow](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/) * [Connection and API problems](https://koboldcpp.net/docs/troubleshooting/connection/) # Won't start or closes straight away > Fixes for KoboldCpp crashing or closing at startup, antivirus blocks, WinError 1114, Illegal instruction, a blank console and a port in use. Most start problems print an error in the console window. If the window closes too fast to read it, start with the first section. ## The window closes straight away KoboldCpp crashed, and the console window closed before you could read the error. KoboldCpp writes no log file, so run it from a terminal, where the message stays on screen. * Windows 1. Open Command Prompt. 2. Go to the folder with KoboldCpp and start it: Command Prompt ```sh cd C:\mystuff koboldcpp.exe ``` * Linux 1. Open a terminal. 2. Go to the folder with KoboldCpp and start it: Terminal ```sh cd ~/Downloads ./koboldcpp-linux-x64 ``` * macOS 1. Open Terminal. 2. Go to the folder with KoboldCpp and start it: Terminal ```sh cd ~/Downloads ./koboldcpp-mac-arm64 ``` Look up the error on this page or in [Model won't load](https://koboldcpp.net/docs/troubleshooting/model-wont-load/). Errors from the launcher itself appear in a message box instead. ## Antivirus or Windows blocks or deletes the file What you may see: * Microsoft Defender or another antivirus reports a trojan, for example: ```text Trojan:Win32/Sabsik.FL.A!ml Trojan:Script/Wacatac.B!ml ``` * "Windows protected your PC" (SmartScreen). * The exe shrinks to 0 bytes, or this error appears: ```text Failed to extract koboldcpp_vulkan_noavx2.dll: decompression resulted in return code -3! ``` The exe is not code-signed and unpacks its libraries into a temporary folder when it starts. Heuristic and machine-learning scanners flag this. For a file from the official releases, it is a false positive. 1. Check that the file came from the [official GitHub releases](https://github.com/LostRuins/koboldcpp/releases/latest). See [Staying safe](https://koboldcpp.net/docs/install/staying-safe/). 2. For SmartScreen, click **More info**, then **Run anyway**. 3. For an antivirus, add the file to its exceptions and report the false positive to the vendor. 4. If the file was quarantined, shrank or fails to extract, download it again. **Smart App Control** has no exception list. It blocks KoboldCpp for as long as it is turned on. ## "DLL initialization routine failed" (WinError 1114) ```text OSError: [WinError 1114] A dynamic link library (DLL) initialization routine failed ``` This appears after `Initializing dynamic library: …`. Related errors are `0xc0000142` and `Failed to execute script 'koboldcpp' due to unhandled exception!`. Common causes: the processor lacks AVX2, the NVIDIA driver is too old for the CUDA 12 build, or an antivirus removed a library. 1. If your processor or NVIDIA card is older, use `koboldcpp-oldpc.exe` (CUDA 11, needs only AVX1). See [Download KoboldCpp](https://koboldcpp.net/download/) 2. Otherwise, update your NVIDIA driver. `nvidia-smi` in Command Prompt shows the installed driver. 3. Rule out your antivirus: download the file again and add an exception. `Failed to execute script 'koboldcpp'` also follows other errors, such as a [port in use](#port-5001-already-appears-to-be-in-use). Read the lines above it. ## "Illegal instruction" or `0xc000001d` ```text Illegal instruction (core dumped) ``` On Windows the error code is `0xc000001d`. Your processor lacks an instruction set (AVX2 or AVX) that the selected backend needs. KoboldCpp normally detects this and picks a compatible mode, but a backend chosen by hand or saved in a config file overrides the detection. 1. In the launcher, set **Backend:** to an option marked **(Old CPU)**, for example **Use CPU (Old CPU)** or **Use Vulkan (Old CPU)**. On the command line, add `--noavx2`. 2. If it still crashes, your processor has no AVX either. Use **Failsafe Mode (Older CPU)** (`--failsafe`), which uses no graphics card. 3. To use a graphics card on a processor without AVX, download the `oldpc` file and choose **Use Vulkan (Older CPU)** (`--usevulkan --failsafe`). See [Processor requirements](https://koboldcpp.net/docs/install/releases/#processor-avx2-avx-no-avx) for which build contains which mode. On Android, see [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/#android-illegal-instruction). ## The console stays blank and the launcher never opens The exe could not unpack itself into the temporary folder. It needs about 1 GB of free space on the system drive, and an antivirus can block the unpacking. 1. Free up space on the system drive. 2. Check your antivirus (see [above](#antivirus-or-windows-blocks-or-deletes-the-file)). 3. Try the smaller `koboldcpp-nocuda.exe`. 4. Or unpack KoboldCpp once and start it from the unpacked folder; see [Unpack for faster startup](https://koboldcpp.net/docs/install/windows/#advanced-unpack-for-faster-startup). ## "Port 5001 already appears to be in use" ```text Warning: Port 5001 already appears to be in use by another program. OSError: Cannot start the server: no socket could bind. ``` Another KoboldCpp, or another program, already uses the port. KoboldCpp loads the whole model first and fails only when it starts the server. 1. Close the other KoboldCpp window. 2. Or use a different port: **Port:** on the **Network** tab, or `--port 5002`. To let a new KoboldCpp replace a running one automatically, start both with **SingleInstance Mode** (**Admin** tab) or `--singleinstance`. The new instance then asks the old one on the same port to shut down. ## "Warning, GUI failed to start" ```text Warning, GUI failed to start: Reason: no display name and no $DISPLAY environment variable File selection GUI unsupported. customtkinter python module required! ``` The launcher could not open a window. Usually there is no display (a server or SSH session), or, when you run from source, the `tkinter` or `customtkinter` Python module is missing. 1. Start KoboldCpp without the launcher by giving it a model: `--model mymodel.gguf`, or a config file with `--config mysettings.kcpps`. 2. When running from source, install `tkinter` and `customtkinter` to get the launcher back. `--skiplauncher` on its own does not help: without `--model` it exits with an error. See [Headless use](https://koboldcpp.net/docs/install/linux/#headless-use). ## "Cannot find text model file" or "config file invalid or not found" ```text Cannot find text model file: C:\models\mymodel.gguf Specified kcpp config file invalid or not found. No gguf model or kcpps file was selected. Exiting. ``` The path is wrong, or the file has moved. 1. Check the path and file name. Put paths with spaces in quotes on the command line. 2. Use folder and file names with plain ASCII characters. Umlauts and other accented letters in a model path can break loading. 3. For a config file, open it with **Load Config** in the launcher to check it. ## "No Backends Available!" (running from source) ```text KoboldCPP couldn't locate any backends to use (i.e Default, Vulkan, CUDA). ``` You started `koboldcpp.py` from source code without compiling it first. Run `make` in the folder; see [Build from source](https://koboldcpp.net/docs/install/from-source/). ## Problems on one system only * Windows 7, Linux permissions and file pickers, macOS security settings, Android: [OS-specific problems](https://koboldcpp.net/docs/troubleshooting/os-specific/). * The model fails to load after KoboldCpp starts: [Model won't load](https://koboldcpp.net/docs/troubleshooting/model-wont-load/). # Download KoboldCpp > Download KoboldCpp for Windows, Linux or macOS from the official GitHub releases: one file, no installer. Pick the file for your graphics card. KoboldCpp is one file. There is no installer. Pick your system, then click the file for your graphics card. Not sure which card you have? See [below](#which-graphics-card-do-i-have). **Every link goes to the [latest official KoboldCpp release on GitHub](https://github.com/LostRuins/koboldcpp/releases/latest), where you can read about changes and new features added in the newest version.** * Windows [NVIDIA graphics card](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp.exe)koboldcpp.exe [AMD or Intel graphics, or none](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-nocuda.exe)koboldcpp-nocuda.exe, a much smaller download [Older PC](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-oldpc.exe)koboldcpp-oldpc.exe, for older devices, if the others crash at start * Linux [NVIDIA graphics card](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64)koboldcpp-linux-x64 [AMD or Intel graphics, or none](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64-nocuda)koboldcpp-linux-x64-nocuda, a much smaller download [Older PC](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-linux-x64-oldpc)koboldcpp-linux-x64-oldpc, if the others crash at start * macOS [Apple Silicon (M-series)](https://github.com/LostRuins/koboldcpp/releases/latest/download/koboldcpp-mac-arm64)koboldcpp-mac-arm64 Intel Macs have no ready-made file. See [Build from source](https://koboldcpp.net/docs/install/from-source/#macos). Beware of fake sites You should **ONLY** trust official downloads from the release binaries linked here and the official KoboldCpp Github at . (See: [Staying Safe](https://koboldcpp.net/docs/install/staying-safe/) for a list of known fake sites) ## Which graphics card do I have? On Windows, the Task Manager shows it. 1. Launch **Windows Task Manager** with keyboard shortcut Ctrl+Alt+Del or Ctrl+Shift+Esc. 2. Click **Performance** tab. 3. Click **GPU** in the list on the left. The card's name is at the top right. **Dedicated GPU memory** is the card's own memory, its **VRAM**. It determines what models work well for your system. [![Windows Task Manager showing GPU name](https://koboldcpp.net/_astro/windows-task-manager.BdMTKDqZ_Z2ckVSL.webp)](https://koboldcpp.net/_astro/windows-task-manager.BdMTKDqZ.png) On Linux, `lspci | grep -iE 'vga|3d'` shows the card's name, and `nvidia-smi` shows an NVIDIA card's memory. On a Mac with Apple Silicon, the graphics chip uses the Mac's main memory. Pick the download suited to your system and GPU card. All files and what each contains: [Release files and system requirements](https://koboldcpp.net/docs/install/releases/). [Next Step: Launching KoboldCpp](https://koboldcpp.net/getting-started/start/) # Getting started with KoboldCpp > A beginner's guide to KoboldCpp with screenshots: download one file, start it, choose a model and chat in your browser. No installer, no account. KoboldCpp runs AI models on your own computer. This guide takes you from download to your first chat in four steps. You don't need to know anything about AI. 1. [**Download KoboldCpp**](https://koboldcpp.net/download/): one file from GitHub. There is no installer. 2. [**Start KoboldCpp**](https://koboldcpp.net/getting-started/start/): open the file. A settings window, the launcher, appears. 3. [**Choose a model and launch**](https://koboldcpp.net/getting-started/model/): the model is the AI itself. The launcher can download one for you. 4. [**Chat**](https://koboldcpp.net/getting-started/chat/): KoboldAI Lite opens in your web browser. ## What you need * A computer with Windows, Linux, or a Mac with an Apple Silicon (M-series) chip. * Up to about 8 GB of free disk space for KoboldCpp and a beginner model. * A graphics card is not required. With one, replies come much faster. [Next Step: Downloading KoboldCpp](https://koboldcpp.net/download/) Stuck at any point? See [Help](https://koboldcpp.net/getting-started/help/). Everything beyond the basics is in the [wiki](https://koboldcpp.net/docs/). # Chat with your model in KoboldAI Lite > When the model has loaded, KoboldCpp opens KoboldAI Lite in your browser. Pick a look and send your first message. When the model has loaded, your browser opens KoboldAI Lite, the chat app built into KoboldCpp. If it doesn't open, go to `http://localhost:5001` yourself. 1. Choose a look and click **Set UI**. **Corpo UI** looks like a typical chat app. You can change it later in **Settings**. [![KoboldAI Lite welcome dialog with Classic, Aesthetic and Corpo UI styles](https://koboldcpp.net/_astro/lite-choose-style.BqgEN4DV_Z194BYd.webp)](https://koboldcpp.net/_astro/lite-choose-style.BqgEN4DV.png) 2. Type a message and click the arrow button to send it (in Classic UI: **Submit**). [![A first message and the model's reply in KoboldAI Lite](https://koboldcpp.net/_astro/lite-first-chat._0bc6cLK_1JB7Cb.webp)](https://koboldcpp.net/_astro/lite-first-chat._0bc6cLK.png) Here are all the WebUIs bundled with KoboldCpp for various tasks (assuming port 5001) http\://localhost:5001 - KoboldAI Lite WebUI: Versatile multi-purpose WebUI for chatting/roleplay and basic image generation. http\://localhost:5001/lcpp - llama.cpp WebUI: Ported from llama.cpp and mimics ChatGPT. Use if you prefer a more "Assistant" feel. http\://localhost:5001/sdui - Stable-UI: A dedicated image generation WebUI. Use this if you are generating or editing images or videos. http\://localhost:5001/musicui - MusicUI: A dedicate music generation WebUI. Use this to generate music, you can also use this to generate speech with TTS models. That's it: everything runs on your computer. To stop KoboldCpp, close its console window. ## Next time In the launcher, **Save Config** saves your settings to a `.kcpps` file. Next time, click **Load Config**, pick that file and click **Launch**. # Help and next steps > Quick fixes for the most common KoboldCpp problems for beginners, where to ask for help, and what to try after your first chat. Many problems show an error message in the console window. Keep it open and read it. ## Common problems **Windows or your antivirus blocks the file.** For files from the [official releases](https://github.com/LostRuins/koboldcpp/releases/latest) this is a false alarm: the file is not signed. Click **More info**, then **Run anyway**, or allow the file in your antivirus. [More](https://koboldcpp.net/docs/install/windows/#smartscreen-and-antivirus-warnings) **The window closes straight away.** Start KoboldCpp from a Command Prompt (Windows) or a terminal, so the error stays on screen. On an older PC, try the `oldpc` file. [More](https://koboldcpp.net/docs/troubleshooting/wont-start/) **"Out of memory", or a crash while loading.** Pick a smaller model or the `LowSpec` template, and close other programs that use the graphics card. [More](https://koboldcpp.net/docs/troubleshooting/out-of-memory/) **Replies are very slow.** Check that **Backend:** on **Quick Launch** shows **Use CUDA** (NVIDIA) or **Use Vulkan** (AMD, Intel), not **Use CPU**. If **Use CUDA** is missing on an NVIDIA PC, you have the `nocuda` file; [download](https://koboldcpp.net/download/) `koboldcpp.exe` instead. [More](https://koboldcpp.net/docs/troubleshooting/gpu-and-speed/) **The model doesn't load.** Use one `.gguf` file, and download it again if the download was cut short. Newer model types need the latest KoboldCpp. [More](https://koboldcpp.net/docs/troubleshooting/model-wont-load/) **Nothing happens on macOS.** Run it from Terminal as shown in [Start KoboldCpp](https://koboldcpp.net/getting-started/start/), and allow it in **System Settings → Privacy & Security**. [More](https://koboldcpp.net/docs/install/macos/) ## Ask for help Ask on the [KoboldAI Discord](https://koboldai.org/discord) or in [GitHub Discussions](https://github.com/LostRuins/koboldcpp/discussions). Found a bug? [Report it on GitHub](https://github.com/LostRuins/koboldcpp/issues). Copy the error from the console window into your message. ## What to try next * [Connect SillyTavern and other apps](https://koboldcpp.net/docs/api/connect-apps/) * [Make pictures](https://koboldcpp.net/docs/features/image-generation/) * [Talk to it](https://koboldcpp.net/docs/features/speech-to-text/) and [hear replies read aloud](https://koboldcpp.net/docs/features/text-to-speech/) * [Let it remember more of the conversation](https://koboldcpp.net/docs/settings/context-size/) * [Update KoboldCpp](https://koboldcpp.net/docs/install/updating/) * [Read KoboldCpp API docs](https://koboldcpp.net/docs/api/overview/) Everything else is in the [wiki](https://koboldcpp.net/docs/). # Choose a model and launch > Pick your first AI model for KoboldCpp: a newbie template that downloads everything for you, or one of four recommended model files. Then click Launch. KoboldCpp doesn't come with an AI model; you add one. A model is one large file that ends in `.gguf`. ## The easy way: a newbie template A template fills in the launcher for you and downloads the model when you click **Launch**. The `Chatbot` templates also add voice input, read-aloud and picture understanding. 1. In the launcher, click **Get Help** and the dropdown **Newbie Templates**. [![Newbie Template Launcher UI](https://koboldcpp.net/_astro/newbie-template.Dqr0dyBt_ZGtvzm.webp)](https://koboldcpp.net/_astro/newbie-template.Dqr0dyBt.png) 2. Pick a template for your graphics card's memory (VRAM; [how to check](https://koboldcpp.net/download/#which-graphics-card-do-i-have)): * Chat with the AI: * `LowSpec-Chatbot`: recommend for 6 GB VRAM or no GPU. Chat or roleplay, also has vision, speech generation and voice recognition capabilities. * `MidSpec-Chatbot`: recommend for 12 GB VRAM or more. Chat or roleplay, also has vision, speech generation and voice recognition capabilities. * Generating Images: * `LowSpec-ImageGen`: recommend for 6 GB VRAM or no GPU for creating and editing AI images. Launch the dedicated SDUI when prompted. * `LowSpec-ImageGen`: recommend for 12 GB VRAM for creating and editing AI images. Launch the dedicated SDUI when prompted. * Generating Music: * `LowSpec-MusicGen`: recommend for 6 GB VRAM or no GPU for generating music. Launch the dedicated MusicUI when prompted. You can add an extra LLM model for better lyrics generation. * Agent and Coding: * `LowSpec-CodingAgent`: recommend for 6 GB VRAM or no GPU for coding tasks. Launches an agentic terminal. * `MidSpec-CodingAgent`: recommend for 12 GB VRAM for coding tasks. Launches an agentic terminal. 3. Click **Load Template**. [![The Help Menu: Newbie Templates, the LowSpec-Chatbot template and the Load Template button](https://koboldcpp.net/_astro/launcher-get-help.Cjkf-1Bn_ZvSCgI.webp)](https://koboldcpp.net/_astro/launcher-get-help.Cjkf-1Bn.png) ## Or: download one model file These are some basic models that work in KoboldCpp. Click one to download it. For more models, visit [Huggingface](https://huggingface.co/models?library=gguf). [Qwen3-VL-8B](https://huggingface.co/unsloth/Qwen3-VL-8B-Instruct-GGUF/resolve/main/Qwen3-VL-8B-Instruct-Q4_K_S.gguf)The best all-rounder · 4.8 GB [L3-8B-Stheno-v3.2](https://huggingface.co/bartowski/L3-8B-Stheno-v3.2-GGUF/resolve/main/L3-8B-Stheno-v3.2-Q4_K_S.gguf)Creative writing and roleplay · 4.7 GB [Gemma 3 4B](https://huggingface.co/ggml-org/gemma-3-4b-it-GGUF/resolve/main/gemma-3-4b-it-Q4_K_M.gguf)Small and fast, for weaker PCs · 2.5 GB [PicX Real](https://huggingface.co/koboldcpp/imgmodel/resolve/main/picx_real_q8_0.gguf)Makes pictures · 1.8 GB In the launcher, click **Browse** next to **GGUF Text Model:** and select the file. PicX Real is an image model: it goes into **Image Model** on the **Image Gen** tab instead. ## Launch Click **Launch**. [![GGUF Text Model field with a model selected (1) and the Launch button (2)](https://koboldcpp.net/_astro/launcher-model-launch.pqsOrZko_ZUEX0N.webp)](https://koboldcpp.net/_astro/launcher-model-launch.pqsOrZko.png) The launcher closes, and the console window shows the model loading. With a template, it first downloads the files, which can take a while. The next launch reuses them. [Next Step: Chatting](https://koboldcpp.net/getting-started/chat/) # Start KoboldCpp for the first time > Open the KoboldCpp file on Windows, Linux or macOS, get past the first-start warning, and reach the launcher. Put the file you downloaded in a folder of its own, for example `C:\mystuff` on Windows. Models that KoboldCpp downloads for you are saved next to it. * Windows Double-click the file. A black console window opens, then the launcher. If Windows shows "Windows protected your PC", click **More info**, then **Run anyway**. This is expected: the file is not signed. If your antivirus removes the file, see [SmartScreen and antivirus warnings](https://koboldcpp.net/docs/install/windows/#smartscreen-and-antivirus-warnings). * Linux Open a terminal in the folder with the file, make it executable and run it. This example uses the NVIDIA file; use your file's name: Terminal ```sh cd ~/Downloads chmod +x koboldcpp-linux-x64 ./koboldcpp-linux-x64 ``` * macOS Open Terminal, make the file executable and run it: Terminal ```sh cd ~/Downloads chmod +x koboldcpp-mac-arm64 ./koboldcpp-mac-arm64 ``` The first time, macOS says it could not verify the file. Click **Done**, then open **System Settings → Privacy & Security**, scroll down and click **Open Anyway**. Run the file again and confirm. The launcher opens on the **Quick Launch** tab. KoboldCpp picks the **Backend:** for your hardware, and the other defaults generally work, so leave them as they are. [![The KoboldCpp launcher on the Quick Launch tab with default settings](https://koboldcpp.net/_astro/launcher-start.Dobnsw9D_2mAU0B.webp)](https://koboldcpp.net/_astro/launcher-start.Dobnsw9D.png) Keep the console window (or terminal) open while you use KoboldCpp. Closing it stops KoboldCpp. [Next Step: Choosing a model](https://koboldcpp.net/getting-started/model/) # Links and resources > Official KoboldCpp links: GitHub releases and wiki, the SourceForge mirror, Hugging Face templates, Discord, KoboldAI Lite and related projects. ## KoboldCpp * [GitHub repository](https://github.com/LostRuins/koboldcpp): the source code and the README. * [Releases](https://github.com/LostRuins/koboldcpp/releases/latest): the official downloads. * [SourceForge mirror](https://sourceforge.net/projects/koboldcpp/): a mirror of the GitHub releases and repository. * [GitHub wiki](https://github.com/LostRuins/koboldcpp/wiki): the project's own wiki and FAQ. * [Report a bug](https://github.com/LostRuins/koboldcpp/issues) or [ask in Discussions](https://github.com/LostRuins/koboldcpp/discussions). * [Docker image](https://hub.docker.com/r/koboldai/koboldcpp) and [Colab notebook](https://colab.research.google.com/github/LostRuins/koboldcpp/blob/concedo/colab.ipynb): run KoboldCpp on a server or on a Google cloud GPU. * [RunPod Cloud Image](https://koboldai.org/runpodcpp): run KoboldCpp in the cloud on a rental GPU * [KoboldCpp Public Demo](https://koboldai-koboldcpp-tiefighter.hf.space/): try our public online KoboldCpp demo instance. ## Models and templates * [KoboldCpp on Hugging Face](https://huggingface.co/koboldcpp): newbie templates, and Whisper, TTS and image models. * [Newbie templates](https://huggingface.co/koboldcpp/newbie-templates): the templates the launcher's **Get Help** loads. ## Community * [KoboldAI Discord](https://koboldai.org/discord) * [r/KoboldAI](https://www.reddit.com/r/KoboldAI/) on Reddit * [GitHub Discussions](https://github.com/LostRuins/koboldcpp/discussions) ## Related * [KoboldAI Lite online](https://lite.koboldai.net): the interface built into KoboldCpp, in your browser, for online AI services such as the AI Horde. (and the [beta site](https://lite-beta.koboldai.net)) * [KoboldCpp API reference](https://lite.koboldai.net/koboldcpp_api) * [AI Horde](https://aihorde.net): a volunteer network that shares AI models; KoboldCpp can join it as a worker. * [llama.cpp](https://github.com/ggml-org/llama.cpp) and [stable-diffusion.cpp](https://github.com/leejet/stable-diffusion.cpp): the projects KoboldCpp builds on. * [KoboldAI.com](https://koboldai.com): guides for the KoboldAI projects. * [Staying safe: Beware of fake sites](https://koboldcpp.net/docs/install/staying-safe/): there are many fake sites impersonating KoboldCpp. Read more here.