diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 04b68b8f4e..640607c074 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -22872,6 +22872,22 @@ "supports_video_input": true, "supports_vision": true }, + "moonshot/kimi-k2.6": { + "cache_read_input_token_cost": 1.6e-07, + "input_cost_per_token": 9.5e-07, + "litellm_provider": "moonshot", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 4e-06, + "source": "https://platform.kimi.ai/docs/pricing/chat-k26", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_tool_choice": true, + "supports_video_input": true, + "supports_vision": true + }, "moonshot/kimi-latest": { "cache_read_input_token_cost": 1.5e-07, "input_cost_per_token": 2e-06, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 386532f07a..303c48717f 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -22886,6 +22886,22 @@ "supports_video_input": true, "supports_vision": true }, + "moonshot/kimi-k2.6": { + "cache_read_input_token_cost": 1.6e-07, + "input_cost_per_token": 9.5e-07, + "litellm_provider": "moonshot", + "max_input_tokens": 262144, + "max_output_tokens": 262144, + "max_tokens": 262144, + "mode": "chat", + "output_cost_per_token": 4e-06, + "source": "https://platform.kimi.ai/docs/pricing/chat-k26", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_tool_choice": true, + "supports_video_input": true, + "supports_vision": true + }, "moonshot/kimi-latest": { "cache_read_input_token_cost": 1.5e-07, "input_cost_per_token": 2e-06, diff --git a/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py b/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py index 6dabbe9b2f..b4744a7ed1 100644 --- a/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py +++ b/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py @@ -18,6 +18,7 @@ import pytest import litellm import litellm.utils from litellm import completion +from litellm.litellm_core_utils.get_model_cost_map import GetModelCostMap from litellm.llms.moonshot.chat.transformation import MoonshotChatConfig @@ -653,3 +654,44 @@ class TestMoonshotConfig: result[1].get("reasoning_content") == "Planning to call weather tool" ) + + +class TestKimiK26ModelRegistry: + """Tests that kimi-k2.6 is correctly registered in the model registry.""" + + @pytest.fixture(autouse=True) + def model_cost_map(self): + """Load directly from the bundled backup so tests don't depend on remote fetch.""" + return GetModelCostMap.load_local_model_cost_map() + + def test_kimi_k26_in_model_cost_map(self, model_cost_map): + """kimi-k2.6 should be present in the model cost map.""" + assert "moonshot/kimi-k2.6" in model_cost_map, "moonshot/kimi-k2.6 not found in model_cost" + + def test_kimi_k26_pricing(self, model_cost_map): + """kimi-k2.6 pricing should match official Kimi API rates.""" + model_info = model_cost_map["moonshot/kimi-k2.6"] + assert model_info["input_cost_per_token"] == pytest.approx(9.5e-07) + assert model_info["output_cost_per_token"] == pytest.approx(4e-06) + assert model_info["cache_read_input_token_cost"] == pytest.approx(1.6e-07) + + def test_kimi_k26_context_window(self, model_cost_map): + """kimi-k2.6 should have a 256K (262144 token) context window.""" + model_info = model_cost_map["moonshot/kimi-k2.6"] + assert model_info["max_input_tokens"] == 262144 + assert model_info["max_output_tokens"] == 262144 + assert model_info["max_tokens"] == 262144 + + def test_kimi_k26_capabilities(self, model_cost_map): + """kimi-k2.6 should support function calling, vision, video input, tool choice, and reasoning.""" + model_info = model_cost_map["moonshot/kimi-k2.6"] + assert model_info.get("supports_function_calling") is True + assert model_info.get("supports_tool_choice") is True + assert model_info.get("supports_vision") is True + assert model_info.get("supports_video_input") is True + assert model_info.get("supports_reasoning") is True + + def test_kimi_k26_provider(self, model_cost_map): + """kimi-k2.6 should be assigned to the moonshot provider.""" + model_info = model_cost_map["moonshot/kimi-k2.6"] + assert model_info["litellm_provider"] == "moonshot"