fix(fireworks): add glm-5p1 metadata and parallel_tool_calls - #26031
fix(fireworks): add glm-5p1 metadata and parallel_tool_calls#26031elonazoulay wants to merge 1 commit into
Conversation
Greptile SummaryThis PR adds GLM-5.1 model metadata to the Fireworks AI pricing/context maps, exposes Confidence Score: 5/5Safe to merge — changes are additive metadata entries and a well-tested capability-gating improvement with no backwards-incompatible behaviour. All findings are P2 or lower. The JSON entries are consistent between both pricing files, the No files require special attention.
|
| Filename | Overview |
|---|---|
| litellm/llms/fireworks_ai/chat/transformation.py | Adds _get_model_cost_capability helper and updates get_provider_info to respect explicit model-map flags; adds parallel_tool_calls to supported params when supports_tool_choice is true. Logic is sound. |
| model_prices_and_context_window.json | Adds fireworks_ai/accounts/fireworks/models/glm-5p1 and fireworks_ai/glm-5p1 entries with correct pricing, context window, and capability flags (supports_function_calling: false, supports_reasoning: true, supports_tool_choice: false). |
| litellm/model_prices_and_context_window_backup.json | Backup JSON kept in sync with the main pricing file; GLM-5P1 entries are identical to the primary file. |
| tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py | Adds targeted unit tests for GLM-5.1 reasoning metadata, parallel_tool_calls gating, get_model_info capability preservation, and an unmapped-model fallback; all tests use mocks/local model cost map and make no real network calls. |
Reviews (2): Last reviewed commit: "fix(fireworks): add glm-5p1 metadata and..." | Re-trigger Greptile
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ab2b304 to
f9fe49d
Compare
VANDRANKI
left a comment
There was a problem hiding this comment.
This is directly complementary to #26016 - that PR fixes the cost calculator to apply cache_read_input_token_cost, and this PR adds the glm-5p1 entry to the model map with that field set. The two together make cached token billing correct for glm-5p1 end to end.
The _get_model_cost_capability refactor is cleaner than the hardcoded model list - capability flags now live in the model map where they belong and don't need a code change to add new models.
One thing to check: the original bug report (issue #25950) lists cache_creation_input_token_cost: 2.6e-7 alongside cache_read_input_token_cost, but the new glm-5p1 model map entries only include cache_read_input_token_cost. If GLM-5P1 does charge for cache creation, it's worth adding that field too.
Also: glm-4p7 appears in the test's supported_models list but I don't see a corresponding entry in the model cost map. Worth verifying that lookup won't silently return None and cause the test to pass vacuously.
|
superceded by #26069 |
Relevant issues
Fixes Fireworks AI provider capability metadata for GLM-5.1 and exposes
parallel_tool_callswhentool_choiceis supported.Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
CI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Screenshots / Proof of Fix
fireworks_ai/accounts/fireworks/models/glm-5p1andfireworks_ai/glm-5p1entries to the model cost maps.parallel_tool_callswhentool_choiceis supported.supports_function_calling: True— only models with an explicitfalseentry (like glm-5p1) opt out.parallel_tool_calls, andget_model_info()capability preservation.Type
🐛 Bug Fix
Changes
parallel_tool_callsfor Fireworks models that supporttool_choice