Skip to content
Khoj

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/v1 Endpoint: /v1/chat/completions
Every snippet below follows your choice.

Set it up

  1. 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.

    Shell
    mkdir ~/.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
  2. Add Shannon as an AI Model API

    Sign in at http://localhost:42110/server/admin with the admin email and password, open Ai model apis → Add, fill in the three fields and save.

    Ai model api
    Name:         Shannon
    Api key:      YOUR_API_KEY
    Api base url: https://api.shannon-ai.com/v1
    Khoj admin panel editing the AI model API named Shannon, with a hidden key and the Shannon API base URL
    A real setup on Khoj 1.42.10: the Shannon AI model API in the admin panel.
  3. 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 model
    Name:            shannon-3
    Model type:      Openai
    Ai model api:    Shannon
    Vision enabled:  yes
    Max prompt size: 196608
  4. 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.

    Shell
    docker compose restart server
  5. Chat

    Open http://localhost:42110 and send a message. Upload notes or connect a source under Settings and Khoj adds the matching passages to its prompt.

    Khoj web chat on Shannon answering which colours a cat can be: black, white, or orange
    A real chat on Khoj 1.42.10 with the Shannon model as server default: the reply came back in 15 seconds.

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 idContext windowMax outputImage 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.

SettingValueWhy
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

  1. 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.
  2. Set both Chat default and Chat advanced in Server chat settings: Khoj gives subscribed users the advanced model and everyone else the default one.
  3. Note search runs on Khoj's own local embedding model, so indexing your files needs nothing from Shannon.
  4. Open the admin panel at http://localhost:42110/server/admin, not 127.0.0.1: the login form otherwise fails its CSRF check.
  5. On a fresh install, OPENAI_BASE_URL, OPENAI_API_KEY and KHOJ_DEFAULT_CHAT_MODEL in Khoj's docker-compose.yml create the same entries at first start; we set them in the admin panel instead.

Troubleshooting

SymptomCauseFix
"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.

Choose your language

All languages are equal. Pick the one you want to browse in.

Europe

Middle East & North Africa

South Asia

Southeast Asia

East Asia

Central Asia & Caucasus

Africa

Oceania

Constructed & Classical