fix(ai): correct Kimi K3 gateway output limits
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Kimi K3 output limits for Vercel AI Gateway and OpenRouter models.
|
||||
|
||||
## [0.80.8] - 2026-07-16
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
@@ -234,6 +234,8 @@ const KIMI_K3_THINKING_LEVEL_MAP = {
|
||||
xhigh: null,
|
||||
max: "max",
|
||||
} as const;
|
||||
const KIMI_K3_MAX_TOKENS = 131072;
|
||||
const OPENROUTER_KIMI_K3_MODEL_IDS = new Set(["moonshotai/kimi-k3", "~moonshotai/kimi-latest"]);
|
||||
|
||||
const ANT_LING_RING_THINKING_LEVEL_MAP = {
|
||||
off: null,
|
||||
@@ -1825,6 +1827,13 @@ async function generateModels() {
|
||||
if (candidate.provider === "openai" && candidate.id === "gpt-5-pro") {
|
||||
candidate.maxTokens = 128000;
|
||||
}
|
||||
// Keep Kimi K3's canonical output limit when gateway metadata is missing or incorrect.
|
||||
if (
|
||||
(candidate.provider === "openrouter" && OPENROUTER_KIMI_K3_MODEL_IDS.has(candidate.id)) ||
|
||||
(candidate.provider === "vercel-ai-gateway" && candidate.id === "moonshotai/kimi-k3")
|
||||
) {
|
||||
candidate.maxTokens = KIMI_K3_MAX_TOKENS;
|
||||
}
|
||||
// Keep selected OpenRouter model metadata stable until upstream settles.
|
||||
if (candidate.provider === "openrouter" && candidate.id === "moonshotai/kimi-k2.5") {
|
||||
candidate.cost.input = 0.41;
|
||||
|
||||
@@ -1939,7 +1939,7 @@ export const OPENROUTER_MODELS = {
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 1048576,
|
||||
maxTokens: 4096,
|
||||
maxTokens: 131072,
|
||||
} satisfies Model<"openai-completions">,
|
||||
"nex-agi/nex-n2-mini": {
|
||||
id: "nex-agi/nex-n2-mini",
|
||||
@@ -4706,9 +4706,9 @@ export const OPENROUTER_MODELS = {
|
||||
thinkingLevelMap: {"xhigh":"xhigh"},
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0.9338,
|
||||
output: 2.9348,
|
||||
cacheRead: 0.17342,
|
||||
input: 0.9226,
|
||||
output: 2.8996,
|
||||
cacheRead: 0.17134,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 1048576,
|
||||
@@ -4856,7 +4856,7 @@ export const OPENROUTER_MODELS = {
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 1048576,
|
||||
maxTokens: 4096,
|
||||
maxTokens: 131072,
|
||||
} satisfies Model<"openai-completions">,
|
||||
"~openai/gpt-latest": {
|
||||
id: "~openai/gpt-latest",
|
||||
|
||||
@@ -1905,7 +1905,7 @@ export const VERCEL_AI_GATEWAY_MODELS = {
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 1000000,
|
||||
maxTokens: 256000,
|
||||
maxTokens: 131072,
|
||||
} satisfies Model<"anthropic-messages">,
|
||||
"nvidia/nemotron-3-nano-30b-a3b": {
|
||||
id: "nvidia/nemotron-3-nano-30b-a3b",
|
||||
|
||||
Reference in New Issue
Block a user