Repository navigation
feat(llms): add fireworks_ai as an openai-compatible provider - #8014
Nagizaaz Shaik (shaikn6) wants to merge 11 commits into
Conversation
Register fireworks_ai in the OpenAI-compatible provider registry so LLM(model="fireworks_ai/accounts/fireworks/models/<model>") and provider="fireworks_ai" route natively through OpenAICompatibleCompletion with FIREWORKS_API_KEY and no LiteLLM install. FIREWORKS_BASE_URL overrides the endpoint, explicit api_key/base_url win over both env vars, and OPENAI_* settings are never used. Only the fireworks_ai/ prefix is removed, so the accounts/... resource path reaches the API intact. is_litellm=True keeps the LiteLLM path. The Fireworks AI docs accordion is updated in en, ar, ko and pt-BR. Fixes crewAIInc#8010
Strix Security ReviewWarning This pull request has 238 commits after the last Strix review ( No security issues found. Review summaryReviewed all seven changed files in this PR, which registers Updated for Reviewed by Strix |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
Routing fireworks_ai natively sent its models through the OpenAI-only lookup, which resolves 280 of the 330 fireworks_ai ids in the catalog to a different limit than the catalog lists. The lookup now uses provider/model first and the id as given second.
|
Merged main and added a context-window lookup that follows #8077. Once One thing I left alone: with |
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
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 7fe2151. Configure here.
Signed-off-by: Nagizaaz Shaik <176337212+shaikn6@users.noreply.github.com> # Conflicts: # lib/crewai/tests/llms/openai_compatible/test_openai_compatible.py
Signed-off-by: Nagizaaz Shaik <176337212+shaikn6@users.noreply.github.com>
…lm extra Signed-off-by: Nagizaaz Shaik <176337212+shaikn6@users.noreply.github.com>

Related issue
Fixes #8010
Summary
Registers
fireworks_aiinOPENAI_COMPATIBLE_PROVIDERSand the factory routing tables (SUPPORTED_NATIVE_PROVIDERS,PROVIDER_ALIASES,_matches_provider_pattern,_get_native_provider), following the DeepInfra change in #7459.LLM(model="fireworks_ai/accounts/fireworks/models/<model>")andprovider="fireworks_ai"now buildOpenAICompatibleCompletionwithout LiteLLM.https://api.fireworks.ai/inference/v1, key fromFIREWORKS_API_KEY, optionalFIREWORKS_BASE_URLoverride.api_key/base_urltake precedence over the env vars;OPENAI_API_KEY/OPENAI_BASE_URLare never used, and a missing key raises an error namingFIREWORKS_API_KEY.fireworks_ai/prefix is removed, soaccounts/fireworks/models/<model-id>reaches the SDK intact. The existingfireworks_ai/spelling is kept; nofireworks/alias is added.is_litellm=Truestill selects the LiteLLM path.Verification
New
TestHostedProvidersintests/llms/openai_compatible/test_openai_compatible.py, parametrized by provider. It covers config, prefixed and explicit-provider routing (fullaccounts/...path preserved), OpenAI env isolation, missing-key error,FIREWORKS_BASE_URL, explicit precedence, theis_litellm=Truepath, and sync and async calls through anhttpx.MockTransportthat checks the URL,Authorizationheader and model id sent. No network or paid calls.With the source change reverted, 7 of the new tests fail.
ruff checkon the changed source files is clean.Additional context
The same test class is introduced by #8013 (Groq, #8009). Whichever merges second needs a one-row rebase of
HOSTED_PROVIDER_CASES, which I'll handle.Docs: the Fireworks AI accordion in
docs/edge/{en,ar,ko,pt-BR}/concepts/llms.mdxnow says it uses the native client, listsFIREWORKS_BASE_URL, and drops the LiteLLM install note. Frozendocs/v*/snapshots are unchanged.Prepared with AI assistance (Claude Code), per CONTRIBUTING. I don't have permission to apply the
llm-generatedlabel, so could a maintainer add it?Note
Medium Risk
Touches core LLM factory routing and provider credentials; risk is moderate but mitigated by broad tests and the same pattern used for other OpenAI-compatible hosts.
Overview
Fireworks AI now routes through
OpenAICompatibleCompletioninstead of LiteLLM when you usefireworks_ai/...model ids orprovider="fireworks_ai". Routing tables inllm.pyand the CLI’s_NATIVE_ANY_MODEL_PROVIDERSwere updated; configuration usesFIREWORKS_API_KEY, default endpointhttps://api.fireworks.ai/inference/v1, and optionalFIREWORKS_BASE_URL, with full resource paths (e.g.accounts/fireworks/models/...) passed through to the API unchanged.OpenAICompatibleCompletiongainsget_context_window_size()so OpenAI-compatible models resolve limits from the shared catalog (with Fireworks-specific coverage tested). A parametrizedTestHostedProviderssuite exercises Fireworks routing, env isolation fromOPENAI_*, sync/async request shaping, and the legacyis_litellm=Truepath. Docs in en, ar, ko, pt-BR now describe the native client setup and drop the LiteLLM install note.Reviewed by Cursor Bugbot for commit d5515d3. Bugbot is set up for automated code reviews on this repo. Configure here.