mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(ai): use models.dev metadata for Claude 5.5 models
Remove hardcoded Opus 5.5, Sonnet 5.5, and Haiku 5.5 fallbacks now that models.dev lists them. Fix the Sonnet 5.5 test to expect the official cache read price of 0.1.
This commit is contained in:
parent
7933a0e286
commit
ce950d78f4
2 changed files with 1 additions and 86 deletions
|
|
@ -2726,91 +2726,6 @@ async function generateModels() {
|
|||
!((model.provider === "opencode" || model.provider === "opencode-go") && model.id === "gpt-5.3-codex-spark"),
|
||||
);
|
||||
|
||||
// Add Claude Opus 5.5 until models.dev includes it.
|
||||
// https://platform.claude.com/docs/en/models/opus-5-5/overview
|
||||
if (!allModels.some((model) => model.provider === "anthropic" && model.id === "claude-opus-5-5")) {
|
||||
allModels.push({
|
||||
id: "claude-opus-5-5",
|
||||
name: "Claude Opus 5.5",
|
||||
api: "anthropic-messages",
|
||||
provider: "anthropic",
|
||||
baseUrl: "https://api.anthropic.com",
|
||||
reasoning: true,
|
||||
thinkingLevelMap: {
|
||||
off: null,
|
||||
minimal: null,
|
||||
low: "low",
|
||||
medium: "medium",
|
||||
high: "high",
|
||||
xhigh: "xhigh",
|
||||
max: "max",
|
||||
},
|
||||
input: ["text", "image"],
|
||||
cost: { input: 4, output: 20, cacheRead: 0.2, cacheWrite: 5 },
|
||||
contextWindow: 1000000,
|
||||
maxTokens: 128000,
|
||||
});
|
||||
}
|
||||
|
||||
// Add Claude Sonnet 5.5 until models.dev includes it.
|
||||
// https://platform.claude.com/docs/en/models/sonnet-5-5/overview
|
||||
if (!allModels.some((model) => model.provider === "anthropic" && model.id === "claude-sonnet-5-5")) {
|
||||
allModels.push({
|
||||
id: "claude-sonnet-5-5",
|
||||
name: "Claude Sonnet 5.5",
|
||||
api: "anthropic-messages",
|
||||
provider: "anthropic",
|
||||
baseUrl: "https://api.anthropic.com",
|
||||
reasoning: true,
|
||||
thinkingLevelMap: {
|
||||
off: null,
|
||||
minimal: null,
|
||||
low: "low",
|
||||
medium: "medium",
|
||||
high: "high",
|
||||
xhigh: "xhigh",
|
||||
max: "max",
|
||||
},
|
||||
input: ["text", "image"],
|
||||
cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
|
||||
contextWindow: 1000000,
|
||||
maxTokens: 128000,
|
||||
});
|
||||
}
|
||||
|
||||
// Add Claude Haiku 5.5 until models.dev includes it. Prompts over 100k input tokens
|
||||
// are billed at 5x for the whole request.
|
||||
// https://platform.claude.com/docs/en/models/haiku-5-5/overview
|
||||
if (!allModels.some((model) => model.provider === "anthropic" && model.id === "claude-haiku-5-5")) {
|
||||
allModels.push({
|
||||
id: "claude-haiku-5-5",
|
||||
name: "Claude Haiku 5.5",
|
||||
api: "anthropic-messages",
|
||||
provider: "anthropic",
|
||||
baseUrl: "https://api.anthropic.com",
|
||||
reasoning: true,
|
||||
thinkingLevelMap: {
|
||||
off: null,
|
||||
minimal: null,
|
||||
low: "low",
|
||||
medium: "medium",
|
||||
high: "high",
|
||||
xhigh: "xhigh",
|
||||
max: "max",
|
||||
},
|
||||
input: ["text", "image"],
|
||||
cost: {
|
||||
input: 0.1,
|
||||
output: 0.5,
|
||||
cacheRead: 0.01,
|
||||
cacheWrite: 0.125,
|
||||
tiers: [{ inputTokensAbove: 100000, input: 0.5, output: 2.5, cacheRead: 0.05, cacheWrite: 0.625 }],
|
||||
},
|
||||
contextWindow: 1000000,
|
||||
maxTokens: 128000,
|
||||
});
|
||||
}
|
||||
|
||||
// The authenticated Copilot catalog advertised these models on 2026-09-22,
|
||||
// but models.dev did not include them yet.
|
||||
const missingCopilotModels: Model<Api>[] = [
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ describe("getSupportedThinkingLevels", () => {
|
|||
it("includes Claude Sonnet 5.5 with managed effort levels and official pricing", () => {
|
||||
const model = getModel("anthropic", "claude-sonnet-5-5");
|
||||
expect(model).toMatchObject({
|
||||
cost: { input: 2, output: 10, cacheRead: 0.2, cacheWrite: 2.5 },
|
||||
cost: { input: 2, output: 10, cacheRead: 0.1, cacheWrite: 2.5 },
|
||||
contextWindow: 1_000_000,
|
||||
maxTokens: 128_000,
|
||||
compat: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue