From 24bf877c0c565f4bf4db869f4e32b7fc7f280193 Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:59:36 -0700 Subject: [PATCH 1/2] feat(models): add fast-tier model variants --- packages/core/src/schema.ts | 14 +++++++++ .../models/claude-opus-4-6-fast.toml | 28 +++++++++++++++++ providers/openai/models/gpt-5.4-fast.toml | 28 +++++++++++++++++ .../opencode/models/claude-opus-4-6-fast.toml | 31 +++++++++++++++++++ providers/opencode/models/gpt-5.4-fast.toml | 31 +++++++++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 providers/anthropic/models/claude-opus-4-6-fast.toml create mode 100644 providers/openai/models/gpt-5.4-fast.toml create mode 100644 providers/opencode/models/claude-opus-4-6-fast.toml create mode 100644 providers/opencode/models/gpt-5.4-fast.toml diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.ts index 55b118451..4cabc3697 100644 --- a/packages/core/src/schema.ts +++ b/packages/core/src/schema.ts @@ -2,6 +2,19 @@ import { z } from "zod"; import { ModelFamily } from "./family"; +const ProviderValue: z.ZodType< + string | number | boolean | null | Array | Record +> = z.lazy(() => + z.union([ + z.string(), + z.number(), + z.boolean(), + z.null(), + z.array(ProviderValue), + z.record(ProviderValue), + ]), +); + const Cost = z.object({ input: z.number().min(0, "Input price cannot be negative"), output: z.number().min(0, "Output price cannot be negative"), @@ -74,6 +87,7 @@ export const Model = z npm: z.string().optional(), api: z.string().optional(), shape: z.enum(["responses", "completions"]).optional(), + options: z.record(ProviderValue).optional(), }) .optional(), }) diff --git a/providers/anthropic/models/claude-opus-4-6-fast.toml b/providers/anthropic/models/claude-opus-4-6-fast.toml new file mode 100644 index 000000000..d8224ef5b --- /dev/null +++ b/providers/anthropic/models/claude-opus-4-6-fast.toml @@ -0,0 +1,28 @@ +name = "Claude Opus 4.6 Fast" +family = "claude-opus" +release_date = "2026-02-05" +last_updated = "2026-03-16" +attachment = true +reasoning = true +temperature = true +tool_call = true +knowledge = "2025-05" +open_weights = false +status = "beta" + +[cost] +input = 30.00 +output = 150.00 +cache_read = 3.00 +cache_write = 37.50 + +[limit] +context = 1_000_000 +output = 128_000 + +[modalities] +input = ["text", "image", "pdf"] +output = ["text"] + +[provider.options] +speed = "fast" diff --git a/providers/openai/models/gpt-5.4-fast.toml b/providers/openai/models/gpt-5.4-fast.toml new file mode 100644 index 000000000..37e237b69 --- /dev/null +++ b/providers/openai/models/gpt-5.4-fast.toml @@ -0,0 +1,28 @@ +name = "GPT-5.4 Fast" +family = "gpt" +release_date = "2026-03-05" +last_updated = "2026-03-16" +attachment = true +reasoning = true +temperature = false +knowledge = "2025-08-31" +tool_call = true +structured_output = true +open_weights = false + +[cost] +input = 5.00 +output = 30.00 +cache_read = 0.50 + +[limit] +context = 1_050_000 +input = 922_000 +output = 128_000 + +[modalities] +input = ["text", "image", "pdf"] +output = ["text"] + +[provider.options] +serviceTier = "priority" diff --git a/providers/opencode/models/claude-opus-4-6-fast.toml b/providers/opencode/models/claude-opus-4-6-fast.toml new file mode 100644 index 000000000..899d9a777 --- /dev/null +++ b/providers/opencode/models/claude-opus-4-6-fast.toml @@ -0,0 +1,31 @@ +name = "Claude Opus 4.6 Fast" +family = "claude-opus" +release_date = "2026-02-05" +last_updated = "2026-03-16" +attachment = true +reasoning = true +temperature = true +tool_call = true +knowledge = "2025-08-31" +open_weights = false +status = "beta" + +[cost] +input = 30.00 +output = 150.00 +cache_read = 3.00 +cache_write = 37.50 + +[limit] +context = 1_000_000 +output = 128_000 + +[modalities] +input = ["text", "image", "pdf"] +output = ["text"] + +[provider] +npm = "@ai-sdk/anthropic" + +[provider.options] +speed = "fast" diff --git a/providers/opencode/models/gpt-5.4-fast.toml b/providers/opencode/models/gpt-5.4-fast.toml new file mode 100644 index 000000000..89fb85acb --- /dev/null +++ b/providers/opencode/models/gpt-5.4-fast.toml @@ -0,0 +1,31 @@ +name = "GPT-5.4 Fast" +family = "gpt" +release_date = "2026-03-05" +last_updated = "2026-03-16" +attachment = true +reasoning = true +temperature = false +knowledge = "2025-08-31" +tool_call = true +structured_output = true +open_weights = false + +[cost] +input = 5.00 +output = 30.00 +cache_read = 0.50 + +[limit] +context = 1_050_000 +input = 922_000 +output = 128_000 + +[modalities] +input = ["text", "image", "pdf"] +output = ["text"] + +[provider] +npm = "@ai-sdk/openai" + +[provider.options] +serviceTier = "priority" From 9084cfa52901a853a539d6b4e8616a17a75260a0 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Wed, 1 Apr 2026 21:02:28 -0500 Subject: [PATCH 2/2] tweak: adjust field to be called 'body', convert it to actual request form rather than ai sdk form --- packages/core/src/schema.ts | 8 ++++---- providers/anthropic/models/claude-opus-4-6-fast.toml | 2 +- providers/openai/models/gpt-5.4-fast.toml | 4 ++-- providers/opencode/models/claude-opus-4-6-fast.toml | 2 +- providers/opencode/models/gpt-5.4-fast.toml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.ts index 4cabc3697..5185c9481 100644 --- a/packages/core/src/schema.ts +++ b/packages/core/src/schema.ts @@ -2,7 +2,7 @@ import { z } from "zod"; import { ModelFamily } from "./family"; -const ProviderValue: z.ZodType< +const BodyValue: z.ZodType< string | number | boolean | null | Array | Record > = z.lazy(() => z.union([ @@ -10,8 +10,8 @@ const ProviderValue: z.ZodType< z.number(), z.boolean(), z.null(), - z.array(ProviderValue), - z.record(ProviderValue), + z.array(BodyValue), + z.record(BodyValue), ]), ); @@ -87,7 +87,7 @@ export const Model = z npm: z.string().optional(), api: z.string().optional(), shape: z.enum(["responses", "completions"]).optional(), - options: z.record(ProviderValue).optional(), + body: z.record(BodyValue).optional(), }) .optional(), }) diff --git a/providers/anthropic/models/claude-opus-4-6-fast.toml b/providers/anthropic/models/claude-opus-4-6-fast.toml index d8224ef5b..a758629c6 100644 --- a/providers/anthropic/models/claude-opus-4-6-fast.toml +++ b/providers/anthropic/models/claude-opus-4-6-fast.toml @@ -24,5 +24,5 @@ output = 128_000 input = ["text", "image", "pdf"] output = ["text"] -[provider.options] +[provider.body] speed = "fast" diff --git a/providers/openai/models/gpt-5.4-fast.toml b/providers/openai/models/gpt-5.4-fast.toml index 37e237b69..a9ff18a4f 100644 --- a/providers/openai/models/gpt-5.4-fast.toml +++ b/providers/openai/models/gpt-5.4-fast.toml @@ -24,5 +24,5 @@ output = 128_000 input = ["text", "image", "pdf"] output = ["text"] -[provider.options] -serviceTier = "priority" +[provider.body] +service_tier = "priority" diff --git a/providers/opencode/models/claude-opus-4-6-fast.toml b/providers/opencode/models/claude-opus-4-6-fast.toml index 899d9a777..201603515 100644 --- a/providers/opencode/models/claude-opus-4-6-fast.toml +++ b/providers/opencode/models/claude-opus-4-6-fast.toml @@ -27,5 +27,5 @@ output = ["text"] [provider] npm = "@ai-sdk/anthropic" -[provider.options] +[provider.body] speed = "fast" diff --git a/providers/opencode/models/gpt-5.4-fast.toml b/providers/opencode/models/gpt-5.4-fast.toml index 89fb85acb..f5b9ea7b3 100644 --- a/providers/opencode/models/gpt-5.4-fast.toml +++ b/providers/opencode/models/gpt-5.4-fast.toml @@ -27,5 +27,5 @@ output = ["text"] [provider] npm = "@ai-sdk/openai" -[provider.options] -serviceTier = "priority" +[provider.body] +service_tier = "priority"