Embeddings, documents, web search and tools in KoboldCpp
Start KoboldCpp with --embeddingsmodel and a GGUF embedding model to get vectors from /v1/embeddings. Without that flag the endpoint still answers, with an empty vector, so check the length. For documents in Lite use TextDB, for live information start with --websearch, and for tools give KoboldCpp an MCP config with --mcpfile. We tested embeddings and the empty-vector trap; web search returned nothing in our lab; MCP, TextDB and the agent are untested here.
Checked against KoboldCpp 1.124.2 · updated 13 Nov 2026
- lab-lnx: Linux test VM · 4 vCPU · 15 GB · no GPU
- gha-u24: Ubuntu 24.04 test machine · 4 vCPU · 16 GB · no GPU
On this page
Which feature do you need?
| Vectors for your own app | --embeddingsmodel | Tested <EvidenceBadge id="F99" /> |
| Lite uses your notes or documents | TextDB in Lite | Not run |
| Current information from the web | --websearch | Returned nothing in our lab <EvidenceBadge id="F99" /> |
| The model calls tools | --mcpfile | Route tested, no server <EvidenceBadge id="F99" /> |
| A bundled tool-using assistant | --agent | Not run |
/api/extra/version shows what is on. In our run, with an embedding model and web search loaded: embeddings true, websearch true, mcp false F99.
KoboldCpp embeddings
Load a GGUF embedding model
Download one (Hugging Face). In the launcher it goes in the Embeds Model field, or use GGUF embedding model to serve /v1/embeddings and /api/extra/embeddings.Default Launcher Loaded Files tab: Embeds Model + ECtx + GPUSince v1.87All details (since 1.87). Overrides the maximum context of the embeddings model.Default 4096Launcher Loaded Files tab: Embeds Model + ECtx + GPUSince v1.93.2All details (default 4096) limits the text length and Offloads the embeddings model to the GPU.Default falseLauncher Loaded Files tab: Embeds Model + ECtx + GPUSince v1.94All details puts it on the GPU.Check the flag
/api/extra/versionmust say"embeddings": true.Ask for vectors
POST to/v1/embeddingswithinputas a string or a list.
We ran all-MiniLM-L6-v2 (Q8_0) F99:
| Six inputs in one request | 200, six vectors of 384 numbers, each of length 1.0, in 0.04 s |
| The same text twice | Identical vectors |
| cat and kitten (cosine) | 0.786 |
| cat and stock market | 0.197 |
| A cat sentence and a kitten sentence | 0.621 |
| A cat sentence and an earnings sentence | -0.002 |
| 3000 words with --embeddingsmaxctx 512 | 200 and a normal vector; 511 tokens used, so the text was cut, with no error |
Related things are close and unrelated ones are not. The numbers depend on the model file, so compare only within one file: an earlier run with another copy of the model gave 0.659 for cat and kitten F27. Routes: /v1/embeddings (tested), /api/extra/embeddings (answered with data, model, object, usage) and Ollama’s /api/embed (answered with embeddings) F99. For RAG, KoboldCpp only makes vectors: storing and searching them is your app’s job (LangChain). A reranker is not offered (upstream).
The empty-vector trap
{"object": "list", "data": [{"object": "embedding", "index": 0, "embedding": []}], "model": "inactive", "usage": {"prompt_tokens": 0, "total_tokens": 0}}1Inactive Modules: … VectorEmbeddings …2- {"object": "list", "data": [{"object": "embedding", "index": 0, "embed: An empty list and the model name inactive.
- Inactive Modules: … VectorEmbeddings …: The start-up log says it too.
Detect it by checking the vector’s length, or the embeddings flag before you index F72.
TextDB in KoboldAI Lite
TextDB is retrieval inside Lite (Context, then the TextDB tab). Its provider box offers four choices, read from Lite’s own help text F104: Disabled; Local TextDB, which searches in your browser with strings; KoboldCpp Embeddings, which uses the embeddings model you loaded with --embeddingsmodel; and OpenAI API Embeddings, which sends text to a remote API. Defaults are 3 search results, 300 tokens of added history and a snippet size of 800. It can cause the prompt to be processed again, so give it enough context (context). We ran a search with the KoboldCpp Embeddings provider and two short documents pasted into the TextDB box: Lite sent three POST /api/extra/embeddings (the question and each document) before generating, and Qwen2.5-0.5B answered “Orsolya Brandt is the pastry chef at the Falcon Hotel.” from the stored text F105. We did not test the Local TextDB or OpenAI providers, or large documents.
Web search
Enables the built-in web search proxy (DuckDuckGo) used by Kobold Lite and the agent.Default falseLauncher Network tab: Enable WebSearchSince v1.81All details (the Network tab’s Enable WebSearch; since 1.81) lets Lite and the agent search the web through the server; the route is POST /api/extra/websearch with q. Search queries leave your PC for the search provider. In Lite the switches are in Settings, Tools tab: “Enable Websearch” and “Use multiple passes” under KoboldCpp Classic Websearch, and above them MCP tool calling with “Enable Toolcalling”, “Automatically Execute Tools”, custom tools and MCP server URLs F104.
Tool calling
OpenAI-style tools exist since 1.70 and automatic tool choice since 1.87; --jinja gives templates that support tools. With a 0.5B model the tool call came back parsed with the default adapter and as plain text with --jinja, so change one thing at a time F72. See the chat API and chat templates.
MCP tools
Path to a Claude-Desktop-format mcp.json listing MCP tool servers (HTTP or stdio) to expose to the UI and agent.Default Launcher Loaded Files tab: MCP JSONSince v1.106All details takes a Claude-Desktop-style mcp.json listing servers (since 1.106). The /mcp route answers JSON-RPC: a GET returned 405, and tools/list with no servers returned an empty tool list F99. We did not run an MCP server or the bundled UI’s MCP support.
The KoboldCpp Agent
Starts the bundled KoboldCpp Agent (tool-using assistant for code and tasks) in a new terminal window, or in the current one when combined with --cli. Forces Jinja and raises context/gen defaults.Default falseLauncher Agent tab: Launch KoboldCpp AgentSince v1.122All details (since 1.122) starts a bundled tool-using assistant in a new terminal, or in the current one with Runs an interactive chat in the terminal with no HTTP server. With --agent, runs the agent in the same terminal.Default falseLauncher Hardware tab: CLI Terminal OnlySince v1.87All details; Resumes a saved KoboldCpp Agent session from its JSON save file when the agent starts.Default Launcher Agent tab: Load Agent SessionSince v1.123All details resumes a saved session (1.123). The launcher has an Agent tab. untested Third-party agents use the OpenAI-style API: see other apps.
Frequently asked questions
Does KoboldCpp support embeddings?
Yes, with --embeddingsmodel and a GGUF embedding model. In our test a small model returned 384-dimension vectors from /v1/embeddings.
Why are my embeddings empty?
No embedding model is loaded. The endpoint still answers 200 with an empty vector and the model name inactive. Check /api/extra/version for embeddings true, or the length of the vector.
Is TextDB a vector database?
Not by default. Lite offers four providers: Disabled, Local TextDB (keyword search in your browser), KoboldCpp Embeddings (uses the embeddings model you loaded) and OpenAI API Embeddings. We ran a search with the KoboldCpp Embeddings provider and a small model answered correctly from two stored documents.
How do I enable web search?
Start with --websearch (or tick Enable WebSearch in the launcher). The route /api/extra/websearch answers an empty list whether the flag is on or off, so test with a real query. Search queries leave your PC.
Does KoboldCpp support MCP?
Yes: --mcpfile with an MCP config, and a /mcp route that answers JSON-RPC. With no servers configured, tools/list returned an empty list in our test. We did not run an MCP server.
What is the KoboldCpp Agent?
A bundled tool-using assistant started with --agent (since 1.122), in a new terminal or the current one with --cli. We did not run it.
Can KoboldCpp do RAG on its own?
KoboldCpp serves the vectors. Storing and searching them is your app's job: use LangChain or similar.