Repository navigation
feat(fireworks_ai): add native Responses API config - #39826
mateo-berri merged 10 commits into
Conversation
Greptile SummaryRoutes Fireworks AI Responses API operations through Fireworks’ native endpoint while preserving LiteLLM behavior for unsupported native features.
Confidence Score: 5/5The PR appears safe to merge, with no outstanding correctness, security, or repository-rule issues identified. The latest revision correctly moves developer-message conversion after base input normalization, preserving dictionary and Pydantic replay inputs without duplicate processing. The earlier streaming concern is covered by a native SSE regression test, while the delete and typing findings were correctly withdrawn and all previous threads are resolved.
|
| Filename | Overview |
|---|---|
| litellm/llms/fireworks_ai/responses/transformation.py | Adds the native Fireworks Responses configuration and request/response adaptations; the latest input-normalization change is correctly integrated. |
| litellm/llms/fireworks_ai/common_utils.py | Extracts shared API-key and session-affinity helpers without changing the existing chat path’s effective behavior. |
| litellm/utils.py | Registers Fireworks AI for native Responses configuration selection. |
| litellm/_lazy_imports_registry.py | Adds the Fireworks Responses configuration to the lazy-import registry. |
| tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py | Provides comprehensive mocked coverage for native requests, streaming, replay inputs, file search, authentication, sessions, and deletion. |
| tests/test_litellm/responses/test_responses_websocket_all_providers.py | Verifies Fireworks continues to use LiteLLM’s managed WebSocket handling. |
Reviews (10): Last reviewed commit: "chore: merge litellm_internal_staging in..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…itellm_lit_6348_fireworks_responses_api # Conflicts: # basedpyright-code-budget.json # type-discipline-budget.json
…he native responses path
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: File search treated as native
- Overrode supports_native_file_search to return False on FireworksAIResponsesAPIConfig so file_search tools flow through the emulated chat-bridge instead of the unsupported Fireworks /responses path.
Or push these changes by commenting:
@cursor push 61949f7db8
Preview (61949f7db8)
diff --git a/litellm/llms/fireworks_ai/responses/transformation.py b/litellm/llms/fireworks_ai/responses/transformation.py
--- a/litellm/llms/fireworks_ai/responses/transformation.py
+++ b/litellm/llms/fireworks_ai/responses/transformation.py
@@ -94,3 +94,6 @@
def supports_native_websocket(self) -> bool:
return False
+
+ def supports_native_file_search(self) -> bool:
+ return False
diff --git a/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py b/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py
--- a/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py
+++ b/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py
@@ -105,6 +105,11 @@
assert config.custom_llm_provider == LlmProviders.FIREWORKS_AI
+def test_fireworks_ai_does_not_advertise_native_file_search() -> None:
+ """Fireworks has no vector-store file_search, so the emulated chat-bridge path must handle it."""
+ assert FireworksAIResponsesAPIConfig().supports_native_file_search() is False
+
+
def test_responses_call_hits_native_endpoint_with_mcp_tool_untouched() -> None:
client: Final = _mock_http_client(_fireworks_response("accounts/fireworks/models/kimi-k3"))
mcp_tool: Final[Mcp] = {You can send follow-ups to the cloud agent here.
…the Responses API
Pull request was closed
Pull request was closed
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Developer mapping crashes on pydantic items
- Guarded
_developer_item_as_systemwithisinstance(item, dict)so pydantic output items pass through untouched and reach the OpenAI base class's_validate_input_paramfor dict conversion.
- Guarded
- ✅ Fixed: Session affinity drops session_id
- Extended
_session_paramsto also forward the top-levelsession_idextra soget_fireworks_session_idcan pin the request viax-session-affinity.
- Extended
Or push these changes by commenting:
@cursor push f9145b6a5a
Preview (f9145b6a5a)
diff --git a/litellm/llms/fireworks_ai/responses/transformation.py b/litellm/llms/fireworks_ai/responses/transformation.py
--- a/litellm/llms/fireworks_ai/responses/transformation.py
+++ b/litellm/llms/fireworks_ai/responses/transformation.py
@@ -27,12 +27,16 @@
def _session_params(litellm_params: GenericLiteLLMParams) -> Mapping[str, object]:
extras: Final[Mapping[str, object]] = litellm_params.model_extra or MappingProxyType({})
return MappingProxyType(
- {"litellm_session_id": extras.get("litellm_session_id"), "metadata": extras.get("litellm_metadata")}
+ {
+ "litellm_session_id": extras.get("litellm_session_id"),
+ "session_id": extras.get("session_id"),
+ "metadata": extras.get("litellm_metadata"),
+ }
)
def _developer_item_as_system(item: ResponseInputItemParam) -> ResponseInputItemParam:
- if "role" not in item or item["role"] != "developer":
+ if not isinstance(item, dict) or item.get("role") != "developer":
return item
return EasyInputMessageParam(role="system", content=item["content"], type="message")
diff --git a/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py b/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py
--- a/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py
+++ b/tests/test_litellm/llms/fireworks_ai/responses/test_fireworks_ai_responses_transformation.py
@@ -197,6 +197,43 @@
assert headers["x-session-affinity"] == "sess-42"
+def test_responses_call_sends_session_affinity_for_top_level_session_id() -> None:
+ client: Final = _mock_http_client(_fireworks_response("accounts/fireworks/models/kimi-k3"))
+ with patch(HTTPX_CLIENT_FACTORY, return_value=client):
+ litellm.responses(model="fireworks_ai/kimi-k3", input="hi", api_key="fw-test-key", session_id="sess-top")
+ _, headers, _ = _sent_request(client)
+ assert headers["x-session-affinity"] == "sess-top"
+
+
+def test_responses_call_accepts_pydantic_output_items_replayed_as_input() -> None:
+ client: Final = _mock_http_client(_fireworks_response("accounts/fireworks/models/kimi-k3"))
+ replay: Final = [ # mutable-ok: the Responses API takes input items as a JSON list
+ ResponseOutputMessage(
+ id="msg_prev",
+ status="completed",
+ role="assistant",
+ type="message",
+ content=(ResponseOutputText(type="output_text", text="hi back", annotations=()),),
+ ),
+ ResponseFunctionToolCall(
+ id="fc_prev",
+ call_id="call_prev",
+ name="get_weather",
+ arguments='{"city": "Paris"}',
+ status="completed",
+ type="function_call",
+ ),
+ {"role": "developer", "content": "Answer with exactly one word."},
+ ]
+ with patch(HTTPX_CLIENT_FACTORY, return_value=client):
+ litellm.responses(model="fireworks_ai/kimi-k3", input=replay, api_key="fw-test-key")
+ _, _, body = _sent_request(client)
+ sent: Final = tuple(body["input"])
+ assert sent[0]["type"] == "message" and sent[0]["role"] == "assistant"
+ assert sent[1]["type"] == "function_call" and sent[1]["call_id"] == "call_prev"
+ assert sent[2] == {"role": "system", "content": "Answer with exactly one word.", "type": "message"}
+
+
def test_responses_call_keeps_caller_supplied_session_affinity_header() -> None:
client: Final = _mock_http_client(_fireworks_response("accounts/fireworks/models/kimi-k3"))
pinned: Final[Mapping[str, str]] = MappingProxyType({"x-session-affinity": "explicit-node"})You can send follow-ups to the cloud agent here.
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 18aa52d. Configure here.
bb8fe4a
into
litellm_internal_staging

TLDR
Problem this solves:
/v1/responsescalls forfireworks_ai/models were bridged through chat completionstype: "mcp"tool is attachedprevious_response_id) was unreachable through LiteLLMHow it solves it:
FireworksAIResponsesAPIConfig, routingfireworks_ai/models tohttps://api.fireworks.ai/inference/v1/responsesaccounts/fireworks/models/<name>,x-session-affinitycarries the caller's session id{"message": "Response deleted successfully"}delete body onto the standard{id, object, deleted}resultdeveloperinput items assystemmessages, because Fireworks' Responses API rejected the developer role on kimi-k3 and qwen3.8 when this was built (a534b9f)file_searchtools on LiteLLM's emulated file search, the way the bridge ran them, because Fireworks' Responses API accepts the tool and silently skips the search (0157808)User Flow
Before: a developer whose agent app calls the gateway with the OpenAI SDK's
client.responses.createon a Fireworks model gets a 400 the moment it attaches an MCP tool, because the request is rewritten into a chat completion that Fireworks rejectsfireworks_ai/accounts/fireworks/models/kimi-k3to the model list asfireworks-kimi-k3and restarts the proxy"model": "fireworks-kimi-k3", an input string, and aget_weatherfunction toolreasoning,message,function_call, the function call carryingcall_idget_weather_0previous_response_idset to that response's id and afunction_call_outputitem for the callmessagereading out the weather{"type": "mcp", "server_label": "deepwiki", "server_url": "https://mcp.deepwiki.com/mcp", "require_approval": "never"}toolFireworks_aiException - ... Input should be 'function', 'web_search_preview' or 'code_interpreter', field: 'tools[0].type', value: 'mcp'; Extra inputs are not permitted, field: 'tools[0].server_label' ...After: the same requests go to Fireworks' own Responses endpoint, so the MCP tool runs server-side and the app gets its answer
fireworks_ai/accounts/fireworks/models/kimi-k3to the model list asfireworks-kimi-k3and restarts the proxy"model": "fireworks-kimi-k3", an input string, and aget_weatherfunction toolreasoningandfunction_call(call_idget_weather_0), and the response id is Fireworks' ownresp_...previous_response_idset to that response's id and afunction_call_outputitem for the callmessagereading out the weather{"type": "mcp", "server_label": "deepwiki", "server_url": "https://mcp.deepwiki.com/mcp", "require_approval": "never"}toolreasoning,mcp_call,tool_output,message, the message being the one-sentence answer Fireworks produced after running the MCP call itselfRelevant issues
Linear ticket
Resolves LIT-6348
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Both legs: a proxy started with
--num_workers 2, no database, model entriesfireworks-kimi-k3->fireworks_ai/accounts/fireworks/models/kimi-k3,fireworks-qwen3p8->fireworks_ai/accounts/fireworks/models/qwen3p8-2p4t-a95b, andfireworks-glm-5p3->fireworks_ai/accounts/fireworks/models/glm-5p3, each withapi_key: os.environ/FIREWORKS_API_KEY, master keysk-lit6348, real Fireworks API, openai SDK 2.33.0. Cases A to C are one Python script run against each proxy, taking the port as its argument. Before is the merge base 3868364 on port 24353, after is the PR tip 18aa52d (the branch merged withlitellm_internal_stagingat 3868364) on port 51035. The model is nondeterministic about calling the tool: on each leg the first run of the script skipped one tool call (case B on the before leg answered with an empty message, case A on the after leg answered without afunction_call) and the second run, shown here, called itBefore (3868364)
Cases A to C: function tool, previous_response_id with a function_call_output, MCP tool, all via the OpenAI SDK
.venv/bin/python sdk_cases.py 24353, the worktree's venv)Case D: MCP tool via curl with response headers
zsh case_d.sh 24353: the first line saves the raw response, the next three print the status line, the two headers of interest, and the trimmed body)x-litellm-model-api-baseheader on this response)Case E: MCP tool streamed via curl
zsh case_e.sh 24353)After (18aa52d)
Cases A to C: function tool, previous_response_id with a function_call_output, MCP tool, all via the OpenAI SDK
.venv/bin/python sdk_cases.py 51035, the worktree's venv)Case D: MCP tool via curl with response headers
zsh case_d.sh 51035: the first line saves the raw response, the next three print the status line, the two headers of interest, and the trimmed body)['reasoning', 'message'])Case E: MCP tool streamed via curl
zsh case_e.sh 51035)Observations:
mcp_callandtool_outputitems appearcall_idisget_weather_0on both legsx-litellm-response-costpopulated on the MCP callresponse.createdandresponse.in_progressresp_...values, wrappedVerdict: PASS. Cases A and B succeed on both legs, and cases C, D, and E fail with the Fireworks 400 on the before leg and succeed on the after leg
Customer samples, before and after
The partner relayed the customer's failing inputs from a Codex CLI agent loop (LiteLLM 1.96.2, chat completions bridge): a tool result after an empty assistant message (kimi-k3), a
developermessage after the first input item (qwen3.8), and anamespace-grouped tool next to its flat twin (kimi-k3 and glm-5.3). One script,samples_cases.py <port>, posts each to/v1/responseson the same two proxies as above (merge base 3868364 on port 24353, PR tip 18aa52d on port 51035)Before (3868364)
After (18aa52d)
Verdicts, same three model entries on both legs (
fireworks-kimi-k3,fireworks-qwen3p8forqwen3p8-2p4t-a95b,fireworks-glm-5p3):jinja template rendering failed. System message must be at the beginning.The bridge maps developer to system in place; the native path (a534b9f) does the same because Fireworks' Responses endpoint has no developer role on this model, and calling Fireworks directly withsystemin the later position returns the same 400. Tracked in LIT-7019Unknown message role 'developer'here, which is what the developer-to-system mapping fixestype: "namespace"grouped tool vs the same tool flat, kimi-k3 and glm-5.3): 200 withfunction_call: get_weather {"city": "Paris"}on both legs, so namespace flattening is already in place at the base commit and the native path forwards the flattened toolsDirect probe of Fireworks' endpoint without LiteLLM,
developerandsystemin first and later positions per model, is infireworks_direct_developer_probe.outof the QA folder: qwen3.8 rejectsdeveloperanywhere andsystemlater, kimi-k3 rejectsdeveloperanywhere and acceptssystemlater, glm-5.3 accepts every combinationCase F:
file_searchtool over a vector store, three legsSame proxy recipe with one Fireworks model entry plus a
vector_store_registryentry (aurora-kb, an OpenAI vector store holding one support article,custom_llm_provider: openai): the bridge leg on port 24353, the tip leg on port 51035, the a534b9f leg from the earlier run on port 20225. Command per leg:zsh case_f.sh <port>, one curl toPOST /v1/responseswith afile_searchtool naming that store, then a short Python summary of the response bodyChat bridge (3868364)
Native path before 0157808 (a534b9f)
Native path at 18aa52d
Verdict: the bridge and the fixed native path both run LiteLLM's emulated search (a
file_search_callitem, the answer names the coolant from the article), while the native path before the fix forwarded the tool to Fireworks, which answered 200 with no search and a model that says it has no accessCase G: SDK-typed
developeritem throughlitellm.responses, before and after e9a40adPython SDK call with pydantic
EasyInputMessageitems instead of dicts (the shape the OpenAI SDK types produce), real Fireworks API, kimi-k3.qa/after8/pydantic_developer.pyregisters aCustomLoggerwhoselog_pre_api_callcaptures theinputLiteLLM sends upstream, then prints it with the status and text. The before leg runs the same file withlitellm/llms/fireworks_ai/responses/transformation.pychecked out from 525d9fbThe same file against the merge base 3868364 (chat completions bridge, no Fireworks Responses config yet) does not reach Fireworks at all: the bridge's
_is_input_item_tool_call_outputcalls.geton the pydantic item and the SDK call fails before any request is sentVerdict: before the fix a pydantic developer item reached Fireworks unmapped as
role: developer; after it, LiteLLM sendsrole: system, the same as it already did for dict items. Both legs return 200 today because Fireworks started acceptingdeveloperon these models on 2026-09-05 (see the caveat below); the wire body is what changedDirect probe of Fireworks' endpoint without LiteLLM at 05:37Z on 2026-09-05,
developerandsystemfirst and after the first input item:Live PR risk
Breaking: none intended for the request and response shapes of
POST /v1/responses. Every field the bridge accepted (instructions,temperature,max_output_tokens,metadata,store,user,parallel_tool_calls,truncation,text.formatjson_schema,reasoning.effort,stream) returns 200 on the head rig with the same output item types and usage fields as the base rigBackward incompatible: response ids change shape from a base64 wrap of chat completion state to a wrap of Fireworks' own
resp_...ids, so aprevious_response_idminted before the upgrade gets Fireworks' 404 "Previous response not found" on the head rig (the same id continues fine on the base rig). Recorded as the Medium caveatRegression risk:
developerinput items, which Codex sends first and mid-session, were 400 on the head rig before a534b9f on kimi-k3 (Unknown message role 'developer') and qwen3.8 (Unexpected message role) because Fireworks' Responses endpoint has no developer role on those models; the head rig now maps them tosystemthe way the bridge does, so kimi-k3 answers in both positions and qwen3.8 answers with the item first and keeps the bridge's 400 with it later (glm-5.3 accepts either role in either position on both rigs). Chat completions forfireworks_ai/models are untouched on the head rig (same model, same content, same usage as base). Streaming keeps the same event set (response.createdthroughresponse.completed, reasoning summary deltas included) and the completed event still carries usage and cost. Cost headers (x-litellm-response-cost*,x-litellm-model-api-base) are populated on the head rig and match the base rig's shape; reasoning tokens are billed as output tokens on both.file_searchtools were another inherited-from-OpenAI gap:OpenAIResponsesAPIConfig.supports_native_file_searchis True, so the head rig before 0157808 forwarded the tool to Fireworks, which answered 200 without running any search (nofile_search_callitem, the model says it has no access), where the bridge emulated it through the vector store registry; the config now opts out of native file search and case F shows the emulated path back on the headDependency graph:
ProviderConfigManager._get_python_responses_api_confignow returnsFireworksAIResponsesAPIConfigforfireworks_ai, which flips five surfaces from the chat bridge to Fireworks' endpoint: create (POST /v1/responses), get (GET /v1/responses/{id}), delete (DELETE /v1/responses/{id}), input items (GET /v1/responses/{id}/input_items), and cancel (POST /v1/responses/{id}/cancel). Base rig: get, delete, input items, and cancel all return litellm's 500 "not supported for fireworks_ai". Head rig: get returns the stored response (200), delete returns{"id": ..., "object": "response", "deleted": true}(200) after the 217b5c4 fix (Fireworks answers{"message": "Response deleted successfully"}, which the OpenAI parser rejected with a pydantic validation error at 4b950cd), input items and cancel return Fireworks' 404 because Fireworks has no/input_itemsroute and refuses to cancel a completed response.resolve_fireworks_api_keyandwith_fireworks_session_affinitymoved intocommon_utils.pyand the chat config imports them from there; chat completions and streaming chat on the head rig behave the same as baseNot verified:
POST /v1/responses/{id}/cancelon an in-progress background response (nobackground: truesupport on the Fireworks side to make one); the proxy's managed websocket path (supports_native_websocketreturns False, so it takes the same route as base); Fireworks models other than kimi-k3Re-run at 18aa52d (the branch merged with
litellm_internal_stagingat 3868364; the PR's own diff is byte-identical to the d98cc29 pass, seven files). The base branch moved under the PR in three places that touch this config:OpenAIResponsesAPIConfignow dropsreasoning.effortfor non-reasoning OpenAI models, gated oncustom_llm_provider == openai, andFireworksAIResponsesAPIConfigsetsfireworks_ai, soreasoning: {"effort": "low"}on kimi-k3 still passes through (200,reasoningandmessageitems on both rigs); the get and delete parsers narrowedexcept Exceptiontoexcept ValidationError, and get returns the stored response (200) while delete returns{"id", "object": "response", "deleted": true}(200) on the head rig where the base rig answers 500 "not supported";_resolve_responses_api_provider_configinresponses/main.pygained asupported_endpointsopt-in for OpenAI-compatible deployments that only runs when the Python config lookup returns None, and_get_python_responses_api_configstill returnsFireworksAIResponsesAPIConfigforfireworks_aiahead of the JSON fallback. Same two-worker rigs, same order on both sides: chat completions on kimi-k3 unchanged (pong, same usage shape), streaming reachesresponse.completedwith usage and cost on both,previous_response_idchaining answers from the earlier turn on the head rig (Teal) where the no-database base rig loses it (Blue.), input items and cancel keep Fireworks' 404.tests/test_litellm/llms/fireworks_ai/,tests/test_litellm/responses/, andtests/test_litellm/llms/openai/responses/pass at the tip (1055 tests), andtests/llm_translation/test_fireworks_ai_translation.py(13 tests, real Fireworks API) passes too; the installed package set is identical on both sidesType
🆕 New Feature
Caveats (if any)
Medium
previous_response_idvalues minted by the old bridge stop resolving after upgrade (Fireworks answers 404 "Previous response not found"; the same id keeps working on the base rig); chains restart with a fresh call. Left as is on purpose: the only fix is keeping the chat bridge alive as a second path for ids minted before the upgrade, which re-adds the code this PR retires for a window that ends at each caller's first new callLow
GET /v1/responses/{id}/input_itemsnow returns Fireworks' 404 ({"detail": "Not Found"}, no such route upstream) where the base returned litellm's 500 "not supported for fireworks_ai"POST /v1/responses/{id}/cancelon a completed response returns Fireworks' 404 "Response not found" where the base returned litellm's 500; cancelling an in-progress response is not verifiedusage.output_tokens_detailscomes back empty, so reasoning tokens are counted insideoutput_tokensand not broken outcall_idvalues likeget_weather_0, not OpenAI-stylecall_...idsproxy-infra / Run tests (Python 3.10)red (test_http_parsing_utils.py::TestNumericFormFields::test_qualifiers_and_optionality_are_unwrapped, fixed on the base branch by fix(proxy): strip every TypedDict qualifier before numeric form-field detection #39780) and theintegrations / Run testsred (test_datadog_llm_obs.py::test_a_redacted_span_carries_every_declared_guardrail_field, fixed by fix(datadog_llm_obs): keep guardrail_cost_by_unit on redacted spans #39848) both came from the base branch.litellm_internal_staginghas been merged in twice since, as 525d9fb (9c05c15) and again as d98cc29 (78ad88f, after e9a40ad), each time resolving the lint budget JSON conflicts by taking the base values and re-ratcheting on the merged tree withmake lint-budget-update, and a third time as 18aa52d (3868364), this time taking the four budget JSONs from the base verbatim so the branch carries no budget edit.ci/circleci: proxy_store_model_in_db_testsstill failstest_chat_completion_bad_model_with_spend_logson the last three staging pipelines too, so it is not from this PRdeveloperitems on kimi-k3 and qwen3.8 on 2026-09-05 (the 05:37Z re-probe in Case G; the 01:25Z probe in the customer samples section still gotUnknown message role 'developer'), and it treats them exactly likesystem(a laterdeveloperon qwen3.8 fails with the sameSystem message must be at the beginning). The developer-to-system mapping is kept: it is behavior-neutral where Fireworks accepts both, still protects models or deployments that do not, and matches the chat bridgedeveloperitem after the first input item still gets Fireworks' 400 on qwen3.8 (System message must be at the beginning): its chat template wants system first and Fireworks' own endpoint rejects a latersystemitem too, so this matches the bridge today; tracked in LIT-7019vector_store_idthe model writes into its tool call instead of only the request's stores. That handler is shared by every provider without native file search and the chat bridge already ran Fireworks through it, so it is pre-existing here; tracked in LIT-7027Final Attestation
Note
Medium Risk
Changes the default wire path for all
fireworks_ai/v1/responsestraffic (including response id shape andprevious_response_idcompatibility after upgrade); chat completions are only touched via shared header/key helpers.Overview
Fireworks
fireworks_ai/models now use Fireworks’ native Responses API instead of the chat-completions bridge, so MCP tools,previous_response_id, streaming SSE, and related Responses features work againsthttps://api.fireworks.ai/inference/v1/responses.FireworksAIResponsesAPIConfigis registered inProviderConfigManagerand lazy imports. It normalizes bare model names viaresolve_fireworks_resource_name, sets auth/FIREWORKS_API_BASEthrough sharedresolve_fireworks_api_key, and addsx-session-affinityviawith_fireworks_session_affinity(refactored intocommon_utilsfor chat and responses). Request input mapsdeveloperitems tosystemafter validation; delete responses map Fireworks’ message-only body to{id, object, deleted};file_searchstays on LiteLLM emulated search (supports_native_file_searchfalse); websockets use the managed handler (supports_native_websocketfalse).Tests cover registration, MCP passthrough, session affinity, streaming, delete, and env key names.
Reviewed by Cursor Bugbot for commit 18aa52d. Bugbot is set up for automated code reviews on this repo. Configure here.