Skip to content

Commit fc63cc1

Browse files
committed
feat: add experimental modes to models to express things like "fast" that induce additional price changes
1 parent 26d2f3e commit fc63cc1

4 files changed

Lines changed: 29 additions & 0 deletions

File tree

packages/core/src/schema.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ export const Model = z
8888
output: z.number().min(0, "Output tokens must be positive"),
8989
}),
9090
status: z.enum(["alpha", "beta", "deprecated"]).optional(),
91+
experimental: z
92+
.object({
93+
modes: z
94+
.record(
95+
z.object({
96+
cost: Cost.optional(),
97+
provider: z
98+
.object({
99+
body: z.record(JsonValue).optional(),
100+
headers: z.record(z.string()).optional(),
101+
})
102+
.optional(),
103+
}),
104+
)
105+
.optional(),
106+
})
107+
.optional(),
91108
provider: z
92109
.object({
93110
npm: z.string().optional(),

providers/anthropic/models/claude-opus-4-6.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ output = 128_000
2222
[modalities]
2323
input = ["text", "image", "pdf"]
2424
output = ["text"]
25+
26+
[experimental.modes.fast]
27+
cost = { input = 30.00, output = 150.00, cache_read = 3.00, cache_write = 37.50 }
28+
provider = { body = { speed = "fast" }, headers = { anthropic-beta = "fast-mode-2026-02-01" } }

providers/openai/models/gpt-5.4-mini.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ output = 128_000
2323
[modalities]
2424
input = ["text", "image"]
2525
output = ["text"]
26+
27+
[experimental.modes.fast]
28+
cost = { input = 1.50, output = 9.00, cache_read = 0.15 }
29+
provider = { body = { service_tier = "priority" } }

providers/openai/models/gpt-5.4.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ output = 128_000
2828
[modalities]
2929
input = ["text", "image", "pdf"]
3030
output = ["text"]
31+
32+
[experimental.modes.fast]
33+
cost = { input = 5.00, output = 30.00, cache_read = 0.50 }
34+
provider = { body = { service_tier = "priority" } }

0 commit comments

Comments
 (0)