Merge pull request #947 from tnfssc/feat/kimi-k2

This commit is contained in:
Sharath 2025-07-15 18:44:34 +05:30 committed by GitHub
commit 5bf935b46d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 0 deletions

View File

@ -492,6 +492,9 @@ async def run_agent(
elif "gemini-2.5-pro" in model_name.lower():
# Gemini 2.5 Pro has 64k max output tokens
max_tokens = 64000
elif "kimi-k2" in model_name.lower():
# Kimi-K2 has 120K context, set reasonable max output tokens
max_tokens = 8192
generation = trace.generation(name="thread_manager.run_thread") if trace else None
try:

View File

@ -232,6 +232,12 @@ def prepare_params(
use_thinking = enable_thinking if enable_thinking is not None else False
is_anthropic = "anthropic" in effective_model_name.lower() or "claude" in effective_model_name.lower()
is_xai = "xai" in effective_model_name.lower() or model_name.startswith("xai/")
is_kimi_k2 = "kimi-k2" in effective_model_name.lower() or model_name.startswith("moonshotai/kimi-k2")
if is_kimi_k2:
params["provider"] = {
"order": ["groq", "together/fp8"]
}
if is_anthropic and use_thinking:
effort_level = reasoning_effort if reasoning_effort else 'low'

View File

@ -53,6 +53,14 @@ MODELS = {
},
"tier_availability": ["paid"]
},
"openrouter/moonshotai/kimi-k2": {
"aliases": ["moonshotai/kimi-k2", "kimi-k2"],
"pricing": {
"input_cost_per_million_tokens": 1.00,
"output_cost_per_million_tokens": 3.00
},
"tier_availability": ["paid"]
},
"openai/gpt-4o": {
"aliases": ["gpt-4o"],
"pricing": {

View File

@ -70,6 +70,12 @@ export const MODELS = {
recommended: false,
lowQuality: false
},
'moonshotai/kimi-k2': {
tier: 'premium',
priority: 96,
recommended: false,
lowQuality: false
},
'gpt-4.1': {
tier: 'premium',
priority: 96,