Use Dify with Shannon
Add Shannon to Dify through the OpenAI-API-compatible model provider, and every chatbot, workflow and agent in the workspace can use Shannon models.
- Tested Nov 7, 2026
- OpenAI Chat Completions
- About 10 min
About Dify
Dify is an open-source platform for building AI applications: chatbots, chatflows, workflows, agents and knowledge bases, run in Dify Cloud or self-hosted with Docker Compose. Teams use it to ship internal assistants and customer-facing bots without writing a backend. With Shannon added as an OpenAI-API-compatible provider, every app and LLM node in the workspace can pick Shannon models.
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 Dify (self-hosted)
Skip this on Dify Cloud. The official Compose setup needs one token in
.env; then openhttp://localhost/installand create the admin account.Shellgit clone --depth 1 https://github.com/langgenius/dify.git cd dify/docker cp .env.example .env # paste the output into DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN in .env openssl rand -hex 32 docker compose up -d -
Install the OpenAI-API-compatible provider
Open Integrations → Model Provider, find OpenAI-API-compatible (by langgenius) in the marketplace list and press Install.
-
Add a Shannon model
On the provider card press Add Model and fill in the form. Use
/v1at the end of the base URL. Replace the 4,096 defaults with the model's real context size and output limit.Add modelModel Type: LLM Model Name: Kimi-K3-uncensored-NVFP4 API Key: YOUR_API_KEY API Base URL: https://api.shannon-ai.com/v1 Completion mode: Chat Model context size: 1022976 Upper bound for max tokens: 262144
A real run on Dify 1.19.0 with provider 0.0.73: the top of the Add model form. -
Turn on tool calls and save
Further down, set Function Call Type to Tool Call and Stream function calling to Support so Agent apps and agent nodes can use tools. Set Vision Support to match the model. Press Add: Dify checks the key with one short request before it saves.
Further downFunction Call Type: Tool Call Stream function calling: Support Vision Support: Support
Dify 1.19.0: tool calls on for the Shannon model.
Check that it works
Send: Name three colours a cat can be, in one short sentence.
You should see: "A cat can be black, orange, or white." in Debug & Preview.
Models that fit Dify
Every id below meets what Dify 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 |
Model settings
Dify asks for these values. They follow the model you picked.
| Setting | Value | Why |
|---|---|---|
API Base URL | https://api.shannon-ai.com/v1 | With /v1. |
Model context size | 1022976 | Dify trims history to fit this; the default is 4,096. |
Upper bound for max tokens | 262144 | The largest answer length apps may set; the default is 4,096. |
Function Call Type | Tool Call | Needed for Agent apps and agent nodes. |
Good to know
- Each model is added by hand: the provider does not read Shannon's model list.
- Pressing Add sends one short request to check the key; it counts like any other request.
- We kept Thinking Mode Support at its default; the chat showed only the answer.
- Agent apps send tool definitions with each turn, so their prompts are much longer than a plain chatbot's.
Tips
- Set Default Models → System Reasoning Model to a Shannon model so new apps start on it and Dify's built-in helpers, such as the prompt Generate button, use it too.
- Add each Shannon id you need as its own model under the same provider; one API key serves all of them.
- An Authorization Name on the form lets you keep several keys for one model and switch between them under Manage Credentials.
- The form's API Type can also be set to the Responses API, which Shannon serves; Chat Completions is the default and what we tested.
- Publish an app and open Access Point to get a web app link or an API for it.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Agent apps never call tools | Function Call Type was left at Not Support. | Edit the model and set Tool Call, with Stream function calling on Support. |
| Answers stop early or old messages drop out | Context size and max tokens were left at 4,096. | Enter the model's context size and output limit in the model's settings. |
/install returns 500 and the api log says "Database migration skipped" | A failed first start left a migration lock behind. | Wait a minute, then docker compose restart api so the migration runs. |
| api keeps restarting: "PLUGIN_REMOTE_INSTALL_PORT must be a bare port number" | EXPOSE_PLUGIN_DEBUGGING_PORT was set to host:port. | Keep it a port number; bind addresses in a docker-compose.override.yaml instead. |
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 Dify work with Shannon?
Yes, through the OpenAI-API-compatible model provider with the API Base URL https://api.shannon-ai.com/v1.
Can Dify agents use tools on Shannon models?
Yes. Set Function Call Type to Tool Call when you add the model; Shannon models support tool calls.
Does this work on Dify Cloud?
Yes. Install the same provider from Integrations → Model Provider and add the model the same way.