Notes, browser and translation
Use Khoj with Shannon
Add Shannon as an AI Model API in Khoj's admin panel, create a chat model on it, and Khoj answers from your notes and documents with Shannon models.
- Tested Nov 7, 2026
- OpenAI Chat Completions
- About 8 min
About Khoj
Khoj is an open-source personal AI assistant that answers from your own notes and documents (Markdown, Org, PDF, Notion, GitHub) and from the web, with agents, automations and a research mode. It runs in the browser, as a desktop app and inside Obsidian and Emacs, either on Khoj's cloud or self-hosted with Docker. A self-hosted Khoj on Shannon keeps your notes and their search index on your own server; the question and the passages Khoj finds go to the Shannon model.
What you need
- A Shannon API key
- Keys & usage
- Base URL
-
https://api.shannon-ai.com/v1Endpoint:/v1/chat/completions - Every snippet below follows your choice.
Set it up
-
Start Khoj with Docker Compose
Download Khoj's compose file, set an admin email, an admin password and a Django secret key in it, and start it. The web app opens at
http://localhost:42110.Shellmkdir ~/.khoj && cd ~/.khoj wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml # edit KHOJ_ADMIN_EMAIL, KHOJ_ADMIN_PASSWORD and KHOJ_DJANGO_SECRET_KEY docker compose up -d -
Add Shannon as an AI Model API
Sign in at
http://localhost:42110/server/adminwith the admin email and password, open Ai model apis → Add, fill in the three fields and save.Ai model apiName: Shannon Api key: YOUR_API_KEY Api base url: https://api.shannon-ai.com/v1
A real setup on Khoj 1.42.10: the Shannon AI model API in the admin panel. -
Create a chat model on it
Open Chat models → Add. The name is the Shannon model id, the type is Openai, and Ai model api is the entry you just made. Tick Vision enabled only for a model that takes images.
Chat modelName: shannon-3 Model type: Openai Ai model api: Shannon Vision enabled: yes Max prompt size: 196608 -
Make it the default, then restart Khoj
Under Server chat settings → Add, choose the model as Chat default and Chat advanced and save. Restart the server once: Khoj creates its built-in agent at start, and without it the first message fails.
Shelldocker compose restart server
Check that it works
Send: Name three colours a cat can be, in one short sentence.
You should see: A one-line answer from Khoj, such as "A cat can be black, white, or orange.", with a collapsed Thought Process above it.
Models that fit Khoj
Every id below meets what Khoj needs. The first one is the default in the snippets.
| Model id | Context window | Max output | Image input |
|---|---|---|---|
shannon-3 | 196,608 | 65,536 | Yes |
shannon-3-pro | 196,608 | 65,536 | Yes |
Kimi-K3-uncensored-3BIT-REAP | 225,280 | 225,280 | Yes |
Kimi-K3-uncensored-NVFP4 | 1,022,976 | 262,144 | Yes |
Model settings
Khoj asks for these values. They follow the model you picked.
| Setting | Value | Why |
|---|---|---|
Max prompt size | 196608 | Empty means Khoj trims each request to 10,000 tokens. |
Vision enabled | yes | Only for a model that takes images. |
Good to know
- One message can make more than one request: Khoj may first ask the model which sources and tools to use (the collapsed Thought Process), then writes the answer.
- Research mode runs many requests in a row with long prompts; leave it off for everyday questions.
- The Model type stays Openai for every Shannon model: Khoj uses it to choose the request format, and Shannon speaks that format.
Tips
- Khoj trims each request to Max prompt size; left empty it uses 10,000 tokens for an unknown model. Raise it on the chat model for long notes, knowing that longer prompts cost more.
- Set both Chat default and Chat advanced in Server chat settings: Khoj gives subscribed users the advanced model and everyone else the default one.
- Note search runs on Khoj's own local embedding model, so indexing your files needs nothing from Shannon.
- Open the admin panel at
http://localhost:42110/server/admin, not127.0.0.1: the login form otherwise fails its CSRF check. - On a fresh install,
OPENAI_BASE_URL,OPENAI_API_KEYandKHOJ_DEFAULT_CHAT_MODELin Khoj'sdocker-compose.ymlcreate the same entries at first start; we set them in the admin panel instead.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| "Error creating new conversation" and nothing is sent | No chat model existed when Khoj started, so its built-in agent was never created (the session request returns 400). | Restart the server after adding the chat model: docker compose restart server. |
| "CSRF verification failed" when signing in to the admin panel | The page was opened as 127.0.0.1 or under a domain Khoj does not trust. | Use http://localhost:42110/server/admin, or set KHOJ_DOMAIN to the domain you use. |
| Answers forget earlier turns or long notes | Max prompt size is empty, so Khoj trims requests to 10,000 tokens. | Set Max prompt size on the chat model. |
401 Unauthorized | The key is missing, mistyped or rotated. | Copy the key again from Keys & usage; it starts with sk-. |
context_length_exceeded / "prompt is too long" | The conversation is longer than the model's window. | Start a new chat, let the tool compact it, or pick a model with a larger window. |
insufficient_quota | Your balance cannot pay for the request. | Top up or change plan; the request is not retried by itself. |
Questions
Does Khoj work with Shannon?
Yes. Add an Ai model api with base URL https://api.shannon-ai.com/v1 and a chat model of type Openai that uses it.
Do my notes leave my server?
The notes and their index stay in your Khoj. For each question Khoj sends the question and the passages it found to the Shannon model.