feat(opencode-zen): add Kimi K2.5 and K2.5 Free models

Add Kimi K2.5 and Kimi K2.5 Free to the OpenCode Zen model catalog.

- Add aliases: kimi -> kimi-k2.5, kimi-free -> kimi-k2.5-free
- Both models use anthropic-messages API
- 256k context window, 8192 max tokens
- No image input support (like other Kimi/MiniMax models)
- Free tier pricing (0 input/output)
- Update static fallback models list
This commit is contained in:
neominik 2026-01-30 14:59:45 +01:00
parent c27111dda8
commit 535249c571

View File

@ -70,6 +70,10 @@ export const OPENCODE_ZEN_MODEL_ALIASES: Record<string, string> = {
// GLM (free) // GLM (free)
glm: "glm-4.7", glm: "glm-4.7",
"glm-free": "glm-4.7", "glm-free": "glm-4.7",
// Kimi (free)
kimi: "kimi-k2.5",
"kimi-free": "kimi-k2.5-free",
}; };
/** /**
@ -89,7 +93,7 @@ export function resolveOpencodeZenModelApi(modelId: string): ModelApi {
if (lower.startsWith("gpt-")) { if (lower.startsWith("gpt-")) {
return "openai-responses"; return "openai-responses";
} }
if (lower.startsWith("claude-") || lower.startsWith("minimax-")) { if (lower.startsWith("claude-") || lower.startsWith("minimax-") || lower.startsWith("kimi-")) {
return "anthropic-messages"; return "anthropic-messages";
} }
if (lower.startsWith("gemini-")) { if (lower.startsWith("gemini-")) {
@ -103,7 +107,7 @@ export function resolveOpencodeZenModelApi(modelId: string): ModelApi {
*/ */
function supportsImageInput(modelId: string): boolean { function supportsImageInput(modelId: string): boolean {
const lower = modelId.toLowerCase(); const lower = modelId.toLowerCase();
if (lower.includes("glm") || lower.includes("minimax")) { if (lower.includes("glm") || lower.includes("minimax") || lower.includes("kimi")) {
return false; return false;
} }
return true; return true;
@ -137,6 +141,8 @@ const MODEL_COSTS: Record<
cacheWrite: 0, cacheWrite: 0,
}, },
"gpt-5.2": { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 }, "gpt-5.2": { input: 1.75, output: 14, cacheRead: 0.175, cacheWrite: 0 },
"kimi-k2.5": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
"kimi-k2.5-free": { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
}; };
const DEFAULT_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }; const DEFAULT_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
@ -151,6 +157,8 @@ const MODEL_CONTEXT_WINDOWS: Record<string, number> = {
"gemini-3-flash": 1048576, "gemini-3-flash": 1048576,
"gpt-5.1-codex-max": 400000, "gpt-5.1-codex-max": 400000,
"gpt-5.2": 400000, "gpt-5.2": 400000,
"kimi-k2.5": 256000,
"kimi-k2.5-free": 256000,
}; };
function getDefaultContextWindow(modelId: string): number { function getDefaultContextWindow(modelId: string): number {
@ -167,6 +175,8 @@ const MODEL_MAX_TOKENS: Record<string, number> = {
"gemini-3-flash": 65536, "gemini-3-flash": 65536,
"gpt-5.1-codex-max": 128000, "gpt-5.1-codex-max": 128000,
"gpt-5.2": 128000, "gpt-5.2": 128000,
"kimi-k2.5": 8192,
"kimi-k2.5-free": 8192,
}; };
function getDefaultMaxTokens(modelId: string): number { function getDefaultMaxTokens(modelId: string): number {
@ -203,6 +213,8 @@ const MODEL_NAMES: Record<string, string> = {
"gemini-3-flash": "Gemini 3 Flash", "gemini-3-flash": "Gemini 3 Flash",
"gpt-5.1-codex-max": "GPT-5.1 Codex Max", "gpt-5.1-codex-max": "GPT-5.1 Codex Max",
"gpt-5.2": "GPT-5.2", "gpt-5.2": "GPT-5.2",
"kimi-k2.5": "Kimi K2.5",
"kimi-k2.5-free": "Kimi K2.5 Free",
}; };
function formatModelName(modelId: string): string { function formatModelName(modelId: string): string {
@ -230,6 +242,8 @@ export function getOpencodeZenStaticFallbackModels(): ModelDefinitionConfig[] {
"gemini-3-flash", "gemini-3-flash",
"gpt-5.1-codex-max", "gpt-5.1-codex-max",
"gpt-5.2", "gpt-5.2",
"kimi-k2.5",
"kimi-k2.5-free",
]; ];
return modelIds.map(buildModelDefinition); return modelIds.map(buildModelDefinition);