Use AutoGen with Shannon
Point AutoGen's OpenAIChatCompletionClient at Shannon and describe the model with model_info; agents and tools then run on Shannon models.
- Tested Nov 7, 2026
- OpenAI Chat Completions
- About 2 min
About AutoGen
AutoGen is Microsoft's open-source framework for agents that talk to each other and to tools. AgentChat, its high-level layer, builds assistants and teams on a model client. The OpenAI client takes a base URL and a description of the model, so AutoGen agents can run on 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
-
Install AgentChat and the OpenAI extension
Shellpip install autogen-agentchat 'autogen-ext[openai]' -
Create the client
AutoGen knows only OpenAI's model names. For any other id,
model_infotells it what the model can do; without it, the client raises an error.Pythonfrom autogen_ext.models.openai import OpenAIChatCompletionClient client = OpenAIChatCompletionClient( model="Kimi-K3-uncensored-NVFP4", base_url="https://api.shannon-ai.com/v1", api_key="YOUR_API_KEY", model_info={ "vision": True, "function_calling": True, "json_output": True, "structured_output": True, "family": "unknown", }, ) -
Run an agent with a tool
Pythonimport asyncio from autogen_agentchat.agents import AssistantAgent async def get_weather(city: str) -> str: """Weather for a city.""" return f"Sunny, 18 C in {city}" async def main(): agent = AssistantAgent("assistant", model_client=client, tools=[get_weather]) result = await agent.run(task="What is the weather in Oslo?") print(result.messages[-1].content) await client.close() asyncio.run(main())
Check that it works
Send: Run the agent sample.
You should see: A tool call to get_weather, then its result as the last message.
Models that fit AutoGen
Every id below meets what AutoGen 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
model_infois required for every id AutoGen does not know, which includes all Shannon ids.create_streampasses the model's reasoning through as text wrapped in<think>tags before the answer; strip it if you show the stream to users.- By default
AssistantAgentreturns the tool's result as its last message; setreflect_on_tool_use=Trueto have the model write an answer from it, which costs one more request.
Tips
client.create_stream([...])streams text chunks for a single request.- Set
"vision": Trueonly for models that accept images, such asKimi-K3-uncensored-NVFP4. - One client can serve several agents in a team; close it with
await client.close()at the end.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
ValueError: model_info is required when model name is not a valid OpenAI model | The model id is not one AutoGen knows. | Pass model_info as above. |
404 Not Found | base_url lacks /v1. | Use https://api.shannon-ai.com/v1. |
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 AutoGen work with Shannon?
Yes, through OpenAIChatCompletionClient with base_url="https://api.shannon-ai.com/v1" and a model_info block.
Do AutoGen tools work?
Yes; with function_calling: True the agent receives native tool calls, which we tested.