From b383b89d152bf0e26616e9fd07acc214fa12792b Mon Sep 17 00:00:00 2001 From: Moshe Malawach Date: Fri, 19 Jun 2026 16:40:50 +0200 Subject: [PATCH] feat(provider): add LibertAI GLM-5.2 models --- ...odel_prices_and_context_window_backup.json | 29 +++++++++++++++++++ model_prices_and_context_window.json | 29 +++++++++++++++++++ .../openai_like/test_libertai_provider.py | 14 +++++++++ 3 files changed, 72 insertions(+) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 7a5f8b9e1e3..e8454d75f4e 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -41481,6 +41481,35 @@ "supports_reasoning": true, "source": "https://docs.libertai.io/apis/text/" }, + "libertai/glm-5.2": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "litellm_provider": "libertai", + "mode": "chat", + "supports_function_calling": true, + "supports_tool_choice": true, + "supports_system_messages": true, + "supports_vision": false, + "source": "https://docs.libertai.io/apis/text/" + }, + "libertai/glm-5.2-thinking": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "litellm_provider": "libertai", + "mode": "chat", + "supports_function_calling": true, + "supports_tool_choice": true, + "supports_system_messages": true, + "supports_vision": false, + "supports_reasoning": true, + "source": "https://docs.libertai.io/apis/text/" + }, "libertai/bge-m3": { "max_tokens": 8192, "max_input_tokens": 8192, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 47b7190185e..487aed1041a 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -41691,6 +41691,35 @@ "supports_reasoning": true, "source": "https://docs.libertai.io/apis/text/" }, + "libertai/glm-5.2": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "litellm_provider": "libertai", + "mode": "chat", + "supports_function_calling": true, + "supports_tool_choice": true, + "supports_system_messages": true, + "supports_vision": false, + "source": "https://docs.libertai.io/apis/text/" + }, + "libertai/glm-5.2-thinking": { + "max_tokens": 262144, + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "input_cost_per_token": 1.4e-06, + "output_cost_per_token": 4.4e-06, + "litellm_provider": "libertai", + "mode": "chat", + "supports_function_calling": true, + "supports_tool_choice": true, + "supports_system_messages": true, + "supports_vision": false, + "supports_reasoning": true, + "source": "https://docs.libertai.io/apis/text/" + }, "libertai/bge-m3": { "max_tokens": 8192, "max_input_tokens": 8192, diff --git a/tests/test_litellm/llms/openai_like/test_libertai_provider.py b/tests/test_litellm/llms/openai_like/test_libertai_provider.py index fdbe3046e9b..f4e1b158dbc 100644 --- a/tests/test_litellm/llms/openai_like/test_libertai_provider.py +++ b/tests/test_litellm/llms/openai_like/test_libertai_provider.py @@ -70,11 +70,25 @@ class TestLibertAIProviderConfig: assert info["max_input_tokens"] == 262144 assert info["max_output_tokens"] == 262144 + assert "libertai/glm-5.2" in model_cost + glm = model_cost["libertai/glm-5.2"] + assert glm["litellm_provider"] == "libertai" + assert glm["mode"] == "chat" + assert glm["max_input_tokens"] == 262144 + assert glm["max_output_tokens"] == 262144 + assert glm["input_cost_per_token"] == 1.4e-06 + assert glm["output_cost_per_token"] == 4.4e-06 + assert glm["supports_vision"] is False + # thinking variants are marked as reasoning models assert ( model_cost["libertai/qwen3.6-27b-thinking"].get("supports_reasoning") is True ) + assert ( + model_cost["libertai/glm-5.2-thinking"].get("supports_reasoning") + is True + ) def test_libertai_router_config(self): """Test that libertai can be used in Router configuration"""