Repository navigation
feat: add fireworks_ai to native OpenAI-compatible provider routing - #8803
Felix Shi (shi-felix) wants to merge 3 commits into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Strix Security ReviewWarning This pull request has 117 commits after the last Strix review ( ✅ No open security findings. PR summary: Adds `fireworks_ai` as a native OpenAI-compatible provider so `LLM(model="fireworks_ai/accounts/<acct>/models/<model>")` routes through the built-in OpenAI client instead of LiteLLM, with a provider config, routing registration, tests, and translated docs. Review summaryReviewed all 7 changed files: the new Ruled out (4)
Review 1 on this PR · Reviewed by Strix |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f5d5ffa. Configure here.
| api_key_env="FIREWORKS_API_KEY", | ||
| base_url_env="FIREWORKS_BASE_URL", | ||
| api_key_required=True, | ||
| ), |
There was a problem hiding this comment.
Fireworks context windows miss catalog
Medium Severity
Native fireworks_ai routing inherits OpenAICompletion.get_context_window_size, which queries OPENAI_CONTEXT_WINDOWS only. Catalogued Fireworks limits never match, so those models compact against the 8192 default instead of their published windows.
Additional Locations (1)
Triggered by learned rule: Context-window catalog matching
Reviewed by Cursor Bugbot for commit f5d5ffa. Configure here.
|
Cursor Bugbot is right that Fireworks ids never match I've opened #8812 to resolve compatible-provider context windows from their own catalog entries. Once it lands, this PR (and #8801/#8804) pick the fix up automatically — |


Summary
fireworks_ainow routes through the nativeOpenAICompatibleCompletioninstead of falling back to LiteLLM, soLLM(model="fireworks_ai/accounts/fireworks/models/<model-id>")works without the LiteLLM extra.Fixes #8010.
Changes
lib/crewai/src/crewai/llms/providers/openai_compatible/completion.py: add thefireworks_aiProviderConfig(https://api.fireworks.ai/inference/v1,FIREWORKS_API_KEY, optionalFIREWORKS_BASE_URL) and list it in the class docstring.lib/crewai/src/crewai/llm.py: addfireworks_aitoSUPPORTED_NATIVE_PROVIDERS,PROVIDER_ALIASES, the native-provider set in_get_native_provider, and_matches_provider_pattern.lib/crewai/tests/llms/openai_compatible/test_openai_compatible.py: coverage for the registry entry, the missing-key error (and that an OpenAI key is not reused), prefixed and explicit-provider routing,FIREWORKS_BASE_URL, explicit-config precedence, account-scoped model ids, and the resolved client params.docs/edge/{en,ar,ko,pt-BR}/concepts/llms.mdx: a Fireworks AI accordion.Only the
fireworks_ai/prefix is stripped: an id such asfireworks_ai/accounts/acme/models/qwen3-235b-a22b-instruct-2507reaches the SDK asaccounts/acme/models/qwen3-235b-a22b-instruct-2507. The existingfireworks_ai/spelling is kept, and nofireworks/alias is added.is_litellm=Truestill forces the LiteLLM path, and the other native providers are untouched.Testing
Python 3.13.14 on Windows. No provider credentials and no paid API calls were used.
AI assistance
Written with AI assistance (WorkBuddy) and reviewed before submission.
Note
Low Risk
Scoped LLM routing and provider config with tests; no auth or data-path changes beyond using the correct Fireworks API key env var.
Overview
Fireworks AI now uses CrewAI’s native
OpenAICompatibleCompletionpath instead of LiteLLM, soLLM(model="fireworks_ai/...")works withoutcrewai[litellm].Routing registers
fireworks_aiin native provider lists and aliases, maps it to the shared OpenAI-compatible client withFIREWORKS_API_KEY, optionalFIREWORKS_BASE_URL(defaulthttps://api.fireworks.ai/inference/v1), and requires Fireworks credentials—OPENAI_API_KEYis not reused. Only thefireworks_ai/prefix is stripped; paths likeaccounts/<account>/models/<model>are sent to the API unchanged.Tests cover config, routing, env overrides, explicit
api_key/base_url, and client params. Docs in en/ar/ko/pt-BR add a native Fireworks accordion (mirroring DeepInfra); older LiteLLM-only Fireworks sections elsewhere in those pages are not updated in this diff.Reviewed by Cursor Bugbot for commit a60d5ed. Bugbot is set up for automated code reviews on this repo. Configure here.