feat(fireworks): add Fireworks AI provider#475
Conversation
Add Fireworks AI (api.fireworks.ai/inference/v1) as a provider, discovered via FIREWORKS_API_KEY with optional FIREWORKS_BASE_URL/FIREWORKS_MODELS. The provider embeds openai.ChatCompatible: chat completions, streaming, /models discovery, embeddings, and passthrough come from the shared OpenAI-compatible transport, with /v1/responses translated through chat. The "fireworks" type matches the ai-model-list registry key, so model metadata, pricing enrichment, and cost tracking work without extra mapping; account-scoped model IDs (accounts/fireworks/models/...) pass through verbatim. Document the provider in the overview matrix (no dedicated page needed: bearer key + optional base URL), .env.template, config.example.yaml, and the swagger description. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Warning Review limit reached
Next review available in: 16 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| func TestProvider_DoesNotExposeOptionalOpenAICompatibleInterfaces(t *testing.T) { | ||
| provider := NewWithHTTPClient("fw-key", "", nil, llmclient.Hooks{}) | ||
|
|
||
| if _, ok := any(provider).(core.NativeBatchProvider); ok { | ||
| t.Fatal("fireworks provider should not implement native batch provider") | ||
| } | ||
| if _, ok := any(provider).(core.NativeFileProvider); ok { | ||
| t.Fatal("fireworks provider should not implement native file provider") | ||
| } | ||
| if _, ok := any(provider).(core.AudioProvider); ok { | ||
| t.Fatal("fireworks provider should not implement audio provider") | ||
| } | ||
| } |
There was a problem hiding this comment.
StreamChatCompletion is not exercised anywhere in the test suite. The chat test verifies the non-streaming path (/chat/completions), but the streaming path (/chat/completions with stream: true and an SSE response) is left untested. Other providers like MiniMax override streaming explicitly; fireworks inherits it but the test surface gap means a regression in ChatCompatible.StreamChatCompletion (or providers.EnsureChatCompletionSSE) would not be caught by this package's tests. A short TestStreamChatCompletion_UsesBearerAuthAndStreamEndpoint similar to the other two transport tests would close this gap.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| // "accounts/fireworks/models/llama-v3p1-8b-instruct" and pass through | ||
| // unchanged. | ||
| type Provider struct { |
There was a problem hiding this comment.
Passthrough stays disabled
Embedding ChatCompatible makes Fireworks implement Passthrough, but the server only exposes /p/{provider}/... for the allowlist in config/config.go and internal/server/passthrough_support.go, which currently omits fireworks. With the documented default setup of only FIREWORKS_API_KEY, /p/fireworks/... returns provider passthrough for "fireworks" is not enabled, so the advertised passthrough surface is not reachable unless users override ENABLED_PASSTHROUGH_PROVIDERS.
Summary
Adds Fireworks AI (
api.fireworks.ai/inference/v1) as a first-class provider. SettingFIREWORKS_API_KEYis the whole setup — the provider is auto-discovered, with optionalFIREWORKS_BASE_URLandFIREWORKS_MODELSoverrides following the standard convention.User-visible impact
fireworks: chat completions, streaming,/v1/modelsdiscovery, embeddings, passthrough, and/v1/responses(translated via chat completions).accounts/fireworks/models/gpt-oss-120b) and pass through verbatim, including inFIREWORKS_MODELSlists.fireworkstype matches the ai-model-list registry key (76 models), and usage costing falls back to the shared OpenAI-compatible token mappings.Provider-specific behavior
openai.ChatCompatibleembed (same shape as Z.ai/MiniMax/Xiaomi) — all transport is shared code; there is no Fireworks-specific request/response translation.Testing
go test ./...,make lint(0 issues), and pre-commitmake test-raceall green./v1/modelslistedfireworks/accounts/fireworks/models/..., and chat/embeddings/responses round-tripped correctly with slash-containing model IDs.GET /inference/v1/modelsendpoint (401 without key) to confirm upstream discovery support.🤖 Generated with Claude Code