crewAIInc / crewAIInc/crewAI

[FEATURE] Support TrustedRouter as an OpenAI-compatible provider

Open
#7,395 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

vendor-pitch
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.LLM so LLM(model="trustedrouter/auto") and LLM(model="trustedrouter/moonshotai/kimi-k3") both reach OpenAICompatibleCompletion, with TRUSTEDROUTER_API_KEY and an optional TRUSTEDROUTER_BASE_URL override.
  • A trustedrouter/ section in the LLM concept guide (en, plus the ar, ko and pt-BR translations 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.