Conversation
Greptile SummaryThis PR adds the
Confidence Score: 5/5Safe to merge — changes are confined to static JSON cost-map data and their corresponding test fixtures. The change touches only two data files (main and backup JSON) and two test files. The JSON edits are internally consistent — both files receive identical updates, the new router entry mirrors the structure of the existing glm-5p1-fast router entry, and the corrected glm-5p2 values are reflected in the test expectations. Test coverage is expanded rather than weakened. No logic code is modified. No files require special attention.
|
| Filename | Overview |
|---|---|
| model_prices_and_context_window.json | Adds glm-5p2-fast router entries (short-form and long-form), corrects max_input_tokens from 1048576→1048575 and cache_read_input_token_cost from 2.6e-07→1.4e-07 for glm-5p2 base model; all values consistent with Fireworks pricing page. |
| litellm/model_prices_and_context_window_backup.json | Mirror of the main JSON — identical changes applied to keep the bundled fallback cost map in sync. |
| tests/test_litellm/test_utils.py | Updates expected values for glm-5p2 to match corrected pricing/context, adds glm-5p2-fast to _FIREWORKS_MODELS and _FIREWORKS_ROUTER_SHORT_FORMS — no test coverage weakened. |
| tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py | Extends the supported_models list in test_supports_reasoning_effort with glm-5p2, glm-5p2-fast, and glm-5p1-fast variants; coverage is expanded, not weakened. |
Reviews (2): Last reviewed commit: "feat(fireworks): add GLM 5.2 Fast router..." | Re-trigger Greptile
54ec669 to
66cbbe8
Compare
Adds the glm-5p2-fast router endpoint to model_prices_and_context_window.json and its bundled backup, and corrects the max_input_tokens and cache_read_input_token_cost values for the existing glm-5p2 direct model entry. New router: accounts/fireworks/routers/glm-5p2-fast. Updated: glm-5p2 now carries the correct context window (1048575) and lowered cache-read pricing (1.4e-07, down from 2.6e-07) The glm-5p2-fast router is a load-balanced endpoint over GLM 5.2 with 1.5x pricing (input 2.1e-06, output 6.6e-06, cache_read 2.1e-07) and the same context window (1048575) and output limit (131072) as the base model. Capability flags match the base model: supports_function_calling, supports_reasoning, supports_response_schema, supports_tool_choice all true; supports_vision false Short-form aliases (fireworks_ai/glm-5p2-fast) are added so cost attribution works for callers using bare model names. FireworksAIConfig.transform_request already routes bare names ending in -fast to accounts/fireworks/routers/, so no handler code changes are needed The max_input_tokens correction from 1048576 to 1048575 applies to both the existing glm-5p2 direct model entry and its short-form alias, and to the new glm-5p2-fast router entry and its short-form alias. The value 1048575 matches the context window published on the Fireworks model page The cache_read_input_token_cost for the glm-5p2 base model is corrected from 2.6e-07 to 1.4e-07, reflecting a price reduction on the Fireworks platform Regression tests in test_utils.py assert the exact per-token costs, token limits, capability flags, and short-form-to-long-form equality for the new glm-5p2-fast entry against both the main and backup cost maps. The glm-5p2 base model entry assertions are updated to match the corrected context window and cache-read pricing. test_supports_reasoning_effort in test_fireworks_ai_chat_transformation.py now includes glm-5p2 and glm-5p2-fast (direct, router, and short-form variants) in its supported models list
66cbbe8 to
a09c340
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relevant issues
Closes #31459
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewScreenshots / Proof of Fix
Type
The new model and its pricing can be verified on the Fireworks model page: https://app.fireworks.ai/models/fireworks/glm-5p2
For the context window size, an API request can be made for verification:
A test payload can be generated using the following:
Type
🆕 New Feature
Changes
Adds the
glm-5p2-fastrouter endpoint tomodel_prices_and_context_window.jsonand its bundled backup, and corrects themax_input_tokensandcache_read_input_token_costvalues for the existingglm-5p2direct model entry.Per-token costs, context/output limits,
cache_read_input_token_cost, and capability flags for the new router entry are sourced from the Fireworks model page at https://app.fireworks.ai/models/fireworks/glm-5p2. Theglm-5p2-fastrouter is a load-balanced endpoint over GLM 5.2 with 1.5x pricing (input $2.10/M, output $6.60/M, cache_read $0.21/M) and the same context window (1048575) and output limit (131072) as the base model. Capability flags match the base model:supports_function_calling,supports_reasoning,supports_response_schema,supports_tool_choiceall true;supports_visionfalse.The
max_input_tokenscorrection from 1048576 to 1048575 applies to both the existingglm-5p2direct model entry and its short-form alias, and to the newglm-5p2-fastrouter entry and its short-form alias. The value 1048575 matches the context window published on the Fireworks model page and can be verified by sending a payload that exceeds 1048575 tokens to the API.The
cache_read_input_token_costfor theglm-5p2base model is corrected from 2.6e-07 to 1.4e-07 ($0.14/M), reflecting a price reduction on the Fireworks platform. Theglm-5p2-fastrouter entry uses 2.1e-07 ($0.21/M) for cache reads.Short-form aliases (
fireworks_ai/glm-5p2-fast) are added so cost attribution works for callers using bare model names.FireworksAIConfig.transform_requestalready routes bare names ending in-fasttoaccounts/fireworks/routers/, so no handler code changes are needed.File by file:
model_prices_and_context_window.json: 1 new router long-form entry (accounts/fireworks/routers/glm-5p2-fast), 1 new router short-form alias (fireworks_ai/glm-5p2-fast),max_input_tokenscorrected from 1048576 to 1048575 andcache_read_input_token_costcorrected from 2.6e-07 to 1.4e-07 for the existingglm-5p2direct model entry and its short-form aliaslitellm/model_prices_and_context_window_backup.json: mirrored so the bundled fallback cost map stays in synctests/test_litellm/test_utils.py:test_fireworks_models_in_cost_mapandtest_fireworks_models_in_backup_cost_mapupdated with the newglm-5p2-fastrouter entry in_FIREWORKS_MODELSandglm-5p2-fastin_FIREWORKS_ROUTER_SHORT_FORMS; theglm-5p2base model entry's expectedmax_input_tokenscorrected to 1048575 andcache_read_input_token_costcorrected to 1.4e-07tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py:glm-5p2andglm-5p2-fast(direct, router, and short-form variants) added to thesupported_modelslist intest_supports_reasoning_effort; the previously missing glm-5p1-fast (router and short-form) is also added to the same list, as it has supports_reasoning: true in the cost map but was absent from the test