Connect other apps to KoboldCpp
Apps on your own PC connect to http://localhost:5001 (KoboldAI type) or http://localhost:5001/v1 (OpenAI-compatible type). Websites such as Janitor AI and Chub run on someone else's server, so they cannot reach localhost: they need a public tunnel address, and a password. We tested LangChain and the Ollama client; the website and desktop apps below are untested by us and say so.
Checked against KoboldCpp 1.124.2 · updated 13 Nov 2026
- lab-lnx: Linux test VM · 4 vCPU · 15 GB · no GPU
On this page
The one rule: where does the app run?
| On the same PC | http://localhost:5001 or http://localhost:5001/v1 | Tested with LangChain and the Ollama client <EvidenceBadge id="F86" /> |
| In Docker on the same PC | The PC as the container sees it (not localhost) | Not run |
| On another device on your Wi-Fi | The PC's network address; start with --host ([remote access](/remote-access/#lan)) | Not run |
| A website or cloud app | A public https address: --remotetunnel ([remote access](/remote-access/#tunnel)) | Not run |
A browser rule also matters for websites: in Chrome 153 an https page could call KoboldCpp on http://127.0.0.1 or http://localhost, but not on the PC’s own network address, which was blocked as mixed content F78. KoboldCpp itself allows pages on other origins to call it, including with an Authorization header F77.
The generic recipe
| API type | OpenAI-compatible (preferred) or KoboldAI |
| Base URL | http://localhost:5001/v1 for OpenAI type; http://localhost:5001 for KoboldAI type |
| Key | Anything if there is no password; your --password if there is. A placeholder key gave 401 once a password was set |
| Model | The name is ignored for chat koboldcpp works |
KoboldCpp Janitor AI: what to paste
Janitor AI is a website. A request from a website cannot reach localhost on your PC, so you need a public address: start KoboldCpp with Downloads cloudflared and opens a trycloudflare.com tunnel so the instance is reachable from the internet without port forwarding.Default falseLauncher Quick Launch tab: Remote TunnelSince v1.48All details and API key that clients must send to use text endpoints (image endpoints are not protected). Also settable via KCPP_PASSWORD.Default noneLauncher Network tab: PasswordSince v1.61All details, and give Janitor the address KoboldCpp prints, and the password as the key. The tunnel address changes at every start, so a “failed to fetch” after a restart usually means the address is old. A 401 means the key is wrong, and a 404 means the path is in the wrong form (with or without /v1: guides disagree, so try both).
untested We could not test Janitor AI, a tunnel (the sandbox refused to open one), or what Janitor’s server sees. The steps above are the generic recipe plus the usual causes of those three messages. If you use Colab instead of your PC, see Colab.
Chub
The same pattern: a website needs the tunnel address and password. Whether Chub offers a KoboldAI-type or an OpenAI-type connection is for you to check in its settings; untested we did not open it.
Open WebUI
Add an OpenAI connection (in Open WebUI’s admin settings) with base URL http://localhost:5001/v1; from Docker use your PC’s address instead of localhost. An alternative is its Ollama mode, since KoboldCpp answers Ollama routes (the Ollama client worked). untested Not run.
Agnaistic and RisuAI
Both can use a KoboldAI-type or an OpenAI-type connection with the generic recipe. A browser version is a website (needs the tunnel address unless it runs locally). untested Not run.
VS Code with Continue
Continue takes an OpenAI-compatible provider: provider openai, apiBase http://localhost:5001/v1, any apiKey (or your password), and a code model (choose one). Keep the context size large enough for the files you send (context). Other coding tools that speak the OpenAI protocol follow the same recipe. untested Continue itself was not run.
n8n
Create an OpenAI credential with a custom base URL of http://localhost:5001/v1 (from a Docker n8n, your PC’s address) and any key. untested
LangChain and other Python and JavaScript frameworks
Tested F86:
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="http://localhost:5001/v1",
api_key="your --password, or any text if none is set",
model="koboldcpp",
)
print(llm.invoke("Say hi in three words.").content)invoke returned a reply with token counts and stream gave 10 chunks; with a password set, a wrong key and a placeholder both gave 401. Embeddings need an embeddings model loaded, or the vector comes back empty (F72, embeddings). The official OpenAI SDKs also work F72.
Home Assistant
Through an OpenAI-compatible conversation integration, with the generic recipe. We did not record the integration’s exact name or fields. untested
Ollama-only apps
Point them at http://localhost:5001. The Ollama Python client worked: chat answered and list returned the model, with the key sent as a Bearer header when a password was set F86. See the Ollama routes and Ollama compared.
Frequently asked questions
Can I run Janitor AI locally with KoboldCpp?
Janitor AI is a website, so it needs an address it can reach on the internet. Run KoboldCpp with --remotetunnel and --password, and paste the tunnel address and your password. We did not test Janitor AI or the tunnel.
What URL and key do I give Janitor AI?
The tunnel address that KoboldCpp prints, in the form your app asks for (base address or with /v1), and your --password as the key. Check the app's current wording: we could not open it.
Why does localhost fail from a website?
The website's own server, or a browser rule, makes the request, and to it localhost is not your PC. In Chrome 153, an https page could call http://127.0.0.1 but not the PC's network address, which was blocked as mixed content.
How do I use KoboldCpp with Open WebUI?
Add an OpenAI connection with the base URL http://localhost:5001/v1 (from inside Docker, the address of your PC as the container sees it). We did not run Open WebUI.
Does LangChain work with KoboldCpp?
Yes: ChatOpenAI with base_url set to http://localhost:5001/v1 worked, including streaming. With a password set the key must be that password.
Can an app that only supports Ollama use KoboldCpp?
The Ollama Python client worked: host http://localhost:5001, chat and list answered. Other Ollama-only apps are untested.