[FEATURE] Support TrustedRouter as an OpenAI-compatible provider
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 58.8k
- Forks
- 8.5k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 109
Description
Feature Area: Integration with external tools
Problem
NA — not related to an existing bug.
TrustedRouter is an OpenAI-compatible LLM router at https://api.trustedrouter.com/v1. CrewAI already routes several OpenAI-compatible gateways natively (OpenRouter and friends), but reaching TrustedRouter today means hand-setting base_url on every LLM, and the routing aliases do not survive the prefix strip that native routing applies.
Describe the solution you'd like
Register trustedrouter alongside the existing OpenAI-compatible entries:
- Runtime routing in
crewai.llm.LLMsoLLM(model="trustedrouter/auto")andLLM(model="trustedrouter/moonshotai/kimi-k3")both reachOpenAICompatibleCompletion, withTRUSTEDROUTER_API_KEYand an optionalTRUSTEDROUTER_BASE_URLoverride. - A
trustedrouter/section in the LLM concept guide (en, plus thear,koandpt-BRtranslations that carry the same provider list).
One detail worth calling out, because it is the part that is not a copy of the OpenRouter handling: every TrustedRouter model id is namespaced, so the prefix strip that is correct for OpenRouter breaks the router's own aliases — trustedrouter/auto reaches the API as auto, which it rejects. trustedrouter/moonshotai/kimi-k3 still has to resolve to the upstream id, so the split is on whether the remainder is left bare, not on the provider alone.
Describe alternatives you've considered
Configuring base_url per-LLM works today but leaves the aliases unusable and gives no CLI/docs discoverability, which is the same argument that applies to the gateways CrewAI already routes natively.
Additional context
Implementation is written and passing — ruff check clean, tests/llms/openai_compatible green (43) — in #6143, which was auto-closed for not referencing an issue. This is that issue.
Willingness to Contribute
Yes, I'd be happy to submit a pull request
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crewai.llm.LLM and compare the existing OpenAI-compatible provider routing. Review tests/llms/openai_compatible, where the issue reports 43 passing tests, then inspect the LLM concept guide in English and the ar, ko, and pt-BR translations. Done means TrustedRouter routing and its documented provider section are covered while the existing test suite remains green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend-api-design, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100