From 5737dec4f5c6366565fef28b23b684d0be5dbead Mon Sep 17 00:00:00 2001 From: Aaron <0019wu@gmail.com> Date: Tue, 15 Jul 2025 21:41:37 +0800 Subject: [PATCH] add groq Kimi K2 model support Add support for Moonshot AI's Kimi K2 model via groq with --- internal/llm/models/groq.go | 13 +++++++++++++ opencode-schema.json | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/internal/llm/models/groq.go b/internal/llm/models/groq.go index 19917f20b..0d14c7b13 100644 --- a/internal/llm/models/groq.go +++ b/internal/llm/models/groq.go @@ -11,6 +11,7 @@ const ( Llama4Maverick ModelID = "meta-llama/llama-4-maverick-17b-128e-instruct" Llama3_3_70BVersatile ModelID = "llama-3.3-70b-versatile" DeepseekR1DistillLlama70b ModelID = "deepseek-r1-distill-llama-70b" + Kimi_K2 ModelID = "moonshotai/kimi-k2-instruct" ) var GroqModels = map[ModelID]Model{ @@ -84,4 +85,16 @@ var GroqModels = map[ModelID]Model{ CanReason: true, SupportsAttachments: false, }, + Kimi_K2: { + ID: Kimi_K2, + Name: "Kimi K2", + Provider: ProviderGROQ, + APIModel: "moonshotai/kimi-k2-instruct", + CostPer1MIn: 1, + CostPer1MInCached: 0, + CostPer1MOutCached: 0, + CostPer1MOut: 3, + ContextWindow: 131_072, + SupportsAttachments: true, + }, } diff --git a/opencode-schema.json b/opencode-schema.json index 406c75f8c..c45e32145 100644 --- a/opencode-schema.json +++ b/opencode-schema.json @@ -88,7 +88,8 @@ "copilot.o3-mini", "copilot.o4-mini", "copilot.gemini-2.0-flash", - "copilot.gemini-2.5-pro" + "copilot.gemini-2.5-pro", + "moonshotai/kimi-k2-instruct" ], "type": "string" }, @@ -198,7 +199,8 @@ "copilot.o3-mini", "copilot.o4-mini", "copilot.gemini-2.0-flash", - "copilot.gemini-2.5-pro" + "copilot.gemini-2.5-pro", + "moonshotai/kimi-k2-instruct" ], "type": "string" },