From e7bfe99cd3a0a471071e402aec733351e6e76039 Mon Sep 17 00:00:00 2001 From: siyoon Date: Sun, 30 Aug 2026 14:23:36 +0900 Subject: [PATCH 1/4] feat(friendli): add zai-org/GLM-5.3 model pricing Per https://api.friendli.ai/serverless/v1/models: - $1.40 input / $4.40 output / $0.26 cached input per MTok - 1M context, 1M max output, reasoning with effort low/high/max (per HF chat_template.jinja: low/high honored, anything else -> max) - tool calling, parallel tool calls, structured output, prompt caching - text-only (no vision), flagship GLM model --- model_prices_and_context_window.json | 24 +++++++++++++ .../test_friendli_glm_5_3_model_metadata.py | 36 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tests/test_litellm/test_friendli_glm_5_3_model_metadata.py diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 05c1cfd3179..24aad7c90c8 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -19564,6 +19564,30 @@ "supports_system_messages": true, "supports_tool_choice": true }, + "friendliai/zai-org/GLM-5.3": { + "litellm_provider": "friendliai", + "supports_reasoning": true, + "supports_function_calling": true, + "max_input_tokens": 1048576, + "max_tokens": 1048576, + "max_output_tokens": 1048576, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "cache_read_input_token_cost": 2.6e-07, + "supports_prompt_caching": true, + "supports_max_reasoning_effort": true, + "supports_low_reasoning_effort": true, + "supports_parallel_function_calling": true, + "supports_response_schema": true, + "supports_native_structured_output": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "mode": "chat", + "comment": "Flagship GLM model for long-horizon coding, agents, and complex project delivery", + "source": "https://api.friendli.ai/serverless/v1/models", + "supports_vision": false, + "supports_image_input": false + }, "ft:babbage-002": { "deprecation_date": "2026-10-23", "input_cost_per_token": 1.6e-06, diff --git a/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py b/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py new file mode 100644 index 00000000000..c0b07358d23 --- /dev/null +++ b/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py @@ -0,0 +1,36 @@ +import json +from pathlib import Path + +from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider + + +def test_friendli_glm_5_3_model_info(): + model = "friendliai/zai-org/GLM-5.3" + json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json" + with open(json_path) as f: + model_cost = json.load(f) + + info = model_cost.get(model) + assert ( + info is not None + ), f"{model} not found in model_prices_and_context_window.json" + assert info["litellm_provider"] == "friendliai" + assert info["mode"] == "chat" + assert info["input_cost_per_token"] == 1.4e-06 + assert info["output_cost_per_token"] == 4.4e-06 + assert info["cache_read_input_token_cost"] == 2.6e-07 + assert info["max_input_tokens"] == 1048576 + assert info["max_output_tokens"] == 1048576 + assert info["supports_function_calling"] is True + assert info["supports_reasoning"] is True + assert info["supports_low_reasoning_effort"] is True + assert info["supports_max_reasoning_effort"] is True + assert info["supports_tool_choice"] is True + assert info["supports_prompt_caching"] is True + # GLM-5.3 (non-flash) is text-only on Friendli's catalog + assert info["supports_vision"] is False + assert info["supports_image_input"] is False + + routed_model, provider, _, _ = get_llm_provider(model=model) + assert routed_model == "zai-org/GLM-5.3" + assert provider == "friendliai" From 3822ecc8ff1df4a0c41c2d3deb6282206eb537da Mon Sep 17 00:00:00 2001 From: siyoon Date: Sun, 30 Aug 2026 14:29:42 +0900 Subject: [PATCH 2/4] chore(tests): drop redundant capability comment Per greptile review + CLAUDE.md comment policy: the comment restated the immediately following assertion without adding value. --- tests/test_litellm/test_friendli_glm_5_3_model_metadata.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py b/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py index c0b07358d23..5e7a1ede699 100644 --- a/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py +++ b/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py @@ -27,7 +27,6 @@ def test_friendli_glm_5_3_model_info(): assert info["supports_max_reasoning_effort"] is True assert info["supports_tool_choice"] is True assert info["supports_prompt_caching"] is True - # GLM-5.3 (non-flash) is text-only on Friendli's catalog assert info["supports_vision"] is False assert info["supports_image_input"] is False From bd794f9f18c7422824a36e7d02086ebea25e8ec2 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 31 Aug 2026 13:26:37 -0700 Subject: [PATCH 3/4] fix(friendli): track GLM-5.3 discounted live pricing and declare effort levels --- model_prices_and_context_window.json | 13 ++++++++----- .../test_friendli_glm_5_3_model_metadata.py | 9 ++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 24aad7c90c8..f70a0ac63d9 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -19571,12 +19571,15 @@ "max_input_tokens": 1048576, "max_tokens": 1048576, "max_output_tokens": 1048576, - "input_cost_per_token": 1.4e-06, - "output_cost_per_token": 4.4e-06, - "cache_read_input_token_cost": 2.6e-07, + "input_cost_per_token": 1.26e-06, + "output_cost_per_token": 3.96e-06, + "cache_read_input_token_cost": 2.34e-07, "supports_prompt_caching": true, - "supports_max_reasoning_effort": true, - "supports_low_reasoning_effort": true, + "reasoning_effort_levels": [ + "low", + "high", + "max" + ], "supports_parallel_function_calling": true, "supports_response_schema": true, "supports_native_structured_output": true, diff --git a/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py b/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py index 5e7a1ede699..5282b0f589e 100644 --- a/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py +++ b/tests/test_litellm/test_friendli_glm_5_3_model_metadata.py @@ -16,15 +16,14 @@ def test_friendli_glm_5_3_model_info(): ), f"{model} not found in model_prices_and_context_window.json" assert info["litellm_provider"] == "friendliai" assert info["mode"] == "chat" - assert info["input_cost_per_token"] == 1.4e-06 - assert info["output_cost_per_token"] == 4.4e-06 - assert info["cache_read_input_token_cost"] == 2.6e-07 + assert info["input_cost_per_token"] == 1.26e-06 + assert info["output_cost_per_token"] == 3.96e-06 + assert info["cache_read_input_token_cost"] == 2.34e-07 assert info["max_input_tokens"] == 1048576 assert info["max_output_tokens"] == 1048576 assert info["supports_function_calling"] is True assert info["supports_reasoning"] is True - assert info["supports_low_reasoning_effort"] is True - assert info["supports_max_reasoning_effort"] is True + assert info["reasoning_effort_levels"] == ["low", "high", "max"] assert info["supports_tool_choice"] is True assert info["supports_prompt_caching"] is True assert info["supports_vision"] is False From 0ac328910266e1edfab6279c6d39312cf9ced0f8 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Mon, 31 Aug 2026 13:55:54 -0700 Subject: [PATCH 4/4] fix(friendli): ship GLM-5.3 in the bundled backup cost map --- ...odel_prices_and_context_window_backup.json | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 05c1cfd3179..f70a0ac63d9 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -19564,6 +19564,33 @@ "supports_system_messages": true, "supports_tool_choice": true }, + "friendliai/zai-org/GLM-5.3": { + "litellm_provider": "friendliai", + "supports_reasoning": true, + "supports_function_calling": true, + "max_input_tokens": 1048576, + "max_tokens": 1048576, + "max_output_tokens": 1048576, + "input_cost_per_token": 1.26e-06, + "output_cost_per_token": 3.96e-06, + "cache_read_input_token_cost": 2.34e-07, + "supports_prompt_caching": true, + "reasoning_effort_levels": [ + "low", + "high", + "max" + ], + "supports_parallel_function_calling": true, + "supports_response_schema": true, + "supports_native_structured_output": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "mode": "chat", + "comment": "Flagship GLM model for long-horizon coding, agents, and complex project delivery", + "source": "https://api.friendli.ai/serverless/v1/models", + "supports_vision": false, + "supports_image_input": false + }, "ft:babbage-002": { "deprecation_date": "2026-10-23", "input_cost_per_token": 1.6e-06,