mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
Add OpenRouter Kimi K2.5 (#19872)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
87bdfb0253
commit
d4031c8ba6
2 changed files with 56 additions and 0 deletions
|
|
@ -23678,6 +23678,20 @@
|
|||
"output_cost_per_token": 6.5e-07,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"openrouter/moonshotai/kimi-k2.5": {
|
||||
"cache_read_input_token_cost": 1e-07,
|
||||
"input_cost_per_token": 6e-07,
|
||||
"litellm_provider": "openrouter",
|
||||
"max_input_tokens": 262144,
|
||||
"max_output_tokens": 262144,
|
||||
"max_tokens": 262144,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 3e-06,
|
||||
"source": "https://openrouter.ai/moonshotai/kimi-k2.5",
|
||||
"supports_function_calling": true,
|
||||
"supports_tool_choice": true,
|
||||
"supports_vision": true
|
||||
},
|
||||
"openrouter/nousresearch/nous-hermes-llama2-13b": {
|
||||
"input_cost_per_token": 2e-07,
|
||||
"litellm_provider": "openrouter",
|
||||
|
|
|
|||
|
|
@ -2543,6 +2543,48 @@ def test_model_info_for_vertex_ai_deepseek_model():
|
|||
print("vertex deepseek model info", model_info)
|
||||
|
||||
|
||||
def test_model_info_for_openrouter_kimi_k2_5():
|
||||
"""
|
||||
Test that openrouter/moonshotai/kimi-k2.5 model info is correctly configured
|
||||
in model_prices_and_context_window.json.
|
||||
|
||||
Model properties from OpenRouter API:
|
||||
- context_length: 262144
|
||||
- pricing: prompt=$0.0000006, completion=$0.000003, input_cache_read=$0.0000001
|
||||
- modality: text+image->text (supports vision)
|
||||
- supports: tool_choice, tools (function calling)
|
||||
"""
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
# Load directly from the local JSON file
|
||||
json_path = Path(__file__).parents[2] / "model_prices_and_context_window.json"
|
||||
with open(json_path) as f:
|
||||
model_cost = json.load(f)
|
||||
|
||||
model_info = model_cost.get("openrouter/moonshotai/kimi-k2.5")
|
||||
assert model_info is not None, "Model not found in model_prices_and_context_window.json"
|
||||
assert model_info["litellm_provider"] == "openrouter"
|
||||
assert model_info["mode"] == "chat"
|
||||
|
||||
# Verify context window
|
||||
assert model_info["max_input_tokens"] == 262144
|
||||
assert model_info["max_output_tokens"] == 262144
|
||||
assert model_info["max_tokens"] == 262144
|
||||
|
||||
# Verify pricing
|
||||
assert model_info["input_cost_per_token"] == 6e-07
|
||||
assert model_info["output_cost_per_token"] == 3e-06
|
||||
assert model_info["cache_read_input_token_cost"] == 1e-07
|
||||
|
||||
# Verify capabilities
|
||||
assert model_info["supports_vision"] is True
|
||||
assert model_info["supports_function_calling"] is True
|
||||
assert model_info["supports_tool_choice"] is True
|
||||
|
||||
print("openrouter kimi-k2.5 model info", model_info)
|
||||
|
||||
|
||||
class TestGetValidModelsWithCLI:
|
||||
"""Test get_valid_models function as used in CLI token usage"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue