mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
fix(ai): cap gpt-5.4 context windows to 272k
This commit is contained in:
parent
f8d731a134
commit
16ec7de29c
2 changed files with 23 additions and 25 deletions
|
|
@ -647,7 +647,10 @@ async function generateModels() {
|
||||||
const aiGatewayModels = await fetchAiGatewayModels();
|
const aiGatewayModels = await fetchAiGatewayModels();
|
||||||
|
|
||||||
// Combine models (models.dev has priority)
|
// Combine models (models.dev has priority)
|
||||||
const allModels = [...modelsDevModels, ...openRouterModels, ...aiGatewayModels];
|
const allModels = [...modelsDevModels, ...openRouterModels, ...aiGatewayModels].filter(
|
||||||
|
(model) =>
|
||||||
|
!((model.provider === "opencode" || model.provider === "opencode-go") && model.id === "gpt-5.3-codex-spark"),
|
||||||
|
);
|
||||||
|
|
||||||
// Fix incorrect cache pricing for Claude Opus 4.5 from models.dev
|
// Fix incorrect cache pricing for Claude Opus 4.5 from models.dev
|
||||||
// models.dev has 3x the correct pricing (1.5/18.75 instead of 0.5/6.25)
|
// models.dev has 3x the correct pricing (1.5/18.75 instead of 0.5/6.25)
|
||||||
|
|
@ -685,6 +688,18 @@ async function generateModels() {
|
||||||
candidate.contextWindow = 272000;
|
candidate.contextWindow = 272000;
|
||||||
candidate.maxTokens = 128000;
|
candidate.maxTokens = 128000;
|
||||||
}
|
}
|
||||||
|
// Keep selected OpenRouter model metadata stable until upstream settles.
|
||||||
|
if (candidate.provider === "openrouter" && candidate.id === "moonshotai/kimi-k2.5") {
|
||||||
|
candidate.cost.input = 0.41;
|
||||||
|
candidate.cost.output = 2.06;
|
||||||
|
candidate.cost.cacheRead = 0.07;
|
||||||
|
candidate.maxTokens = 4096;
|
||||||
|
}
|
||||||
|
if (candidate.provider === "openrouter" && candidate.id === "z-ai/glm-5") {
|
||||||
|
candidate.cost.input = 0.6;
|
||||||
|
candidate.cost.output = 1.9;
|
||||||
|
candidate.cost.cacheRead = 0.119;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6155,23 +6155,6 @@ export const MODELS = {
|
||||||
contextWindow: 400000,
|
contextWindow: 400000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"openai-responses">,
|
} satisfies Model<"openai-responses">,
|
||||||
"gpt-5.3-codex-spark": {
|
|
||||||
id: "gpt-5.3-codex-spark",
|
|
||||||
name: "GPT-5.3 Codex Spark",
|
|
||||||
api: "openai-responses",
|
|
||||||
provider: "opencode",
|
|
||||||
baseUrl: "https://opencode.ai/zen/v1",
|
|
||||||
reasoning: true,
|
|
||||||
input: ["text"],
|
|
||||||
cost: {
|
|
||||||
input: 1.75,
|
|
||||||
output: 14,
|
|
||||||
cacheRead: 0.175,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 128000,
|
|
||||||
maxTokens: 128000,
|
|
||||||
} satisfies Model<"openai-responses">,
|
|
||||||
"gpt-5.4": {
|
"gpt-5.4": {
|
||||||
id: "gpt-5.4",
|
id: "gpt-5.4",
|
||||||
name: "GPT-5.4",
|
name: "GPT-5.4",
|
||||||
|
|
@ -8055,13 +8038,13 @@ export const MODELS = {
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.44999999999999996,
|
input: 0.41,
|
||||||
output: 2.2,
|
output: 2.06,
|
||||||
cacheRead: 0.22499999999999998,
|
cacheRead: 0.07,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 262144,
|
contextWindow: 262144,
|
||||||
maxTokens: 65535,
|
maxTokens: 4096,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"openai-completions">,
|
||||||
"nex-agi/deepseek-v3.1-nex-n1": {
|
"nex-agi/deepseek-v3.1-nex-n1": {
|
||||||
id: "nex-agi/deepseek-v3.1-nex-n1",
|
id: "nex-agi/deepseek-v3.1-nex-n1",
|
||||||
|
|
@ -10401,9 +10384,9 @@ export const MODELS = {
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.7999999999999999,
|
input: 0.6,
|
||||||
output: 2.56,
|
output: 1.9,
|
||||||
cacheRead: 0.16,
|
cacheRead: 0.119,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 202752,
|
contextWindow: 202752,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue