Use LiteLLM with Shannon
Call Shannon from LiteLLM with the openai/ prefix and api_base, or add it to a LiteLLM proxy's model list.
- Tested Nov 7, 2026
- OpenAI Chat Completions
- About 2 min
About LiteLLM
LiteLLM is a Python library and a proxy server that give many model providers one interface in the OpenAI format, with routing, budgets and logging. Teams put it in front of their apps to switch providers without code changes. Shannon plugs in as an OpenAI-compatible provider, in the SDK or in the proxy.
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
-
Install LiteLLM
Shellpip install 'litellm[proxy]' -
Call Shannon from the SDK
The
openai/prefix tells LiteLLM to use its OpenAI-compatible route;api_basepoints it at Shannon.Pythonimport litellm kw = dict(model="openai/Kimi-K3-uncensored-NVFP4", api_base="https://api.shannon-ai.com/v1", api_key="YOUR_API_KEY") for chunk in litellm.completion(messages=[{"role": "user", "content": "Name three colours a cat can be."}], stream=True, **kw): print(chunk.choices[0].delta.content or "", end="") r = litellm.completion( messages=[{"role": "user", "content": "What is the weather in Oslo?"}], tools=[{"type": "function", "function": {"name": "get_weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}], **kw, ) print(r.choices[0].message.tool_calls[0].function.arguments) # {"city": "Oslo"} -
Or serve Shannon through the LiteLLM proxy
Add Shannon to the proxy's
model_list; clients of the proxy then ask formodel_name.config.yamlmodel_list: - model_name: Kimi-K3-uncensored-NVFP4 litellm_params: model: openai/Kimi-K3-uncensored-NVFP4 api_base: https://api.shannon-ai.com/v1 api_key: os.environ/SHANNON_API_KEY general_settings: master_key: os.environ/LITELLM_MASTER_KEY -
Start the proxy
Current LiteLLM refuses to start the proxy without a strong master key; clients send it as their bearer key.
Shellexport SHANNON_API_KEY=YOUR_API_KEY export LITELLM_MASTER_KEY=sk-$(openssl rand -hex 24) litellm --config config.yaml --port 4000
Check that it works
Send: Run the SDK sample.
You should see: The colours stream in, then the tool arguments print.
Models that fit LiteLLM
Every id below meets what LiteLLM needs. The first one is the default in the snippets.
| Model id | Context window | Max output | Image input |
|---|---|---|---|
Kimi-K3-uncensored-NVFP4 | 1,022,976 | 262,144 | Yes |
Kimi-K3-uncensored-3BIT-REAP | 225,280 | 225,280 | Yes |
shannon-3 | 196,608 | 65,536 | Yes |
shannon-coder-1 | 131,072 | 65,536 | No |
Good to know
- Without the
openai/prefix LiteLLM does not know which route to use and raisesLLM Provider NOT provided. - LiteLLM has no price data for Shannon ids; add
input_cost_per_tokenandoutput_cost_per_tokenundermodel_infoif you want its spend tracking. - The proxy reads
os.environ/SHANNON_API_KEYat start; export the variable beforelitellm --config. - Without
master_key, the proxy stops at start with a message about a weak or unset master key.
Tips
anthropic/<id>withapi_base="https://api.shannon-ai.com"uses Shannon's Anthropic-format endpoint instead.- Give proxy users a short alias in
model_nameand keep the Shannon id inlitellm_params.model. - Add several Shannon ids to
model_listto route or fall back between them.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
LLM Provider NOT provided | The model has no openai/ prefix. | Write the model as openai/<id>. |
404 Not Found | api_base lacks /v1. | Use https://api.shannon-ai.com/v1. |
401 through the proxy | SHANNON_API_KEY was not set when the proxy started. | Export it and restart the proxy. |
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 LiteLLM work with Shannon?
Yes, as an OpenAI-compatible provider: model="openai/<id>" with api_base="https://api.shannon-ai.com/v1".
Can I put Shannon behind the LiteLLM proxy?
Yes; add it to model_list as shown, and every proxy client can use it.