mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
feat(pricing): add zai/glm-5.2 to model cost map
This commit is contained in:
parent
69b0dd2da0
commit
a5ea87b541
2 changed files with 36 additions and 0 deletions
|
|
@ -37618,6 +37618,22 @@
|
|||
"supports_tool_choice": true,
|
||||
"source": "https://docs.z.ai/guides/overview/pricing"
|
||||
},
|
||||
"zai/glm-5.2": {
|
||||
"cache_creation_input_token_cost": 0,
|
||||
"cache_read_input_token_cost": 2.6e-07,
|
||||
"input_cost_per_token": 1.4e-06,
|
||||
"output_cost_per_token": 4.4e-06,
|
||||
"litellm_provider": "zai",
|
||||
"max_input_tokens": 1048576,
|
||||
"max_output_tokens": 131072,
|
||||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"supports_function_calling": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_tool_choice": true,
|
||||
"source": "https://docs.z.ai/guides/overview/pricing"
|
||||
},
|
||||
"zai/glm-4.7": {
|
||||
"cache_creation_input_token_cost": 0,
|
||||
"cache_read_input_token_cost": 1.1e-07,
|
||||
|
|
|
|||
|
|
@ -1663,3 +1663,23 @@ def test_priority_service_tier_above_threshold_falls_back_to_standard_for_cache_
|
|||
expected_completion = 1_000 * 2.25e-5
|
||||
assert prompt_cost == pytest.approx(expected_prompt, rel=1e-9)
|
||||
assert completion_cost == pytest.approx(expected_completion, rel=1e-9)
|
||||
|
||||
|
||||
def test_zai_glm_5_2_pricing_in_model_cost_map():
|
||||
"""Test that zai/glm-5.2 is present in the model cost map with correct pricing."""
|
||||
from pathlib import Path
|
||||
|
||||
cost_map_path = Path(__file__).parent.parent.parent.parent.parent / "model_prices_and_context_window.json"
|
||||
with open(cost_map_path) as f:
|
||||
model_cost = json.load(f)
|
||||
|
||||
model = "zai/glm-5.2"
|
||||
assert model in model_cost, f"{model} not found in model cost map"
|
||||
|
||||
model_info = model_cost[model]
|
||||
assert model_info["input_cost_per_token"] == 1.4e-06
|
||||
assert model_info["output_cost_per_token"] == 4.4e-06
|
||||
assert model_info["cache_read_input_token_cost"] == 2.6e-07
|
||||
assert model_info["litellm_provider"] == "zai"
|
||||
assert model_info["supports_reasoning"] is True
|
||||
assert model_info["supports_prompt_caching"] is True
|
||||
Loading…
Add table
Reference in a new issue