Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(fireworks_ai): correct glm-5p2 prompt-cache read price to $0.14/1M

Tin Chi Lod9661222492a
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index ee996198b28..e5afc81b641 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -16272,7 +16272,7 @@
"supports_vision": false
},
"fireworks_ai/accounts/fireworks/models/glm-5p2": {
- "cache_read_input_token_cost": 2.6e-07,
+ "cache_read_input_token_cost": 1.4e-07,
"input_cost_per_token": 1.4e-06,
"litellm_provider": "fireworks_ai",
"max_input_tokens": 1048576,
@@ -16686,7 +16686,7 @@
"supports_vision": false
},
"fireworks_ai/glm-5p2": {
- "cache_read_input_token_cost": 2.6e-07,
+ "cache_read_input_token_cost": 1.4e-07,
"input_cost_per_token": 1.4e-06,
"litellm_provider": "fireworks_ai",
"max_input_tokens": 1048576,
diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json
index b1a87c444c8..5cf99ba8bac 100644
--- a/model_prices_and_context_window.json
+++ b/model_prices_and_context_window.json
@@ -16272,7 +16272,7 @@
"supports_vision": false
},
"fireworks_ai/accounts/fireworks/models/glm-5p2": {
- "cache_read_input_token_cost": 2.6e-07,
+ "cache_read_input_token_cost": 1.4e-07,
"input_cost_per_token": 1.4e-06,
"litellm_provider": "fireworks_ai",
"max_input_tokens": 1048576,
@@ -16686,7 +16686,7 @@
"supports_vision": false
},
"fireworks_ai/glm-5p2": {
- "cache_read_input_token_cost": 2.6e-07,
+ "cache_read_input_token_cost": 1.4e-07,
"input_cost_per_token": 1.4e-06,
"litellm_provider": "fireworks_ai",
"max_input_tokens": 1048576,
diff --git a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py
index 99dcaa36c75..3297750fa6e 100644
--- a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py
+++ b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py
@@ -5,12 +5,15 @@ import pytest
sys.path.insert(0, os.path.abspath("../../../../.."))
+import litellm
from litellm.llms.fireworks_ai.cost_calculator import cost_per_token
from litellm.types.utils import PromptTokensDetailsWrapper, Usage
MODEL = "accounts/fireworks/models/glm-5p2"
INPUT_COST = 1.4e-06
-CACHE_READ_COST = 2.6e-07
+# Read the cached rate from the price map so this test tracks the shipped value
+# (glm-5p2 is $0.14/1M) instead of hardcoding a number that breaks when it changes.
+CACHE_READ_COST = litellm.get_model_info(model=MODEL, custom_llm_provider="fireworks_ai")["cache_read_input_token_cost"]
OUTPUT_COST = 4.4e-06
diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.py
index edd93cbebe0..a1a9448cc58 100644
--- a/tests/test_litellm/test_utils.py
+++ b/tests/test_litellm/test_utils.py
@@ -4317,7 +4317,7 @@ _FIREWORKS_MODELS = [
"accounts/fireworks/models/glm-5p2",
1.4e-06,
4.4e-06,
- 2.6e-07,
+ 1.4e-07,
1048576,
131072,
False,