Personal and autonomous agents
Use CrewAI with Shannon
Create a CrewAI LLM with the openai/ prefix and Shannon's base_url; agents, tasks and crews then run on Shannon models.
- Tested Nov 7, 2026
- OpenAI Chat Completions
- About 3 min
About CrewAI
CrewAI is a Python framework where agents with roles, goals and tools work through tasks as a crew, or inside event-driven flows. Its LLM class goes through LiteLLM, so an OpenAI-compatible base URL is enough to run crews 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 CrewAI
Shellpip install crewai -
Create the LLM
The
openai/prefix selects the OpenAI-compatible route. Passcontext_window_size: for ids CrewAI does not know, it otherwise assumes 8,192 tokens.Pythonfrom crewai import LLM llm = LLM( model="openai/Kimi-K3-uncensored-NVFP4", base_url="https://api.shannon-ai.com/v1", api_key="YOUR_API_KEY", context_window_size=1022976, ) print(llm.call("Name three colours a cat can be.")) -
Run a crew with a tool
Pythonfrom crewai import Agent, Task, Crew from crewai.tools import tool @tool("get_weather") def get_weather(city: str) -> str: """Weather for a city.""" return f"Sunny, 18 C in {city}" reporter = Agent(role="Weather reporter", goal="Report the weather", backstory="You check the weather tool.", llm=llm, tools=[get_weather], max_iter=3) task = Task(description="What is the weather in Oslo? Use the tool.", expected_output="One sentence.", agent=reporter) print(Crew(agents=[reporter], tasks=[task]).kickoff())
Check that it works
Send: Run the crew sample.
You should see: One sentence with the weather in Oslo from the tool.
Models that fit CrewAI
Every id below meets what CrewAI 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.1-Pro-uncensored-NVFP4 | 1,022,976 | 262,144 | Yes |
MiMo-V2.6-Pro-uncensored-NVFP4 | 1,022,976 | 131,072 | Yes |
Kimi-K3-uncensored-3BIT-REAP | 225,280 | 225,280 | Yes |
shannon-3 | 196,608 | 65,536 | Yes |
Model settings
CrewAI asks for these values. They follow the model you picked.
| Setting | Value | Why |
|---|---|---|
context_window_size | 1022976 | CrewAI assumes 8,192 for unknown ids without it. |
Good to know
- Without
context_window_size, CrewAI warns that the window is unknown and assumes 8,192 tokens (6,963 usable), so long tasks get trimmed early. - Give every agent
llm=; an agent without one uses CrewAI's default OpenAI model and needs an OpenAI key. - Crews with planning or memory send extra requests; memory also needs an embedder, which Shannon does not serve.
Tips
max_itercaps how many steps an agent takes on a task.CREWAI_TRACING_ENABLED=falsekeeps runs from being traced to CrewAI's service.- Use one
LLMobject per Shannon id and hand different ones to different agents.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
LLM Provider NOT provided | The model id has no openai/ prefix. | Write it as openai/<id>. |
401 mentioning OpenAI | An agent or the planner has no llm and uses the default. | Pass llm= everywhere, including planning_llm. |
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 CrewAI work with Shannon?
Yes, through LLM(model="openai/<id>", base_url="https://api.shannon-ai.com/v1").
Do CrewAI tools work?
Yes; we ran a crew whose agent called a tool.