Compare commits
226
Commits
issue-5392
...
issue-5628
No files matched your search
@@ -0,0 +1,19 @@
|
||||
# Source: https://www.qwencloud.com/models/qwen3.8-flash
|
||||
name = "Qwen3.8 Flash"
|
||||
description = "Qwen vision-language model for visual reasoning, documents, and agent tasks"
|
||||
family = "qwen"
|
||||
release_date = "2026-08-26"
|
||||
last_updated = "2026-08-26"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
output = 131_072
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "video"]
|
||||
output = ["text"]
|
||||
@@ -6,7 +6,7 @@ description = "Low-latency ByteDance Seed model for high-throughput chat, extrac
|
||||
family = "seed"
|
||||
release_date = "2025-08-28"
|
||||
last_updated = "2025-08-28"
|
||||
attachment = false
|
||||
attachment = true
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
@@ -17,5 +17,5 @@ context = 256_000
|
||||
output = 32_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
@@ -6,7 +6,7 @@ description = "ByteDance Seed model for multimodal reasoning, long-context analy
|
||||
family = "seed"
|
||||
release_date = "2025-12-28"
|
||||
last_updated = "2025-12-28"
|
||||
attachment = false
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
@@ -17,5 +17,5 @@ context = 256_000
|
||||
output = 64_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
@@ -0,0 +1,28 @@
|
||||
# Sources:
|
||||
# https://docs.cohere.com/docs/models
|
||||
# https://docs.cohere.com/v2/docs/transcribe
|
||||
# https://docs.cohere.com/v2/reference/create-audio-transcription
|
||||
# https://cohere.com/blog/transcribe
|
||||
# https://huggingface.co/CohereLabs/cohere-transcribe-03-2026
|
||||
name = "Cohere Transcribe"
|
||||
description = "Open-source 2B multilingual automatic speech recognition model for audio-to-text transcription"
|
||||
release_date = "2026-03-26"
|
||||
last_updated = "2026-03-26"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = false
|
||||
open_weights = true
|
||||
license = "Apache-2.0"
|
||||
|
||||
[limit]
|
||||
context = 0
|
||||
output = 0
|
||||
|
||||
[modalities]
|
||||
input = ["audio"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/CohereLabs/cohere-transcribe-03-2026"
|
||||
@@ -0,0 +1,26 @@
|
||||
# Sources:
|
||||
# https://docs.cohere.com/docs/models
|
||||
# https://docs.cohere.com/docs/parse
|
||||
# https://docs.cohere.com/v2/reference/parse
|
||||
#
|
||||
# release_date/last_updated: Cohere docs list parse-v5.0 as Live but do not
|
||||
# publish a launch day. Values below are the catalog verification date
|
||||
# (2026-08-27), not a first-party launch announcement — correct if a
|
||||
# definitive public launch date is found.
|
||||
name = "Parse v5.0"
|
||||
description = "Vision parsing model that extracts structured Markdown or blocks from document images"
|
||||
release_date = "2026-08-27"
|
||||
last_updated = "2026-08-27"
|
||||
attachment = true
|
||||
reasoning = false
|
||||
temperature = false
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 8_192
|
||||
output = 8_192
|
||||
|
||||
[modalities]
|
||||
input = ["image"]
|
||||
output = ["text"]
|
||||
@@ -0,0 +1,27 @@
|
||||
# Sources:
|
||||
# https://docs.cohere.com/docs/models
|
||||
# https://docs.cohere.com/docs/tiny-aya
|
||||
# https://cohere.com/blog/cohere-labs-tiny-aya
|
||||
# https://huggingface.co/CohereLabs/tiny-aya-earth
|
||||
name = "Tiny Aya Earth"
|
||||
description = "Compact 3.35B multilingual chat model specialized for West Asian and African languages"
|
||||
release_date = "2026-02-17"
|
||||
last_updated = "2026-02-17"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = false
|
||||
open_weights = true
|
||||
license = "CC-BY-NC-4.0"
|
||||
|
||||
[limit]
|
||||
context = 8_000
|
||||
output = 8_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/CohereLabs/tiny-aya-earth"
|
||||
@@ -0,0 +1,27 @@
|
||||
# Sources:
|
||||
# https://docs.cohere.com/docs/models
|
||||
# https://docs.cohere.com/docs/tiny-aya
|
||||
# https://cohere.com/blog/cohere-labs-tiny-aya
|
||||
# https://huggingface.co/CohereLabs/tiny-aya-fire
|
||||
name = "Tiny Aya Fire"
|
||||
description = "Compact 3.35B multilingual chat model specialized for South Asian languages"
|
||||
release_date = "2026-02-17"
|
||||
last_updated = "2026-02-17"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = false
|
||||
open_weights = true
|
||||
license = "CC-BY-NC-4.0"
|
||||
|
||||
[limit]
|
||||
context = 8_000
|
||||
output = 8_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/CohereLabs/tiny-aya-fire"
|
||||
@@ -0,0 +1,27 @@
|
||||
# Sources:
|
||||
# https://docs.cohere.com/docs/models
|
||||
# https://docs.cohere.com/docs/tiny-aya
|
||||
# https://cohere.com/blog/cohere-labs-tiny-aya
|
||||
# https://huggingface.co/CohereLabs/tiny-aya-global
|
||||
name = "Tiny Aya Global"
|
||||
description = "Compact 3.35B multilingual chat model with balanced performance across 70 languages"
|
||||
release_date = "2026-02-17"
|
||||
last_updated = "2026-02-17"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = false
|
||||
open_weights = true
|
||||
license = "CC-BY-NC-4.0"
|
||||
|
||||
[limit]
|
||||
context = 8_000
|
||||
output = 8_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/CohereLabs/tiny-aya-global"
|
||||
@@ -0,0 +1,27 @@
|
||||
# Sources:
|
||||
# https://docs.cohere.com/docs/models
|
||||
# https://docs.cohere.com/docs/tiny-aya
|
||||
# https://cohere.com/blog/cohere-labs-tiny-aya
|
||||
# https://huggingface.co/CohereLabs/tiny-aya-water
|
||||
name = "Tiny Aya Water"
|
||||
description = "Compact 3.35B multilingual chat model specialized for European and Asia-Pacific languages"
|
||||
release_date = "2026-02-17"
|
||||
last_updated = "2026-02-17"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = false
|
||||
open_weights = true
|
||||
license = "CC-BY-NC-4.0"
|
||||
|
||||
[limit]
|
||||
context = 8_000
|
||||
output = 8_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/CohereLabs/tiny-aya-water"
|
||||
@@ -0,0 +1,19 @@
|
||||
# Source: https://vercel.com/ai-gateway/models/gemini-3.5-transcribe-live
|
||||
# Live transcription has no token context/output window; zero denotes not applicable.
|
||||
name = "Gemini 3.5 Transcribe Live"
|
||||
description = "Speech transcription model for accurate audio-to-text and captioning workflows"
|
||||
family = "gemini"
|
||||
release_date = "2026-08-26"
|
||||
last_updated = "2026-08-26"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 0
|
||||
output = 0
|
||||
|
||||
[modalities]
|
||||
input = ["audio"]
|
||||
output = ["text"]
|
||||
@@ -11,8 +11,8 @@ tool_call = true
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 200_000
|
||||
output = 131_000
|
||||
context = 65_536
|
||||
output = 2_048
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
|
||||
@@ -10,8 +10,8 @@ tool_call = true
|
||||
open_weights = true
|
||||
|
||||
[limit]
|
||||
context = 196_608
|
||||
output = 128_000
|
||||
context = 204_800
|
||||
output = 131_072
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
|
||||
@@ -10,8 +10,8 @@ tool_call = true
|
||||
open_weights = true
|
||||
|
||||
[limit]
|
||||
context = 512_000
|
||||
output = 128_000
|
||||
context = 1_048_576
|
||||
output = 512_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "video"]
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# Sources:
|
||||
# - https://platform.minimax.io/docs/guides/image-generation (text-to-image + subject reference)
|
||||
# - https://platform.minimax.io/docs/api-reference/image-generation-t2i (POST /v1/image_generation)
|
||||
# - https://platform.minimax.io/docs/guides/pricing-paygo#image ($0.0035 per image)
|
||||
# - https://platform.minimax.io/docs/guides/pricing-token-plan (covered by Token Plan; no per-image cost)
|
||||
# Note: served on the standalone image endpoint (/v1/image_generation), not the
|
||||
# Anthropic-compatible /anthropic/v1 base — hence no provider entry under providers/minimax*.
|
||||
|
||||
name = "MiniMax image-01"
|
||||
description = "MiniMax text-to-image generation model with reference-image support"
|
||||
family = "minimax"
|
||||
release_date = "2025-02-15"
|
||||
last_updated = "2026-08-25"
|
||||
attachment = true
|
||||
reasoning = false
|
||||
temperature = false
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 0
|
||||
output = 0
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["image"]
|
||||
@@ -5,7 +5,7 @@ release_date = "2025-08-07"
|
||||
last_updated = "2025-08-07"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
temperature = false
|
||||
tool_call = false
|
||||
structured_output = true
|
||||
knowledge = "2024-09-30"
|
||||
|
||||
@@ -5,7 +5,7 @@ release_date = "2025-11-13"
|
||||
last_updated = "2025-11-13"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2024-09-30"
|
||||
|
||||
@@ -5,7 +5,7 @@ release_date = "2025-12-11"
|
||||
last_updated = "2025-12-11"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2025-08-31"
|
||||
|
||||
@@ -5,7 +5,7 @@ release_date = "2026-02-05"
|
||||
last_updated = "2026-02-05"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2025-08-31"
|
||||
|
||||
@@ -5,7 +5,7 @@ release_date = "2026-03-17"
|
||||
last_updated = "2026-03-17"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2025-08-31"
|
||||
|
||||
@@ -5,7 +5,7 @@ release_date = "2026-03-17"
|
||||
last_updated = "2026-03-17"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2025-08-31"
|
||||
|
||||
@@ -5,7 +5,7 @@ release_date = "2026-03-05"
|
||||
last_updated = "2026-03-05"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2025-08-31"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
name = "Hy4 preview"
|
||||
description = "A next-generation productivity model with significantly enhanced Agent and complex task execution capabilities."
|
||||
family = "Hy"
|
||||
release_date = "2026-08-28"
|
||||
last_updated = "2026-08-28"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 1_024_000
|
||||
output = 64_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
@@ -0,0 +1,19 @@
|
||||
name = "GLM-5.3-Flash"
|
||||
description = "Native multimodal GLM model for efficient coding and long-horizon agent tasks"
|
||||
family = "glm"
|
||||
release_date = "2026-08-26"
|
||||
last_updated = "2026-08-26"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
output = 131_072
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "video", "pdf"]
|
||||
output = ["text"]
|
||||
@@ -25,6 +25,7 @@
|
||||
"chutes:sync": "bun ./packages/core/script/sync-models.ts chutes",
|
||||
"databricks:generate": "bun ./packages/core/script/generate-databricks.ts",
|
||||
"helicone:generate": "bun ./packages/core/script/generate-helicone.ts",
|
||||
"cloudflare-ai-gateway:generate": "bun ./packages/core/script/generate-cloudflare-ai-gateway.ts",
|
||||
"huggingface:sync": "bun ./packages/core/script/sync-models.ts huggingface",
|
||||
"kilo:sync": "bun ./packages/core/script/sync-models.ts kilo",
|
||||
"llmgateway:sync": "bun ./packages/core/script/sync-models.ts llmgateway",
|
||||
|
||||
@@ -0,0 +1,417 @@
|
||||
#!/usr/bin/env bun
|
||||
//
|
||||
// Regenerate the cloudflare-ai-gateway provider model TOMLs from Cloudflare's own sources,
|
||||
// with human curation reduced to providers/cloudflare-ai-gateway/curation.toml.
|
||||
//
|
||||
// Scope: proxied third-party models only (anthropic, openai, google, xai, alibaba, deepseek,
|
||||
// moonshotai, …). Cloudflare's own Workers AI (@cf/...) models are a different pathway — hosted
|
||||
// on Cloudflare, CF-token auth, model agreements — and live in their own provider,
|
||||
// providers/cloudflare-workers-ai, so they are deliberately not mirrored here.
|
||||
//
|
||||
// Source of truth (live):
|
||||
// - GET /accounts/{id}/ai/catalog/models — canonical dotted model_id, name, description,
|
||||
// context_length, max_output_tokens, and pricing (flat or context-tiered).
|
||||
//
|
||||
// curation.toml holds only what that source cannot express: structured_output (a quality
|
||||
// judgement — Cloudflare advertises response_format broadly but several models do not honour
|
||||
// it), reasoning_options (the catalog has no reasoning schema), limit divergences, and a skip
|
||||
// list for catalog ids with no lab file (or not reachable via unified billing).
|
||||
//
|
||||
// Env: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID
|
||||
// CF_AIG_FIXTURE_DIR (optional) — read cached catalog* JSON instead of the network.
|
||||
//
|
||||
// Usage:
|
||||
// CLOUDFLARE_API_TOKEN=… CLOUDFLARE_ACCOUNT_ID=… bun run cloudflare-ai-gateway:generate
|
||||
// bun run cloudflare-ai-gateway:generate --check # fail if the tree would change
|
||||
|
||||
import path from "node:path";
|
||||
import { readdirSync, readFileSync, statSync, existsSync, rmSync } from "node:fs";
|
||||
import { z } from "zod";
|
||||
import { formatToml } from "../src/sync/index.ts";
|
||||
|
||||
const PROVIDER_DIR = path.join(
|
||||
import.meta.dirname, "..", "..", "..", "providers", "cloudflare-ai-gateway",
|
||||
);
|
||||
const MODELS_DIR = path.join(PROVIDER_DIR, "models");
|
||||
const MODELS_ROOT = path.join(import.meta.dirname, "..", "..", "..", "models");
|
||||
const CURATION_PATH = path.join(PROVIDER_DIR, "curation.toml");
|
||||
|
||||
const TEXT_GENERATION = "Text Generation";
|
||||
|
||||
// Proxied providers that Cloudflare fronts with a *native* passthrough route rather than the
|
||||
// gateway's generic OpenAI-compatible transform: Anthropic keeps the Messages API, OpenAI keeps
|
||||
// the Responses API. Advertise each model's native SDK so consumers route to the endpoint that
|
||||
// serves it best instead of falling back to the provider default (ai-gateway-provider). Other
|
||||
// third-party providers Cloudflare only exposes over the compat route inherit that default.
|
||||
// https://developers.cloudflare.com/ai-gateway/usage/providers/anthropic/
|
||||
// https://developers.cloudflare.com/ai-gateway/usage/providers/openai/
|
||||
const NATIVE_NPM: Record<string, string> = {
|
||||
anthropic: "@ai-sdk/anthropic",
|
||||
openai: "@ai-sdk/openai",
|
||||
};
|
||||
function nativeNpm(id: string): string | undefined {
|
||||
return NATIVE_NPM[id.split("/")[0]!];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// curation.toml schema
|
||||
// ---------------------------------------------------------------------------
|
||||
const ReasoningOption = z.record(z.any());
|
||||
const CuratedModel = z
|
||||
.object({
|
||||
base_model: z.string().min(1).optional(),
|
||||
structured_output: z.boolean().optional(),
|
||||
reasoning_options: z.array(ReasoningOption).optional(),
|
||||
limit: z.record(z.number()).optional(),
|
||||
interleaved: z
|
||||
.union([z.literal(true), z.object({ field: z.enum(["reasoning_content", "reasoning_details"]) }).strict()])
|
||||
.optional(),
|
||||
// Leading `#` comment lines, e.g. a toggle/effort wire-path note (AGENTS.md requires one
|
||||
// for every `toggle` reasoning option) or a source citation. Rendered verbatim above the
|
||||
// generated fields so hand-verified host behavior survives every regeneration.
|
||||
note: z.array(z.string()).optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
const Curation = z
|
||||
.object({
|
||||
skip: z.array(z.string()).default([]),
|
||||
models: z.record(CuratedModel).default({}),
|
||||
})
|
||||
.strict();
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Fetch (with fixture fallback)
|
||||
// ---------------------------------------------------------------------------
|
||||
async function fetchAllPages(url: string, token: string, perPage: number) {
|
||||
const out: any[] = [];
|
||||
for (let page = 1; page < 50; page++) {
|
||||
const res = await fetch(`${url}?page=${page}&per_page=${perPage}`, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
if (!res.ok) throw new Error(`Fetch failed ${res.status} ${res.statusText} for ${url}`);
|
||||
const json: any = await res.json();
|
||||
out.push(...(json.result ?? []));
|
||||
const total = json.result_info?.total_count ?? out.length;
|
||||
if (out.length >= total || (json.result ?? []).length === 0) break;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// Fetch with retry on 429/5xx. raw.githubusercontent.com rate-limits bursts, so honour
|
||||
// Retry-After when present and otherwise back off exponentially. Returns the Response;
|
||||
// callers decide how to treat a final !ok (throw vs. tolerate).
|
||||
async function fetchWithRetry(url: string, init?: RequestInit, tries = 5): Promise<Response> {
|
||||
let delay = 500;
|
||||
for (let attempt = 1; ; attempt++) {
|
||||
const res = await fetch(url, init);
|
||||
if (res.ok || (res.status !== 429 && res.status < 500) || attempt >= tries) return res;
|
||||
const retryAfter = Number(res.headers.get("retry-after"));
|
||||
const wait = Number.isFinite(retryAfter) && retryAfter > 0 ? retryAfter * 1000 : delay;
|
||||
await new Promise((r) => setTimeout(r, wait));
|
||||
delay = Math.min(delay * 2, 8000);
|
||||
}
|
||||
}
|
||||
|
||||
// Run async tasks with bounded concurrency to avoid tripping rate limits.
|
||||
async function mapLimit<T, R>(items: T[], limit: number, fn: (item: T) => Promise<R>): Promise<R[]> {
|
||||
const results = new Array<R>(items.length);
|
||||
let next = 0;
|
||||
const workers = Array.from({ length: Math.min(limit, items.length) }, async () => {
|
||||
while (true) {
|
||||
const i = next++;
|
||||
if (i >= items.length) break;
|
||||
results[i] = await fn(items[i]!);
|
||||
}
|
||||
});
|
||||
await Promise.all(workers);
|
||||
return results;
|
||||
}
|
||||
|
||||
// Load rows from every fixture file whose name starts with prefix, de-duplicated by their
|
||||
// catalog model_id. Dedup guards against overlapping snapshot files inflating the model set.
|
||||
function loadFixtureRows(dir: string, prefix: string): any[] {
|
||||
const byId = new Map<string, any>();
|
||||
for (const f of readdirSync(dir).filter((f) => f.startsWith(prefix) && f.endsWith(".json"))) {
|
||||
for (const row of JSON.parse(readFileSync(path.join(dir, f), "utf8")).result ?? []) {
|
||||
const key = row.model_id ?? row.name ?? JSON.stringify(row);
|
||||
byId.set(key, row);
|
||||
}
|
||||
}
|
||||
return [...byId.values()];
|
||||
}
|
||||
|
||||
async function loadProxied() {
|
||||
const fixtureDir = process.env.CF_AIG_FIXTURE_DIR;
|
||||
if (fixtureDir) return loadFixtureRows(fixtureDir, "catalog");
|
||||
const token = process.env.CLOUDFLARE_API_TOKEN;
|
||||
const account = process.env.CLOUDFLARE_ACCOUNT_ID;
|
||||
if (!token || !account) {
|
||||
throw new Error(
|
||||
"Set CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID (or CF_AIG_FIXTURE_DIR for offline runs).",
|
||||
);
|
||||
}
|
||||
const base = `https://api.cloudflare.com/client/v4/accounts/${account}/ai`;
|
||||
return fetchAllPages(`${base}/catalog/models`, token, 50);
|
||||
}
|
||||
|
||||
// Load the per-model catalog schema for a proxied model. The list endpoint omits `schema`;
|
||||
// the single-model schema endpoint returns schema.input, from which reasoning_options are
|
||||
// derivable for OpenAI-compatible providers (xai, alibaba, openai). Providers whose schema
|
||||
// is their native shape (google, anthropic, deepseek, moonshotai) return no reasoning
|
||||
// property — those fall back to curation.toml. Returns schema.input or undefined.
|
||||
async function loadCatalogSchemaInput(id: string): Promise<unknown> {
|
||||
const fixtureDir = process.env.CF_AIG_FIXTURE_DIR;
|
||||
if (fixtureDir) {
|
||||
const p = path.join(fixtureDir, "schema", `${id.replace(/\//g, "_")}.json`);
|
||||
if (!existsSync(p)) return undefined; // schema is optional per-model
|
||||
return JSON.parse(readFileSync(p, "utf8")).result?.schema?.input;
|
||||
}
|
||||
const token = process.env.CLOUDFLARE_API_TOKEN!;
|
||||
const account = process.env.CLOUDFLARE_ACCOUNT_ID!;
|
||||
const res = await fetchWithRetry(
|
||||
`https://api.cloudflare.com/client/v4/accounts/${account}/ai/catalog/models/${id}/schema`,
|
||||
{ headers: { Authorization: `Bearer ${token}` } },
|
||||
);
|
||||
if (!res.ok) return undefined; // treat missing schema as "not derivable"
|
||||
return ((await res.json()) as any).result?.schema?.input;
|
||||
}
|
||||
|
||||
// Read the `reasoning` flag from a base lab file (models/<base>.toml). A base model that
|
||||
// declares reasoning=true MUST carry reasoning_options in the provider file (schema validates
|
||||
// this), so we hard-fail when neither the catalog schema nor curation can supply them.
|
||||
function baseReasoning(base: string): boolean {
|
||||
const p = path.join(MODELS_ROOT, `${base}.toml`);
|
||||
if (!existsSync(p)) return false;
|
||||
return (Bun.TOML.parse(readFileSync(p, "utf8")) as any).reasoning === true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Pricing → cost
|
||||
// ---------------------------------------------------------------------------
|
||||
const FLAT_KEYS: Record<string, string> = {
|
||||
"Input tokens (per 1M)": "input",
|
||||
"Output tokens (per 1M)": "output",
|
||||
"Cached input tokens (per 1M)": "cache_read",
|
||||
"Cache creation tokens (per 1M)": "cache_write",
|
||||
};
|
||||
const TIER_RE = /^(Input|Output|Cached input)\s*(<=?|>=?)\s*(\d+)k\s*\(per 1M\)$/;
|
||||
const TIER_FIELD: Record<string, string> = {
|
||||
Input: "input",
|
||||
Output: "output",
|
||||
"Cached input": "cache_read",
|
||||
};
|
||||
|
||||
function proxiedCost(pricing: Record<string, number>, id: string, warnings: string[]) {
|
||||
const base: Record<string, number> = {};
|
||||
for (const [key, value] of Object.entries(pricing)) {
|
||||
if (FLAT_KEYS[key]) {
|
||||
base[FLAT_KEYS[key]] = value;
|
||||
continue;
|
||||
}
|
||||
const m = key.match(TIER_RE);
|
||||
if (m) {
|
||||
const [, label, op] = m;
|
||||
const field = TIER_FIELD[label!]!;
|
||||
// Cloudflare AI Gateway entries don't carry tiered pricing (unsupported here). Fold the
|
||||
// lower/default-context band (op "<") into the flat rate and drop the higher-context bands.
|
||||
if (op!.startsWith("<")) base[field] = value;
|
||||
continue;
|
||||
}
|
||||
warnings.push(`${id}: unmapped pricing key "${key}"`);
|
||||
}
|
||||
return { ...base };
|
||||
}
|
||||
|
||||
// Derive reasoning_options from a docs schema.input by walking every named property.
|
||||
function deriveReasoningOptions(schemaInput: unknown): Array<Record<string, unknown>> {
|
||||
let hasToggle = false;
|
||||
let effortValues: string[] | undefined;
|
||||
|
||||
const visit = (node: unknown) => {
|
||||
if (Array.isArray(node)) {
|
||||
node.forEach(visit);
|
||||
return;
|
||||
}
|
||||
if (!node || typeof node !== "object") return;
|
||||
for (const [key, value] of Object.entries(node as Record<string, unknown>)) {
|
||||
if (key === "properties" && value && typeof value === "object") {
|
||||
for (const [propName, propSchema] of Object.entries(value as Record<string, any>)) {
|
||||
if (propName === "enable_thinking" || propName === "thinking") hasToggle = true;
|
||||
if (propName === "effort" || propName === "reasoning_effort") {
|
||||
let enumVals: string[] | undefined = propSchema?.enum;
|
||||
if (!enumVals) {
|
||||
for (const branch of [...(propSchema?.anyOf ?? []), ...(propSchema?.oneOf ?? [])]) {
|
||||
if (Array.isArray(branch?.enum)) enumVals = branch.enum;
|
||||
}
|
||||
}
|
||||
if (enumVals) effortValues = enumVals;
|
||||
}
|
||||
visit(propSchema);
|
||||
}
|
||||
} else {
|
||||
visit(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
visit(schemaInput);
|
||||
|
||||
const opts: Array<Record<string, unknown>> = [];
|
||||
if (hasToggle) opts.push({ type: "toggle" });
|
||||
if (effortValues) opts.push({ type: "effort", values: effortValues });
|
||||
return opts;
|
||||
}
|
||||
|
||||
// Prepend curated leading `#` comment lines (a toggle/effort wire-path note, a source
|
||||
// citation, etc.) above the generated content. AGENTS.md requires one for every `toggle`
|
||||
// reasoning option since sync strips mid-file comments on every regeneration.
|
||||
function withNote(note: string[] | undefined, content: string): string {
|
||||
if (!note || note.length === 0) return content;
|
||||
return `${note.map((line) => `# ${line}`).join("\n")}\n\n${content}`;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// base_model resolution
|
||||
// ---------------------------------------------------------------------------
|
||||
function labFileExists(id: string): boolean {
|
||||
return existsSync(path.join(MODELS_ROOT, `${id}.toml`));
|
||||
}
|
||||
function autoResolveBase(catalogId: string): string | null {
|
||||
if (labFileExists(catalogId)) return catalogId;
|
||||
const dashed = catalogId.replace(/\./g, "-");
|
||||
if (labFileExists(dashed)) return dashed;
|
||||
return null;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Main
|
||||
// ---------------------------------------------------------------------------
|
||||
function walkToml(dir: string): string[] {
|
||||
if (!existsSync(dir)) return [];
|
||||
return readdirSync(dir).flatMap((e) => {
|
||||
const p = path.join(dir, e);
|
||||
return statSync(p).isDirectory() ? walkToml(p) : p.endsWith(".toml") ? [p] : [];
|
||||
});
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const check = process.argv.includes("--check");
|
||||
|
||||
const parsed = Curation.safeParse(Bun.TOML.parse(readFileSync(CURATION_PATH, "utf8")));
|
||||
if (!parsed.success) {
|
||||
console.error("Invalid curation.toml:", parsed.error.issues);
|
||||
process.exit(1);
|
||||
}
|
||||
const curation = parsed.data;
|
||||
const skip = new Set(curation.skip);
|
||||
const errors: string[] = [];
|
||||
const warnings: string[] = [];
|
||||
|
||||
const proxied = await loadProxied();
|
||||
const proxiedTextGen = proxied.filter((m) => m.task === TEXT_GENERATION);
|
||||
|
||||
const wanted = new Map<string, string>(); // absolute path -> content
|
||||
|
||||
// Fetch per-model schemas up front for the proxied models we'll actually emit, with bounded
|
||||
// concurrency so the catalog/docs endpoints don't rate-limit us.
|
||||
const proxiedEmit = proxiedTextGen.filter((m) => !skip.has(m.model_id));
|
||||
const schemaInputs = new Map<string, unknown>();
|
||||
await mapLimit(proxiedEmit, 6, async (m) => {
|
||||
schemaInputs.set(m.model_id, await loadCatalogSchemaInput(m.model_id));
|
||||
});
|
||||
|
||||
// --- proxied models ---
|
||||
for (const m of proxiedTextGen) {
|
||||
const id: string = m.model_id;
|
||||
if (skip.has(id)) continue;
|
||||
const cur = curation.models[id] ?? {};
|
||||
const base = cur.base_model ?? autoResolveBase(id);
|
||||
if (!base) {
|
||||
errors.push(`proxied ${id}: no lab file and no curation base_model (add to skip or map it)`);
|
||||
continue;
|
||||
}
|
||||
// name/description are inherited from base_model (models.dev's canonical copy);
|
||||
// the catalog only carries Cloudflare's own casing/marketing variants.
|
||||
const model: Record<string, unknown> = { base_model: base };
|
||||
if (cur.structured_output !== undefined) model.structured_output = cur.structured_output;
|
||||
if (cur.interleaved !== undefined) model.interleaved = cur.interleaved;
|
||||
|
||||
// reasoning_options: only meaningful when the base actually reasons. The catalog schema
|
||||
// advertises reasoning_effort for some non-reasoning models (gpt-4.1, gpt-4o) — schema
|
||||
// acceptance is not capability, so gate on the base's reasoning flag. When the base does
|
||||
// reason, prefer the per-model catalog schema, then curation, and fail loudly if neither
|
||||
// supplies a shape (the schema requires reasoning_options whenever reasoning=true).
|
||||
if (baseReasoning(base)) {
|
||||
const derivedRo = deriveReasoningOptions(schemaInputs.get(id));
|
||||
if (cur.reasoning_options !== undefined) model.reasoning_options = cur.reasoning_options;
|
||||
else if (derivedRo.length > 0) model.reasoning_options = derivedRo;
|
||||
else {
|
||||
errors.push(
|
||||
`proxied ${id}: base ${base} has reasoning=true but no reasoning_options ` +
|
||||
`(catalog schema exposes none; add reasoning_options to curation.toml)`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
const cost = proxiedCost(m.pricing ?? {}, id, warnings);
|
||||
if (Object.keys(cost).length === 0) errors.push(`proxied ${id}: catalog pricing empty`);
|
||||
model.cost = cost;
|
||||
|
||||
// limit.output: the catalog's max_output_tokens is not a reliable ceiling — verified wrong
|
||||
// against lab/first-party for gpt-5, gpt-5.5, and claude-haiku-4.5 (all understated by
|
||||
// 4-8x). Only context_length has checked out, so that's all we auto-derive; output is
|
||||
// either curated explicitly or left to inherit from base_model.
|
||||
const limit: Record<string, number> = {};
|
||||
if (m.context_length != null) limit.context = m.context_length;
|
||||
if (cur.limit) Object.assign(limit, cur.limit); // curation overrides/adds (e.g. served output)
|
||||
if (Object.keys(limit).length) model.limit = limit;
|
||||
|
||||
const npm = nativeNpm(id);
|
||||
if (npm) model.provider = { npm };
|
||||
|
||||
wanted.set(path.join(MODELS_DIR, `${id}.toml`), withNote(cur.note, formatToml(model as any)));
|
||||
}
|
||||
|
||||
// Guards: a curation model id that no longer appears in the live feed (warn only).
|
||||
const liveIds = new Set<string>(proxiedTextGen.map((m) => m.model_id));
|
||||
for (const id of Object.keys(curation.models)) {
|
||||
if (!liveIds.has(id)) warnings.push(`curation id not in live feed: ${id}`);
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
console.error("Errors:\n" + errors.map((e) => ` - ${e}`).join("\n"));
|
||||
process.exit(1);
|
||||
}
|
||||
for (const w of warnings) console.warn(`warning: ${w}`);
|
||||
|
||||
const existing = new Set(walkToml(MODELS_DIR));
|
||||
const wantedPaths = new Set(wanted.keys());
|
||||
const toRemove = [...existing].filter((p) => !wantedPaths.has(p));
|
||||
|
||||
if (check) {
|
||||
let changed = 0;
|
||||
for (const [p, content] of wanted) {
|
||||
const cur = existing.has(p) ? readFileSync(p, "utf8") : undefined;
|
||||
if (cur !== content) { console.error(`would change: ${path.relative(MODELS_DIR, p)}`); changed++; }
|
||||
}
|
||||
for (const p of toRemove) { console.error(`would remove: ${path.relative(MODELS_DIR, p)}`); changed++; }
|
||||
if (changed > 0) { console.error(`--check: ${changed} file(s) out of date`); process.exit(1); }
|
||||
console.log("--check: up to date");
|
||||
return;
|
||||
}
|
||||
|
||||
let changed = 0;
|
||||
for (const [p, content] of wanted) {
|
||||
const cur = existing.has(p) ? readFileSync(p, "utf8") : undefined;
|
||||
if (cur !== content) { await Bun.write(p, content); changed++; }
|
||||
}
|
||||
for (const p of toRemove) { rmSync(p); changed++; }
|
||||
|
||||
console.log(
|
||||
`cloudflare-ai-gateway: ${wanted.size} proxied model(s) ` +
|
||||
`(${changed} written/removed, ${skip.size} skipped, ${warnings.length} warning(s)).`,
|
||||
);
|
||||
}
|
||||
|
||||
await main();
|
||||
@@ -180,6 +180,9 @@ function reasoningOptions(model: CrossModelModel): SyncedModel["reasoning_option
|
||||
if (reasoning.budget_tokens.max !== undefined) budget.max = reasoning.budget_tokens.max;
|
||||
options.push(budget);
|
||||
}
|
||||
if (options.some((option) => option.type === "effort" && option.values.includes("none"))) {
|
||||
return options.filter((option) => option.type !== "toggle");
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from "node:path";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
import type { SyncProvider, SyncedFullModel, SyncedModel } from "../index.js";
|
||||
import type { ExistingModel, SyncProvider, SyncedFullModel, SyncedModel } from "../index.js";
|
||||
import {
|
||||
factorBaseModel,
|
||||
modelMetadata,
|
||||
@@ -230,10 +230,10 @@ function regionVariantName(model: EdenAIModel, baseModel: string) {
|
||||
// Reasoning options
|
||||
// ========================================
|
||||
|
||||
// Eden AI's only reasoning control is `reasoning_effort`, so a model is
|
||||
// published with the effort list its lab entry (or an established relay peer)
|
||||
// already documents. Peers exposing only `toggle` / `budget_tokens` have no
|
||||
// equivalent here, and those models are skipped rather than given a guess.
|
||||
// This sync currently maps only `reasoning_effort`, using the effort list the
|
||||
// lab entry (or an established relay peer) documents. Toggle / budget controls
|
||||
// need route-specific mappings. Preserve authored controls when unresolved;
|
||||
// skip new models rather than inventing an empty control set.
|
||||
function effortValues(options: unknown): string[] | "always-on" | undefined {
|
||||
if (!Array.isArray(options)) return undefined;
|
||||
if (options.length === 0) return "always-on";
|
||||
@@ -425,6 +425,7 @@ function mapModalities(values: readonly string[] | null | undefined) {
|
||||
|
||||
export function buildEdenAIModel(
|
||||
model: EdenAIModel,
|
||||
existing?: ExistingModel,
|
||||
firstParty: ReadonlySet<string> = firstPartyBaseModels,
|
||||
): SyncedModel | undefined {
|
||||
const baseModel = resolveEdenAIBaseModel(model);
|
||||
@@ -449,7 +450,7 @@ export function buildEdenAIModel(
|
||||
// the lab entry owns it and only the effort controls are authored here.
|
||||
const reasoning = modelMetadata(baseModel).reasoning === true;
|
||||
const reasoningOptions = reasoning
|
||||
? reasoningOptionsFor(baseModel)
|
||||
? reasoningOptionsFor(baseModel) ?? existing?.reasoning_options
|
||||
: undefined;
|
||||
if (reasoning && reasoningOptions === undefined) return undefined;
|
||||
|
||||
@@ -494,12 +495,24 @@ export const edenai = {
|
||||
return response.json();
|
||||
},
|
||||
parseModels(raw) {
|
||||
const models = EdenAIResponse.parse(raw).data;
|
||||
const unique = new Map<string, EdenAIModel>();
|
||||
for (const model of EdenAIResponse.parse(raw).data) {
|
||||
const key = model.id.toLowerCase();
|
||||
const previous = unique.get(key);
|
||||
// Eden AI publishes case-only duplicates that collide on macOS. Keep the
|
||||
// lowercase API ID, but retain context metadata supplied by its duplicate.
|
||||
const preferred = model.id === key ? model : previous ?? model;
|
||||
unique.set(key, {
|
||||
...preferred,
|
||||
context_length: preferred.context_length ?? previous?.context_length ?? model.context_length,
|
||||
});
|
||||
}
|
||||
const models = [...unique.values()];
|
||||
firstPartyBaseModels = collectFirstPartyBaseModels(models);
|
||||
return models;
|
||||
},
|
||||
translateModel(model) {
|
||||
const built = buildEdenAIModel(model);
|
||||
translateModel(model, context) {
|
||||
const built = buildEdenAIModel(model, context.existing(model.id));
|
||||
if (built === undefined) return undefined;
|
||||
return { id: model.id, model: built };
|
||||
},
|
||||
|
||||
@@ -191,6 +191,9 @@ function reasoningOptions(model: EmpiriolabsModel): SyncedModel["reasoning_optio
|
||||
if (budget.max !== undefined) option.max = budget.max;
|
||||
options.push(option);
|
||||
}
|
||||
if (options.some((option) => option.type === "effort" && option.values.includes("none"))) {
|
||||
return options.filter((option) => option.type !== "toggle");
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,14 @@ export const mergeGateway = {
|
||||
translateModel(model, context) {
|
||||
const existing = context.existing(model.model);
|
||||
const translated = buildMergeGatewayModel(model, existing, context.authored(model.model));
|
||||
return translated === undefined ? undefined : { id: model.model, model: translated };
|
||||
return translated === undefined ? undefined : {
|
||||
id: model.model,
|
||||
model: translated,
|
||||
header: translated.reasoning_options?.some((option) => option.type === "toggle")
|
||||
&& translated.reasoning_options.some((option) => option.type === "budget_tokens")
|
||||
? '# Toggle: thinking.type = "enabled"|"disabled"; enabled requires thinking.budget_tokens.\n# https://docs.merge.dev/merge-gateway/features/reasoning\n'
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
} satisfies SyncProvider<MergeGatewayModel>;
|
||||
|
||||
@@ -181,6 +188,10 @@ export function mergeGatewayReasoningOptions(
|
||||
options.push({ type: "effort" as const, values: [...effortValues] });
|
||||
}
|
||||
|
||||
if (controls.includes("thinking.budget_tokens")) {
|
||||
options.push({ type: "budget_tokens" });
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ const CANONICAL_PROVIDER_PREFIXES = {
|
||||
thinkingmachines: { provider: "thinkingmachines", metadata: "thinkingmachines" },
|
||||
"x-ai": { provider: "xai", metadata: "xai" },
|
||||
xai: { provider: "xai", metadata: "xai" },
|
||||
spacexai: { provider: "xai", metadata: "xai" },
|
||||
xiaomi: { provider: "xiaomi", metadata: "xiaomi" },
|
||||
zai: { provider: "zai", metadata: "zhipuai" },
|
||||
"z-ai": { provider: "zai", metadata: "zhipuai" },
|
||||
@@ -127,9 +128,13 @@ export const openrouter = {
|
||||
const authored = context.authored(model.id);
|
||||
return authored === undefined ? undefined : { id: model.id, model: authored as SyncedModel };
|
||||
}
|
||||
const translated = buildOpenRouterModel(model, context.existing(model.id));
|
||||
return {
|
||||
id: model.id,
|
||||
model: buildOpenRouterModel(model, context.existing(model.id)),
|
||||
model: translated,
|
||||
header: translated.reasoning_options?.some((option) => option.type === "toggle")
|
||||
? "# Toggle: reasoning.enabled = true|false\n# https://openrouter.ai/docs/guides/best-practices/reasoning-tokens\n"
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
} satisfies SyncProvider<OpenRouterModel>;
|
||||
@@ -214,8 +219,9 @@ export function buildOpenRouterModel(
|
||||
// Prefer OpenRouter's live reasoning metadata over authored options so aliases
|
||||
// and rotated models pick up new efforts/budget support. Fall back to authored
|
||||
// only when the API omits a reasoning object.
|
||||
const reasoning_options = openRouterReasoningOptions(model.reasoning)
|
||||
?? (reasoning ? existing?.reasoning_options : undefined);
|
||||
const reasoning_options = reasoning
|
||||
? openRouterReasoningOptions(model.reasoning) ?? existing?.reasoning_options
|
||||
: undefined;
|
||||
const context = model.context_length;
|
||||
const family = inferFamily(model, name);
|
||||
const releaseDate = dateFromTimestamp(model.created);
|
||||
@@ -320,10 +326,11 @@ function openRouterReasoningOptions(reasoning: OpenRouterModel["reasoning"]): Sy
|
||||
? ["max", "xhigh", "high", "medium", "low", "minimal", "none"] as const
|
||||
: reasoning.supported_efforts;
|
||||
|
||||
if (!reasoning.mandatory && !efforts?.includes("none")) {
|
||||
options.push({ type: "toggle" });
|
||||
}
|
||||
|
||||
if (efforts !== undefined) {
|
||||
if (!reasoning.mandatory && !efforts.includes("none")) {
|
||||
options.push({ type: "toggle" });
|
||||
}
|
||||
options.push({
|
||||
type: "effort",
|
||||
values: reasoning.mandatory ? efforts.filter((value) => value !== "none") : [...efforts],
|
||||
|
||||
@@ -88,6 +88,9 @@ export function buildTinfoilModel(
|
||||
if (existing.cost === undefined || existing.limit?.context === undefined) {
|
||||
throw new Error(`Tinfoil model ${model.id} has incomplete local pricing or limits required for sync`);
|
||||
}
|
||||
if (model.reasoning && existing.reasoning_options === undefined) {
|
||||
throw new Error(`Tinfoil model ${model.id} requires hand-authored reasoning_options; the catalog exposes no reasoning controls`);
|
||||
}
|
||||
|
||||
const { base_model: baseModel, base_model_omit: baseModelOmit, ...current } = existing;
|
||||
const cost = {
|
||||
@@ -102,6 +105,8 @@ export function buildTinfoilModel(
|
||||
};
|
||||
const values = {
|
||||
...current,
|
||||
reasoning: model.reasoning,
|
||||
reasoning_options: model.reasoning ? existing.reasoning_options : undefined,
|
||||
cost,
|
||||
limit,
|
||||
} as SyncedFullModel;
|
||||
|
||||
@@ -145,7 +145,9 @@ export function buildVercelModel(
|
||||
last_updated: existing?.last_updated ?? releaseDate,
|
||||
attachment: existing?.attachment ?? (tags.has("vision") || tags.has("file-input")),
|
||||
reasoning: existing?.reasoning ?? tags.has("reasoning"),
|
||||
reasoning_options: existing?.reasoning_options ?? base?.reasoning_options,
|
||||
reasoning_options: existing?.reasoning_options?.length
|
||||
? existing.reasoning_options
|
||||
: base?.reasoning_options,
|
||||
temperature: existing?.temperature,
|
||||
tool_call: model.type === "language"
|
||||
? existing?.tool_call ?? tags.has("tool-use")
|
||||
|
||||
@@ -1,6 +1,51 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { resolveEmpiriolabsBaseModel } from "../src/sync/providers/empiriolabs.js";
|
||||
import { buildEmpiriolabsModel, resolveEmpiriolabsBaseModel } from "../src/sync/providers/empiriolabs.js";
|
||||
|
||||
test.each([
|
||||
{
|
||||
name: "toggle-only",
|
||||
parameters: [{ name: "enable_thinking" }],
|
||||
expected: [{ type: "toggle" }],
|
||||
},
|
||||
{
|
||||
name: "toggle and effort without none",
|
||||
parameters: [
|
||||
{ name: "enable_thinking" },
|
||||
{ name: "reasoning_effort", options: ["low", "high"] },
|
||||
],
|
||||
expected: [{ type: "toggle" }, { type: "effort", values: ["low", "high"] }],
|
||||
},
|
||||
{
|
||||
name: "effort with none instead of a redundant toggle",
|
||||
parameters: [
|
||||
{ name: "enable_thinking" },
|
||||
{ name: "reasoning_effort", options: ["none", "low", "high"] },
|
||||
],
|
||||
expected: [{ type: "effort", values: ["none", "low", "high"] }],
|
||||
},
|
||||
{
|
||||
name: "effort with none preserves the reasoning budget",
|
||||
parameters: [
|
||||
{ name: "enable_thinking" },
|
||||
{ name: "reasoning_effort", options: ["none", "low", "high"] },
|
||||
{ name: "thinking_budget", min: 1_024, max: 32_768 },
|
||||
],
|
||||
expected: [
|
||||
{ type: "effort", values: ["none", "low", "high"] },
|
||||
{ type: "budget_tokens", min: 1_024, max: 32_768 },
|
||||
],
|
||||
},
|
||||
])("syncs EmpirioLabs reasoning controls: $name", ({ parameters, expected }) => {
|
||||
const model = buildEmpiriolabsModel({
|
||||
id: "qwen3-5-9b",
|
||||
context_length: 262_144,
|
||||
capabilities: { reasoning: true },
|
||||
supported_parameters: parameters,
|
||||
}, undefined);
|
||||
|
||||
expect(model?.reasoning_options).toEqual(expected);
|
||||
});
|
||||
|
||||
test("resolves existing lab metadata without a hardcoded map", () => {
|
||||
expect(resolveEmpiriolabsBaseModel("muse-glimmer-30b")).toBe("meta/muse-glimmer-30b");
|
||||
|
||||
+322
-11
@@ -32,6 +32,7 @@ import {
|
||||
import {
|
||||
buildEdenAIModel,
|
||||
collectFirstPartyBaseModels,
|
||||
edenai,
|
||||
reasoningOptionsFor,
|
||||
resolveEdenAIBaseModel,
|
||||
type EdenAIModel,
|
||||
@@ -473,7 +474,13 @@ test("parses CrossModel's nullable reasoning controls", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("syncs CrossModel's explicit reasoning controls", () => {
|
||||
test("preserves CrossModel's toggle-only reasoning control", () => {
|
||||
const model = buildCrossModel(crossModelModel(), undefined);
|
||||
expect(model?.reasoning_options).toEqual([{ type: "toggle" }]);
|
||||
});
|
||||
|
||||
test.each([{ off: false }, { off: true }])("syncs CrossModel's reasoning controls (effort includes none: $off)", ({ off }) => {
|
||||
const effort = off ? ["none", "low", "high", "max"] as const : ["low", "high", "max"] as const;
|
||||
const model = buildCrossModel(
|
||||
crossModelModel({
|
||||
capabilities: {
|
||||
@@ -481,7 +488,7 @@ test("syncs CrossModel's explicit reasoning controls", () => {
|
||||
reasoning: {
|
||||
supported: true,
|
||||
toggle: true,
|
||||
effort: ["low", "high", "max"],
|
||||
effort: [...effort],
|
||||
budget_tokens: { min: 1_024, max: 32_000 },
|
||||
},
|
||||
},
|
||||
@@ -491,8 +498,8 @@ test("syncs CrossModel's explicit reasoning controls", () => {
|
||||
|
||||
expect(model).toMatchObject({
|
||||
reasoning_options: [
|
||||
{ type: "toggle" },
|
||||
{ type: "effort", values: ["low", "high", "max"] },
|
||||
...off ? [] : [{ type: "toggle" }],
|
||||
{ type: "effort", values: effort },
|
||||
{ type: "budget_tokens", min: 1_024, max: 32_000 },
|
||||
],
|
||||
});
|
||||
@@ -1223,6 +1230,31 @@ test("syncs Tinfoil cached-input pricing from the public model catalog", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test.each([undefined, "zhipuai/glm-5.2"])("syncs Tinfoil reasoning with base model %s", (base_model) => {
|
||||
const existing = { ...existingTinfoilGLM, base_model };
|
||||
const enabled = buildTinfoilModel(tinfoilModel(), { ...existing, reasoning: false });
|
||||
expect(enabled.reasoning_options).toEqual(existing.reasoning_options);
|
||||
// Factored models inherit true from the lab; standalone models must author it.
|
||||
expect(enabled.reasoning).toBe(base_model === undefined ? true : undefined);
|
||||
|
||||
const disabled = buildTinfoilModel(tinfoilModel({ reasoning: false }), existing);
|
||||
expect(disabled.reasoning).toBe(false);
|
||||
expect(disabled.reasoning_options).toBeUndefined();
|
||||
});
|
||||
|
||||
test("requires authored Tinfoil controls instead of inventing an empty set", () => {
|
||||
expect(() => buildTinfoilModel(tinfoilModel(), {
|
||||
...existingTinfoilGLM,
|
||||
reasoning_options: undefined,
|
||||
})).toThrow("requires hand-authored reasoning_options");
|
||||
|
||||
const model = buildTinfoilModel(tinfoilModel(), {
|
||||
...existingTinfoilGLM,
|
||||
reasoning_options: [],
|
||||
});
|
||||
expect(model.reasoning_options).toEqual([]);
|
||||
});
|
||||
|
||||
test("removes stale Tinfoil cache pricing when the public catalog omits it", () => {
|
||||
const model = buildTinfoilModel(tinfoilModel({
|
||||
pricing: {
|
||||
@@ -2318,6 +2350,32 @@ test("factors new Hyper models against unique models/ metadata", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("deduplicates Eden AI case-only IDs without losing context metadata", () => {
|
||||
const lowercase = edenAIModel({
|
||||
id: "flexai/deepseek-v4-flash-0731",
|
||||
model_name: "deepseek-v4-flash-0731",
|
||||
owned_by: "flexai",
|
||||
context_length: null,
|
||||
});
|
||||
const uppercase = edenAIModel({
|
||||
...lowercase,
|
||||
id: "flexai/DeepSeek-V4-Flash-0731",
|
||||
model_name: "DeepSeek-V4-Flash-0731",
|
||||
context_length: 786_432,
|
||||
});
|
||||
|
||||
for (const data of [[lowercase, uppercase], [uppercase, lowercase]]) {
|
||||
const models = edenai.parseModels({ object: "list", data });
|
||||
expect(models).toEqual([{ ...lowercase, context_length: 786_432 }]);
|
||||
expect(edenai.translateModel(models[0]!, { existing: () => undefined, authored: () => undefined })).toMatchObject({
|
||||
id: lowercase.id,
|
||||
model: { base_model: "deepseek/deepseek-v4-flash-0731", limit: { context: 786_432 } },
|
||||
});
|
||||
}
|
||||
|
||||
expect(edenai.parseModels({ object: "list", data: [uppercase] })).toEqual([uppercase]);
|
||||
});
|
||||
|
||||
test("factors Eden AI models onto lab metadata and prices from list_pricing", () => {
|
||||
const model = edenAIModel({
|
||||
id: "openai/gpt-5.6-terra",
|
||||
@@ -2350,9 +2408,8 @@ test("takes Eden AI reasoning options from the model's own lab entry", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
test("skips Eden AI models whose reasoning control has no effort equivalent", () => {
|
||||
// Lab and OpenRouter both expose these through budget_tokens, which Eden AI
|
||||
// has no request field for.
|
||||
test("skips new Eden AI models whose reasoning control has no effort equivalent", () => {
|
||||
// The sync does not yet map this route's budget control to Eden AI's API.
|
||||
expect(reasoningOptionsFor("google/gemini-2.5-pro")).toBeUndefined();
|
||||
expect(
|
||||
buildEdenAIModel(
|
||||
@@ -2365,6 +2422,102 @@ test("skips Eden AI models whose reasoning control has no effort equivalent", ()
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
test("Eden AI preserves authored controls when reasoning mapping is unresolved", () => {
|
||||
const authored: NonNullable<ExistingModel["reasoning_options"]>[] = [
|
||||
[],
|
||||
[{ type: "toggle" }],
|
||||
[{ type: "effort", values: ["high"] }],
|
||||
[{ type: "toggle" }, { type: "budget_tokens" }],
|
||||
];
|
||||
for (const [id, base] of [
|
||||
["zai/glm-5", "zhipuai/glm-5"],
|
||||
["moonshot/kimi-k2.6", "moonshotai/kimi-k2.6"],
|
||||
["minimax/MiniMax-M3", "minimax/MiniMax-M3"],
|
||||
["deepinfra/nvidia/Nemotron-3-Nano-30B-A3B", "nvidia/nemotron-3-nano-30b-a3b"],
|
||||
["google/gemini-2.5-pro", "google/gemini-2.5-pro"],
|
||||
] as const) {
|
||||
const model = edenAIModel({
|
||||
id,
|
||||
owned_by: id.slice(0, id.indexOf("/")),
|
||||
model_name: id.slice(id.indexOf("/") + 1),
|
||||
});
|
||||
expect(buildEdenAIModel(model)).toBeUndefined();
|
||||
for (const reasoning_options of authored) {
|
||||
expect(buildEdenAIModel(model, { base_model: base, reasoning_options })).toMatchObject({
|
||||
base_model: base,
|
||||
reasoning_options,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("Eden AI sync keeps listed models with unresolved reasoning controls", async () => {
|
||||
const root = await mkdtemp(path.join(tmpdir(), "sync-edenai-"));
|
||||
const modelsDir = path.join(root, "providers", "edenai", "models");
|
||||
const repo = path.join(import.meta.dirname, "..", "..", "..");
|
||||
const files = [
|
||||
["openai/gpt-4o-mini", "openai/gpt-4o-mini"],
|
||||
["zai/glm-5", "zhipuai/glm-5"],
|
||||
["retired/model", "openai/gpt-4o-mini"],
|
||||
] as const;
|
||||
|
||||
try {
|
||||
for (const [id, base] of files) {
|
||||
const destination = path.join(modelsDir, `${id}.toml`);
|
||||
const metadata = path.join(root, "models", `${base}.toml`);
|
||||
await mkdir(path.dirname(destination), { recursive: true });
|
||||
await mkdir(path.dirname(metadata), { recursive: true });
|
||||
await copyFile(path.join(repo, "models", `${base}.toml`), metadata);
|
||||
await copyFile(
|
||||
path.join(repo, "providers", "edenai", "models", `${id === "retired/model" ? "openai/gpt-4o-mini" : id}.toml`),
|
||||
destination,
|
||||
);
|
||||
}
|
||||
const glmPath = path.join(modelsDir, "zai/glm-5.toml");
|
||||
const authored = (await readFile(glmPath, "utf8")).replace(
|
||||
"reasoning_options = []",
|
||||
'reasoning_options = [{ type = "toggle" }]',
|
||||
);
|
||||
const header = "# Toggle: extra_body.thinking.type = enabled|disabled\n";
|
||||
await Bun.write(glmPath, header + authored);
|
||||
const supported = edenAIModel({
|
||||
id: "openai/gpt-4o-mini",
|
||||
model_name: "gpt-4o-mini",
|
||||
owned_by: "openai",
|
||||
list_pricing: { input_cost_per_token: 0.000123, output_cost_per_token: 0.000456 },
|
||||
});
|
||||
const unresolved = edenAIModel({ id: "zai/glm-5", model_name: "glm-5", owned_by: "zai" });
|
||||
const provider = {
|
||||
...edenai,
|
||||
modelsDir,
|
||||
async fetchModels() {
|
||||
return { object: "list", data: [
|
||||
supported,
|
||||
{ ...supported, id: "openai/gpt-4o-mini@us" },
|
||||
unresolved,
|
||||
{ ...unresolved, id: "zai/glm-5@us" },
|
||||
] };
|
||||
},
|
||||
};
|
||||
|
||||
const result = await syncProvider(provider);
|
||||
expect(result).toMatchObject({ created: 1, deleted: 1 });
|
||||
expect(result.files.filter((file) => file.status === "deleted").map((file) => file.path)).toEqual([
|
||||
path.join(modelsDir, "retired/model.toml"),
|
||||
]);
|
||||
const content = await readFile(glmPath, "utf8");
|
||||
expect(content).toStartWith(header);
|
||||
expect(Bun.TOML.parse(content)).toMatchObject({
|
||||
base_model: "zhipuai/glm-5",
|
||||
reasoning_options: [{ type: "toggle" }],
|
||||
});
|
||||
expect(await Bun.file(path.join(modelsDir, "zai/glm-5@us.toml")).exists()).toBe(false);
|
||||
expect(await Bun.file(path.join(modelsDir, "openai/gpt-4o-mini@us.toml")).exists()).toBe(true);
|
||||
} finally {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
test("omits Eden AI reasoning options for non-reasoning models", () => {
|
||||
const model = edenAIModel({
|
||||
id: "openai/gpt-4o-mini",
|
||||
@@ -2446,8 +2599,8 @@ test("keeps only the first-party Eden AI route when the lab's own API is relayed
|
||||
|
||||
const firstParty = collectFirstPartyBaseModels([bedrock, direct]);
|
||||
expect(firstParty).toEqual(new Set(["anthropic/claude-opus-5"]));
|
||||
expect(buildEdenAIModel(bedrock, firstParty)).toBeUndefined();
|
||||
expect(buildEdenAIModel(direct, firstParty)).toMatchObject({
|
||||
expect(buildEdenAIModel(bedrock, undefined, firstParty)).toBeUndefined();
|
||||
expect(buildEdenAIModel(direct, undefined, firstParty)).toMatchObject({
|
||||
base_model: "anthropic/claude-opus-5",
|
||||
});
|
||||
});
|
||||
@@ -2464,7 +2617,7 @@ test("keeps every Eden AI route for models with no first-party relay", () => {
|
||||
const firstParty = collectFirstPartyBaseModels(models);
|
||||
expect(firstParty.size).toBe(0);
|
||||
for (const model of models) {
|
||||
expect(buildEdenAIModel(model, firstParty)).toMatchObject({
|
||||
expect(buildEdenAIModel(model, undefined, firstParty)).toMatchObject({
|
||||
base_model: "openai/gpt-oss-120b",
|
||||
});
|
||||
}
|
||||
@@ -2763,6 +2916,45 @@ test("syncs OpenRouter reasoning efforts from model metadata", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("syncs OpenRouter toggles without an effort selector", () => {
|
||||
for (const supports_max_tokens of [undefined, true]) {
|
||||
const source = openRouterModel({
|
||||
reasoning: { mandatory: false, supports_max_tokens },
|
||||
});
|
||||
const translated = openrouter.translateModel(source, {
|
||||
existing: () => undefined,
|
||||
authored: () => undefined,
|
||||
});
|
||||
expect(translated?.model.reasoning_options).toEqual([
|
||||
{ type: "toggle" },
|
||||
...(supports_max_tokens ? [{ type: "budget_tokens" }] : []),
|
||||
]);
|
||||
expect(translated?.header).toStartWith("# Toggle: reasoning.enabled = true|false\n");
|
||||
}
|
||||
});
|
||||
|
||||
test("does not derive OpenRouter controls for non-reasoning models", () => {
|
||||
const model = buildOpenRouterModel(openRouterModel({
|
||||
supported_parameters: ["temperature"],
|
||||
reasoning: { mandatory: false, supports_max_tokens: true },
|
||||
}), { reasoning_options: [{ type: "toggle" }] });
|
||||
expect(model.reasoning).toBe(false);
|
||||
expect(model.reasoning_options).toBeUndefined();
|
||||
});
|
||||
|
||||
test("does not add OpenRouter toggles to mandatory or effort-none models", () => {
|
||||
for (const reasoning of [
|
||||
{ mandatory: true, supports_max_tokens: true },
|
||||
{ mandatory: true, supported_efforts: ["none", "high"] as const },
|
||||
{ mandatory: false, supported_efforts: ["none", "high"] as const },
|
||||
{ mandatory: false, supported_efforts: null },
|
||||
]) {
|
||||
const [source] = openrouter.parseModels({ data: [{ ...openRouterModel(), reasoning }] });
|
||||
const model = buildOpenRouterModel(source!, undefined);
|
||||
expect(model.reasoning_options?.some((option) => option.type === "toggle")).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
test("uses OpenRouter model context when top provider reports a shorter context", () => {
|
||||
const model = buildOpenRouterModel(openRouterModel({
|
||||
context_length: 1_048_576,
|
||||
@@ -2813,6 +3005,10 @@ test("factors OpenRouter Pro routes against canonical OpenAI metadata", () => {
|
||||
expect("release_date" in model).toBe(false);
|
||||
});
|
||||
|
||||
test("resolves SpaceXAI provider IDs to canonical xAI metadata", () => {
|
||||
expect(resolveCanonicalBaseModel("spacexai/grok-4.5")).toBe("xai/grok-4.5");
|
||||
});
|
||||
|
||||
// Ensures Merge Gateway namespaces reuse the matching canonical model metadata.
|
||||
test("resolves Merge Gateway provider aliases to canonical metadata", () => {
|
||||
expect([
|
||||
@@ -3651,6 +3847,56 @@ test("derives a Merge Gateway reasoning toggle when the selected route supports
|
||||
expect(model).toMatchObject({ reasoning_options: [{ type: "toggle" }] });
|
||||
});
|
||||
|
||||
test("syncs Merge Gateway explicitly advertised thinking budgets", () => {
|
||||
const selected = mergeGatewayVendor();
|
||||
selected.capabilities.supports_reasoning = true;
|
||||
selected.capabilities.reasoning = {
|
||||
configurable: true,
|
||||
disable_supported: true,
|
||||
default_enabled: false,
|
||||
controls: ["thinking.budget_tokens"],
|
||||
output_style: "reasoning_content",
|
||||
};
|
||||
const source = mergeGatewayModel({ vendors: { openai: selected } });
|
||||
const translated = mergeGateway.translateModel(source, {
|
||||
existing: () => ({ reasoning: true, reasoning_options: [] }),
|
||||
authored: () => undefined,
|
||||
});
|
||||
expect(translated?.model.reasoning_options).toEqual([
|
||||
{ type: "toggle" },
|
||||
{ type: "budget_tokens" },
|
||||
]);
|
||||
expect(translated?.header).toStartWith('# Toggle: thinking.type = "enabled"|"disabled"');
|
||||
|
||||
selected.capabilities.reasoning.disable_supported = false;
|
||||
expect(buildMergeGatewayModel(source, { reasoning: true })?.reasoning_options).toEqual([
|
||||
{ type: "budget_tokens" },
|
||||
]);
|
||||
});
|
||||
|
||||
test("does not infer Merge Gateway budgets from other controls or output limits", () => {
|
||||
for (const controls of [undefined, [], ["thinking"], ["max_tokens"], ["reasoning.effort"]]) {
|
||||
const selected = mergeGatewayVendor();
|
||||
selected.capabilities.reasoning = { configurable: true, controls };
|
||||
const model = buildMergeGatewayModel(mergeGatewayModel({ vendors: { openai: selected } }), {
|
||||
reasoning: true,
|
||||
reasoning_options: [],
|
||||
});
|
||||
expect(model?.reasoning_options).toEqual([]);
|
||||
}
|
||||
});
|
||||
|
||||
test("preserves curated Merge Gateway controls when a budget is advertised", () => {
|
||||
const selected = mergeGatewayVendor();
|
||||
selected.capabilities.reasoning = { controls: ["thinking.budget_tokens"] };
|
||||
const reasoning_options = [{ type: "effort" as const, values: ["high"] }];
|
||||
const model = buildMergeGatewayModel(mergeGatewayModel({ vendors: { openai: selected } }), {
|
||||
reasoning: true,
|
||||
reasoning_options,
|
||||
});
|
||||
expect(model?.reasoning_options).toEqual(reasoning_options);
|
||||
});
|
||||
|
||||
// Effort control yields toggle + effort, not a bare toggle (claude-opus-5 regression).
|
||||
test("derives Merge Gateway toggle + effort from an effort control", () => {
|
||||
const selected = mergeGatewayVendor({
|
||||
@@ -4066,6 +4312,72 @@ test("Vercel Claude Opus fast variants factor onto base opus metadata", () => {
|
||||
expect(synced).not.toHaveProperty("family");
|
||||
});
|
||||
|
||||
test("Vercel empty existing reasoning_options falls back to the route base menu", () => {
|
||||
const [model] = vercel.parseModels({
|
||||
data: [{
|
||||
id: "minimax/minimax-m2.7-free",
|
||||
name: "MiniMax M2.7 (Free)",
|
||||
created: 1_784_160_000,
|
||||
context_window: 200_000,
|
||||
max_tokens: 128_000,
|
||||
type: "language",
|
||||
tags: ["reasoning", "tool-use"],
|
||||
pricing: { input: "0", output: "0" },
|
||||
}],
|
||||
});
|
||||
|
||||
const translated = vercel.translateModel(model!, {
|
||||
existing(id) {
|
||||
if (id === "minimax/minimax-m2.7-free") return { reasoning_options: [] };
|
||||
if (id === "minimax/minimax-m2.7") {
|
||||
return { reasoning_options: [{ type: "effort", values: ["low", "high"] }] };
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
authored() {
|
||||
return undefined;
|
||||
},
|
||||
});
|
||||
|
||||
expect(translated?.model).toMatchObject({
|
||||
reasoning_options: [{ type: "effort", values: ["low", "high"] }],
|
||||
});
|
||||
});
|
||||
|
||||
test("Vercel preserves a non-empty existing reasoning_options over the base menu", () => {
|
||||
const [model] = vercel.parseModels({
|
||||
data: [{
|
||||
id: "minimax/minimax-m2.7-free",
|
||||
name: "MiniMax M2.7 (Free)",
|
||||
created: 1_784_160_000,
|
||||
context_window: 200_000,
|
||||
max_tokens: 128_000,
|
||||
type: "language",
|
||||
tags: ["reasoning", "tool-use"],
|
||||
pricing: { input: "0", output: "0" },
|
||||
}],
|
||||
});
|
||||
|
||||
const translated = vercel.translateModel(model!, {
|
||||
existing(id) {
|
||||
if (id === "minimax/minimax-m2.7-free") {
|
||||
return { reasoning_options: [{ type: "toggle" }] };
|
||||
}
|
||||
if (id === "minimax/minimax-m2.7") {
|
||||
return { reasoning_options: [{ type: "effort", values: ["low", "high"] }] };
|
||||
}
|
||||
return undefined;
|
||||
},
|
||||
authored() {
|
||||
return undefined;
|
||||
},
|
||||
});
|
||||
|
||||
expect(translated?.model).toMatchObject({
|
||||
reasoning_options: [{ type: "toggle" }],
|
||||
});
|
||||
});
|
||||
|
||||
test("OpenRouter Claude Opus fast variants factor onto base opus metadata", () => {
|
||||
const model = buildOpenRouterModel(openRouterModel({
|
||||
id: "anthropic/claude-opus-5-fast",
|
||||
@@ -4241,7 +4553,6 @@ test("syncs EmpirioLabs pricing tiers and reasoning controls", () => {
|
||||
base_model: "minimax/MiniMax-M3",
|
||||
structured_output: true,
|
||||
reasoning_options: [
|
||||
{ type: "toggle" },
|
||||
{ type: "effort", values: ["none", "low", "medium", "high", "max"] },
|
||||
{ type: "budget_tokens", min: 1_024, max: 32_768 },
|
||||
],
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" fill="currentColor"><path d="M 111.50 70.50 L 81.50 99.00 L 68.50 114.00 L 49.50 140.00 L 36.00 163.00 L 26.00 183.50 L 13.00 218.50 L 5.50 250.00 L 1.50 282.00 L 0.00 285.50 L 0.00 739.50 L 1.50 742.00 L 4.50 769.00 L 9.50 792.00 L 18.00 820.00 L 26.50 841.00 L 37.00 862.50 L 49.50 883.50 L 64.50 904.50 L 81.50 924.50 L 99.00 942.00 L 121.00 960.50 L 141.50 975.00 L 170.50 991.50 L 194.50 1002.00 L 225.50 1012.50 L 246.00 1017.50 L 282.00 1022.50 L 282.50 1023.50 L 750.00 1023.00 L 745.50 1022.50 L 772.50 1018.50 L 799.00 1012.50 L 818.50 1006.50 L 841.00 997.50 L 864.00 986.00 L 882.50 975.00 L 904.50 959.50 L 923.00 944.00 L 944.00 923.00 L 964.00 898.50 L 981.50 872.00 L 996.00 844.50 L 1006.00 819.50 L 1013.00 797.50 L 1018.50 773.00 L 1022.50 741.00 L 1023.50 740.50 L 1023.50 285.50 L 1022.50 285.00 L 1021.50 270.00 L 1016.00 238.00 L 1010.00 216.00 L 999.00 186.00 L 990.00 167.00 L 975.00 141.00 L 959.50 119.00 L 944.00 100.50 L 923.50 80.00 L 907.00 66.00 L 879.50 46.50 L 862.50 36.50 L 842.00 26.50 L 807.50 13.50 L 774.50 5.50 L 744.00 1.00 L 747.50 0.00 L 278.00 0.50 L 281.00 1.00 L 255.50 4.50 L 227.50 10.50 L 207.50 16.50 L 185.50 25.00 L 144.00 47.00 Z M 693.50 241.00 L 680.50 244.50 L 674.50 247.50 L 665.00 254.50 L 660.00 260.00 L 654.00 270.00 L 651.00 278.50 L 649.50 286.50 L 649.50 297.00 L 651.50 306.50 L 656.00 316.50 L 664.00 327.00 L 671.00 333.00 L 681.00 338.50 L 689.00 341.00 L 707.50 342.00 L 716.50 340.00 L 724.50 336.50 L 733.00 330.50 L 741.00 322.00 L 744.50 317.00 L 749.50 305.00 L 751.00 297.00 L 751.00 285.50 L 748.50 274.50 L 744.00 265.00 L 737.50 256.50 L 732.00 251.50 L 724.50 246.50 L 713.00 242.00 L 703.50 240.50 Z M 741.50 384.00 L 735.50 379.00 L 730.50 377.00 L 716.00 377.00 L 706.50 378.50 L 684.00 386.00 L 672.00 392.50 L 661.50 400.50 L 651.00 412.50 L 631.00 446.00 L 598.50 492.00 L 571.50 525.50 L 535.50 565.50 L 501.50 599.00 L 463.50 631.50 L 429.00 655.50 L 395.50 673.50 L 372.00 682.50 L 348.50 687.50 L 325.00 687.50 L 305.50 683.00 L 291.00 676.00 L 275.00 664.00 L 263.50 651.50 L 254.50 639.00 L 245.00 622.00 L 243.50 622.00 L 238.00 642.00 L 233.50 666.50 L 231.50 686.00 L 231.00 708.00 L 232.50 726.50 L 236.50 744.50 L 241.50 756.50 L 248.50 767.00 L 256.00 774.50 L 265.00 780.50 L 272.50 784.00 L 289.00 788.50 L 306.50 790.50 L 329.50 790.50 L 355.00 788.00 L 384.00 780.50 L 414.50 769.00 L 443.50 754.00 L 477.50 731.50 L 508.00 706.50 L 545.00 670.50 L 571.00 641.50 L 591.50 616.00 L 622.50 573.50 L 647.00 536.50 L 670.00 499.00 L 703.50 440.50 L 704.00 443.00 L 671.00 601.00 L 668.00 608.50 L 658.00 619.50 L 649.00 625.00 L 638.50 627.00 L 608.50 628.50 L 606.50 631.00 L 606.50 636.50 L 619.50 647.50 L 629.50 658.00 L 637.50 669.00 L 646.00 684.50 L 651.50 698.00 L 657.00 716.50 L 660.00 731.50 L 663.00 757.00 L 665.00 762.50 L 672.00 769.50 L 681.00 773.00 L 688.00 772.50 L 697.00 768.00 L 706.50 758.00 L 712.50 743.50 L 713.00 731.50 L 710.50 701.00 L 711.50 694.50 L 715.00 686.50 L 721.00 679.50 L 726.00 676.00 L 749.50 665.50 L 768.50 652.50 L 776.50 645.00 L 784.50 635.00 L 793.00 618.00 L 792.00 615.00 L 787.00 614.50 L 759.50 622.50 L 734.50 626.50 L 722.50 626.00 L 718.50 623.50 L 715.50 619.50 L 715.00 613.50 L 718.00 589.00 L 746.00 402.00 L 745.50 392.50 Z" fill-rule="evenodd" clip-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,28 @@
|
||||
name = "Agnes 2.0 Flash"
|
||||
description = "Fast and efficient model for agent workflows, tool calling, coding, and image understanding."
|
||||
attachment = true
|
||||
reasoning = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
temperature = true
|
||||
release_date = "2026-05-25"
|
||||
last_updated = "2026-05-25"
|
||||
open_weights = false
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
|
||||
[limit]
|
||||
context = 512_000
|
||||
output = 65_536
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle" # API: {"chat_template_kwargs": {"enable_thinking": true}}
|
||||
@@ -0,0 +1,28 @@
|
||||
name = "Agnes 2.5 Flash"
|
||||
description = "Upgraded model with improved coding, agent workflows, tool calling, and multimodal understanding."
|
||||
release_date = "2026-07"
|
||||
last_updated = "2026-07"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
temperature = true
|
||||
open_weights = false
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
|
||||
[limit]
|
||||
context = 512_000
|
||||
output = 65_536
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle" # API: {"chat_template_kwargs": {"enable_thinking": true}}
|
||||
@@ -0,0 +1,29 @@
|
||||
name = "Agnes 2.5 Pro Alpha"
|
||||
description = "Paid reasoning model for advanced coding, scientific reasoning, long-context analysis, agentic workflows, and multimodal understanding."
|
||||
release_date = "2026-07-24"
|
||||
last_updated = "2026-07-24"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.45
|
||||
output = 0.90
|
||||
cache_read = 0.0038
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
output = 65_536
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle" # API: {"chat_template_kwargs": {"enable_thinking": true}}
|
||||
@@ -0,0 +1,5 @@
|
||||
name = "Agnes AI"
|
||||
env = ["AGNES_API_KEY"]
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
doc = "https://agnes-ai.com/doc"
|
||||
api = "https://apihub.agnes-ai.com/v1"
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="currentColor">
|
||||
<path d="M18 47 30.6 16h4.6L48 47h-8.2l-2.6-7.2H27L24.2 47H16zm13.8-22.4-2.7 8.2h6l-2.8-8.2h-.5z"/>
|
||||
<circle cx="47" cy="17" r="4"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 224 B |
@@ -0,0 +1,7 @@
|
||||
# Aixy's public quickstart documents this provider-qualified model ID.
|
||||
base_model = "openai/gpt-4.1-mini"
|
||||
|
||||
[cost]
|
||||
input = 0.40
|
||||
output = 1.60
|
||||
cache_read = 0.10
|
||||
@@ -0,0 +1,7 @@
|
||||
name = "Aixy"
|
||||
env = ["AIXY_API_KEY"]
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
# Aixy is a BYOK gateway. Model availability is tenant-specific and returned by
|
||||
# authenticated GET /v1/models; direct IDs use provider/model.
|
||||
api = "https://api.aixy-gateway.com/v1"
|
||||
doc = "https://docs.aixy-gateway.com/integrations/overview"
|
||||
@@ -1,3 +1,9 @@
|
||||
# Chinese mainland deployment is tiered on input tokens per request; every
|
||||
# token in a request bills at its tier's unit price. The 0.87/3.48 previously
|
||||
# published here matches neither band; both bands below are taken from the
|
||||
# vendor page. No cache-read price is published for either band, so the
|
||||
# existing curated cache_read is retained on the base and not restated.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "GLM-5.1"
|
||||
description = "Flagship GLM model for hybrid reasoning, coding, and agentic engineering"
|
||||
family = "glm"
|
||||
@@ -21,10 +27,15 @@ max = 131_072
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0.87
|
||||
output = 3.48
|
||||
input = 0.825
|
||||
output = 3.301
|
||||
cache_read = 0.17
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 32_000 }
|
||||
input = 1.1
|
||||
output = 3.851
|
||||
|
||||
[limit]
|
||||
context = 202_752
|
||||
output = 128_000
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# Chinese mainland deployment is tiered on input tokens per request; every
|
||||
# token in a request bills at its tier's unit price. The 0.86/3.15 previously
|
||||
# published here is the 32K<Token<=166K band, not the model's entry rate.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "GLM-5"
|
||||
description = "Flagship GLM model for hybrid reasoning, coding, and agentic engineering"
|
||||
family = "glm"
|
||||
@@ -20,8 +24,13 @@ max = 32_768
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0.573
|
||||
output = 2.58
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 32_000 }
|
||||
input = 0.86
|
||||
output = 3.15
|
||||
output = 3.154
|
||||
|
||||
[limit]
|
||||
context = 202_752
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Chinese mainland deployment is tiered on input tokens per request; every
|
||||
# token in a request bills at its tier's unit price.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "Qwen3-Coder 30B-A3B Instruct"
|
||||
description = "Qwen coding model for software agents, repository edits, and code reasoning"
|
||||
family = "qwen"
|
||||
@@ -14,6 +17,16 @@ open_weights = true
|
||||
input = 0.216
|
||||
output = 0.861
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 32_000 }
|
||||
input = 0.323
|
||||
output = 1.291
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 128_000 }
|
||||
input = 0.538
|
||||
output = 2.151
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 65_536
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Chinese mainland deployment is tiered on input tokens per request; every
|
||||
# token in a request bills at its tier's unit price.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "Qwen3-Coder 480B-A35B Instruct"
|
||||
description = "Qwen coding model for software agents, repository edits, and code reasoning"
|
||||
family = "qwen"
|
||||
@@ -14,6 +17,16 @@ open_weights = true
|
||||
input = 0.861
|
||||
output = 3.441
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 32_000 }
|
||||
input = 1.291
|
||||
output = 5.161
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 128_000 }
|
||||
input = 2.151
|
||||
output = 8.602
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 65_536
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# Chinese mainland deployment is tiered on input tokens per request:
|
||||
# 0<Token<=128K bills at 0.172/1.032 and 128K<Token<=256K at 0.43/2.58, with
|
||||
# every token in a request billed at its tier's unit price. Thinking-mode and
|
||||
# non-thinking-mode output are priced the same in both bands.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "Qwen3.5 397B-A17B"
|
||||
description = "Qwen vision-language model for visual reasoning, documents, and agent tasks"
|
||||
family = "qwen"
|
||||
@@ -18,7 +23,13 @@ type = "budget_tokens"
|
||||
max = 81_920
|
||||
|
||||
[cost]
|
||||
input = 0.430
|
||||
input = 0.172
|
||||
output = 1.032
|
||||
reasoning = 1.032
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 128_000 }
|
||||
input = 0.43
|
||||
output = 2.58
|
||||
reasoning = 2.58
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# International (Singapore) deployment is tiered on input tokens per request;
|
||||
# every token in a request bills at its tier's unit price.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "Qwen3-Coder 30B-A3B Instruct"
|
||||
description = "Smaller Qwen coder for efficient local agents and repo-level fixes"
|
||||
family = "qwen"
|
||||
@@ -14,6 +17,16 @@ open_weights = true
|
||||
input = 0.45
|
||||
output = 2.25
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 32_000 }
|
||||
input = 0.75
|
||||
output = 3.75
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 128_000 }
|
||||
input = 1.2
|
||||
output = 6
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 65_536
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# International (Singapore) deployment is tiered on input tokens per request;
|
||||
# every token in a request bills at its tier's unit price.
|
||||
# https://www.alibabacloud.com/help/en/model-studio/model-pricing (accessed 2026-08-26)
|
||||
name = "Qwen3-Coder 480B-A35B Instruct"
|
||||
description = "Open Qwen coding heavyweight for repository reasoning and agentic engineering"
|
||||
family = "qwen"
|
||||
@@ -14,6 +17,16 @@ open_weights = true
|
||||
input = 1.50
|
||||
output = 7.50
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 32_000 }
|
||||
input = 2.7
|
||||
output = 13.5
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { type = "context", size = 128_000 }
|
||||
input = 4.5
|
||||
output = 22.5
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 65_536
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
# Global cross-Region inference profile — served by Bedrock core (Converse), not Mantle, so no [provider] override.
|
||||
# Verified from eu-west-1: returns 200 with reasoning effort set.
|
||||
# Pricing mirrors the US in-region on-demand rates on openai.gpt-5.6-luna: https://aws.amazon.com/bedrock/pricing/
|
||||
# Global pricing and Runtime capabilities: https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html
|
||||
base_model = "openai/gpt-5.6-luna"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
base_model_omit = ["cost.context_over_200k", "experimental.modes.fast"]
|
||||
name = "GPT-5.6 Luna (Global)"
|
||||
structured_output = false
|
||||
|
||||
[cost]
|
||||
input = 0.22
|
||||
output = 1.32
|
||||
cache_read = 0.022
|
||||
cache_write = 0.275
|
||||
input = 0.20
|
||||
output = 1.20
|
||||
cache_read = 0.02
|
||||
cache_write = 0.25
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { size = 272_000 }
|
||||
input = 0.44
|
||||
output = 1.98
|
||||
cache_read = 0.044
|
||||
cache_write = 0.55
|
||||
input = 0.40
|
||||
output = 1.80
|
||||
cache_read = 0.04
|
||||
cache_write = 0.50
|
||||
@@ -1,20 +1,21 @@
|
||||
# Global cross-Region inference profile — served by Bedrock core (Converse), not Mantle, so no [provider] override.
|
||||
# Verified from eu-west-1: returns 200 with reasoning effort set.
|
||||
# Pricing mirrors the US in-region on-demand rates on openai.gpt-5.6-sol: https://aws.amazon.com/bedrock/pricing/
|
||||
# Global pricing and Runtime capabilities: https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-sol.html
|
||||
base_model = "openai/gpt-5.6-sol"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
base_model_omit = ["cost.context_over_200k", "experimental.modes.fast"]
|
||||
name = "GPT-5.6 Sol (Global)"
|
||||
structured_output = false
|
||||
|
||||
[cost]
|
||||
input = 5.50
|
||||
output = 33.00
|
||||
cache_read = 0.55
|
||||
cache_write = 6.875
|
||||
input = 4.00
|
||||
output = 20.00
|
||||
cache_read = 0.40
|
||||
cache_write = 5.00
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { size = 272_000 }
|
||||
input = 11.00
|
||||
output = 49.50
|
||||
cache_read = 1.10
|
||||
cache_write = 13.75
|
||||
input = 8.00
|
||||
output = 30.00
|
||||
cache_read = 0.80
|
||||
cache_write = 10.00
|
||||
@@ -1,20 +1,21 @@
|
||||
# Global cross-Region inference profile — served by Bedrock core (Converse), not Mantle, so no [provider] override.
|
||||
# Verified from eu-west-1: effort none|low|medium|high|xhigh|max all return 200.
|
||||
# Pricing mirrors the US in-region on-demand rates on openai.gpt-5.6-terra: https://aws.amazon.com/bedrock/pricing/
|
||||
# Global pricing and Runtime capabilities: https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-terra.html
|
||||
base_model = "openai/gpt-5.6-terra"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
base_model_omit = ["cost.context_over_200k", "experimental.modes.fast"]
|
||||
name = "GPT-5.6 Terra (Global)"
|
||||
structured_output = false
|
||||
|
||||
[cost]
|
||||
input = 2.20
|
||||
output = 13.20
|
||||
cache_read = 0.22
|
||||
cache_write = 2.75
|
||||
input = 2.00
|
||||
output = 12.00
|
||||
cache_read = 0.20
|
||||
cache_write = 2.50
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { size = 272_000 }
|
||||
input = 4.40
|
||||
output = 19.80
|
||||
cache_read = 0.44
|
||||
cache_write = 5.50
|
||||
input = 4.00
|
||||
output = 18.00
|
||||
cache_read = 0.40
|
||||
cache_write = 5.00
|
||||
@@ -1,23 +1,23 @@
|
||||
# Bedrock model IDs and reasoning support: https://github.com/openai/codex/pull/30285
|
||||
# Bedrock context window: https://developers.openai.com/api/docs/guides/amazon-bedrock
|
||||
# In-region on-demand pricing (US East N. Virginia & Ohio): https://aws.amazon.com/bedrock/pricing/
|
||||
# In-region on-demand pricing: https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-sol.html
|
||||
# Columns: input / 30m cache write / cache read / output (USD per 1M tokens)
|
||||
base_model = "openai/gpt-5.6-sol"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
base_model_omit = ["cost.context_over_200k", "experimental.modes.fast"]
|
||||
|
||||
[cost]
|
||||
input = 5.50
|
||||
output = 33.00
|
||||
cache_read = 0.55
|
||||
cache_write = 6.875
|
||||
input = 4.40
|
||||
output = 22.00
|
||||
cache_read = 0.44
|
||||
cache_write = 5.50
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { size = 272_000 }
|
||||
input = 11.00
|
||||
output = 49.50
|
||||
cache_read = 1.10
|
||||
cache_write = 13.75
|
||||
input = 8.80
|
||||
output = 33.00
|
||||
cache_read = 0.88
|
||||
cache_write = 11.00
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/amazon-bedrock/mantle"
|
||||
|
||||
@@ -9,7 +9,7 @@ reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.15
|
||||
|
||||
@@ -9,7 +9,7 @@ reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.15
|
||||
|
||||
@@ -9,7 +9,7 @@ reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.07
|
||||
|
||||
@@ -9,7 +9,7 @@ reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.07
|
||||
|
||||
@@ -8,7 +8,7 @@ reasoning = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.15
|
||||
|
||||
@@ -8,7 +8,7 @@ reasoning = false
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = false
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.07
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# Effort: reasoning_effort = low|high|max; reasoning cannot be disabled.
|
||||
# https://docs.baseten.co/inference/model-apis/reasoning
|
||||
base_model = "zhipuai/glm-5.3-flash"
|
||||
name = "GLM 5.3 Flash"
|
||||
description = "GLM vision model for visual reasoning, documents, and multimodal agents"
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["low", "high", "max"]
|
||||
|
||||
[cost]
|
||||
input = 0.15
|
||||
output = 0.5
|
||||
|
||||
[limit]
|
||||
context = 1_048_576
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
@@ -0,0 +1,12 @@
|
||||
# https://docs.cline.bot/getting-started/clinepass (accessed 2026-08-24)
|
||||
# Model ID cline-pass/glm-5.3; reference pricing matches glm-5.2 at $1.4 / $4.4 / $0.26 per 1M tokens (input/output/cache read).
|
||||
base_model = "zhipuai/glm-5.3"
|
||||
reasoning_options = [{ type = "effort", values = ["low", "high", "max"] }]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 1.4
|
||||
output = 4.4
|
||||
cache_read = 0.26
|
||||
@@ -0,0 +1,14 @@
|
||||
# https://docs.cline.bot/getting-started/clinepass (accessed 2026-08-24)
|
||||
# Model ID cline-pass/qwen3.8-max; reference pricing $2 / $6 / $0.25 per 1M tokens (input/output/cache read), cache write $2.5.
|
||||
base_model = "alibaba/qwen3.8-max"
|
||||
structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["minimal", "low", "medium", "high", "xhigh"]
|
||||
|
||||
[cost]
|
||||
input = 2
|
||||
output = 6
|
||||
cache_read = 0.25
|
||||
cache_write = 2.5
|
||||
@@ -1,255 +1,123 @@
|
||||
# Cloudflare AI Gateway Provider
|
||||
|
||||
This provider enables model management for Cloudflare AI Gateway, which acts as a unified proxy for multiple AI providers (OpenAI, Anthropic, Workers AI, Replicate, etc.).
|
||||
Cloudflare AI Gateway relays third-party labs (Anthropic, OpenAI, Google, xAI, Alibaba,
|
||||
DeepSeek, Moonshot, …) through a single endpoint. This provider's model files are **derived**
|
||||
from Cloudflare's own live catalog, with human curation reduced to the few things the catalog
|
||||
can't express.
|
||||
|
||||
## Overview
|
||||
**Scope: proxied third-party models only.** Cloudflare's own Workers AI (`@cf/...`) models are
|
||||
a different pathway — hosted on Cloudflare, CF-token auth, per-model agreements — and live in
|
||||
their own provider, [`cloudflare-workers-ai`](../cloudflare-workers-ai/). They are deliberately
|
||||
not mirrored here.
|
||||
|
||||
Cloudflare AI Gateway provides a compatibility layer that allows you to access models from various providers through a single endpoint. This provider automatically fetches available models from the Cloudflare API and generates TOML configuration files for use in the models.dev system.
|
||||
## How it works
|
||||
|
||||
## Directory Structure
|
||||
One command regenerates every model TOML:
|
||||
|
||||
```
|
||||
cloudflare-ai-gateway/
|
||||
├── data/
|
||||
│ ├── api_response.json # Cached API response from Cloudflare
|
||||
│ └── model_names.json # Human-readable name mappings
|
||||
├── models/ # Generated TOML files
|
||||
│ ├── anthropic/
|
||||
│ ├── openai/
|
||||
│ ├── replicate/
|
||||
│ └── workers-ai/
|
||||
├── scripts/
|
||||
│ ├── 01_fetch_model_data.sh # Fetches models from Cloudflare API
|
||||
│ ├── 02_generate_model_names.sh # Updates model name mappings
|
||||
│ ├── 03_generate_model_toml.sh # Generates TOML files
|
||||
│ └── utils.sh # Shared utility functions
|
||||
├── provider.toml # Provider configuration
|
||||
└── README.md # This file
|
||||
```bash
|
||||
CLOUDFLARE_API_TOKEN=xxx CLOUDFLARE_ACCOUNT_ID=xxx bun run cloudflare-ai-gateway:generate
|
||||
```
|
||||
|
||||
## How It Works
|
||||
It reads two live Cloudflare sources plus one local curation file:
|
||||
|
||||
### 1. Model Fetching (01_fetch_model_data.sh)
|
||||
- **Proxied catalog** — `GET /accounts/{id}/ai/catalog/models`. The source of truth: one
|
||||
canonical (dotted) `model_id` per model, description, context/output limits, and pricing.
|
||||
This is why ids look like `anthropic/claude-haiku-4.5`, not `claude-haiku-4-5`.
|
||||
- **Per-model catalog schema** — `GET /accounts/{id}/ai/catalog/models/{id}/schema`. Used to
|
||||
derive `reasoning_options` for providers whose schema is OpenAI-compatible (xAI, Alibaba,
|
||||
OpenAI). Native-format providers (Google, Anthropic, DeepSeek, Moonshot) don't expose the
|
||||
knob here — those fall back to curation (see below).
|
||||
|
||||
This script fetches the list of available models from the Cloudflare AI Gateway API:
|
||||
Everything the generator can read is derived: `cost`, `limit.context`, and `reasoning_options`.
|
||||
`name` and `description` are intentionally **not** written — they inherit from `base_model`
|
||||
(models.dev's canonical copy), since the catalog only carries Cloudflare's own casing and
|
||||
marketing copy. Anthropic/OpenAI also get a `[provider] npm` pointing at their native SDK so
|
||||
consumers route to the Messages/Responses endpoint rather than the generic compat transform.
|
||||
|
||||
- **API Endpoint**: `https://gateway.ai.cloudflare.com/v1/{ACCOUNT_ID}/{GATEWAY_ID}/compat/models`
|
||||
- **Authentication**: Uses `CLOUDFLARE_API_TOKEN` for authorization
|
||||
- **Output**: Saves the API response to `data/api_response.json`
|
||||
The generator emits override-only `base_model` stubs (see the repo `AGENTS.md`): the lab
|
||||
metadata lives under `models/<lab>/`, and each provider file only records real deltas.
|
||||
|
||||
The API returns model data including:
|
||||
- Model ID (e.g., `openai/gpt-4o`, `anthropic/claude-3.5-sonnet`)
|
||||
- Cost per token (input and output)
|
||||
- Creation timestamp
|
||||
- Other metadata
|
||||
### `--check`
|
||||
|
||||
### 2. Model Name Generation (02_generate_model_names.sh)
|
||||
```bash
|
||||
bun run cloudflare-ai-gateway:generate --check
|
||||
```
|
||||
|
||||
This script manages the `data/model_names.json` file, which maps model IDs to human-readable names:
|
||||
Exits non-zero if the committed TOMLs are out of date with the live catalog + curation.
|
||||
Used in CI.
|
||||
|
||||
- Reads from `data/api_response.json`
|
||||
- Adds new model IDs to `model_names.json` (if not already present)
|
||||
- Preserves existing name mappings
|
||||
- Filters models based on configuration in `utils.sh`
|
||||
### Offline / fixtures
|
||||
|
||||
**Model Filtering**:
|
||||
- Includes ALL models from: `workers-ai`, `replicate`
|
||||
- Includes ONLY well-known models from: `openai`, `anthropic`
|
||||
- Skips namespaces: `replicate/replicate-internal`
|
||||
- Skips specific models: `aura-1`, `whisper`
|
||||
Set `CF_AIG_FIXTURE_DIR` to a directory of cached responses to run without network access
|
||||
(used in tests). It expects:
|
||||
|
||||
### 3. TOML Generation (03_generate_model_toml.sh)
|
||||
- `catalog_*.json` — paginated `ai/catalog/models` responses
|
||||
- `schema/<provider>_<model>.json` — one per-model catalog schema response
|
||||
|
||||
This script generates TOML configuration files for each model:
|
||||
## curation.toml
|
||||
|
||||
**Two Generation Strategies**:
|
||||
The only hand-authored file. It holds what the catalog cannot express, or where a live
|
||||
quality judgement overrides what a schema merely advertises:
|
||||
|
||||
1. **Cross-referencing** (for OpenAI and Anthropic):
|
||||
- Copies TOML files from the source provider directories
|
||||
- Maps Cloudflare model names to canonical provider names
|
||||
- Example: `anthropic/claude-3.5-sonnet` → `../../anthropic/models/claude-3-5-sonnet-20241022.toml`
|
||||
|
||||
2. **Auto-generation** (for Workers AI and Replicate):
|
||||
- Generates TOML files with default values
|
||||
- Uses cost and metadata from the API response
|
||||
- Converts cost per token → cost per million tokens
|
||||
- Sets default capabilities (context length, modalities, etc.)
|
||||
|
||||
**Generated TOML Structure**:
|
||||
```toml
|
||||
name = "Model Name"
|
||||
release_date = "2024-01-01"
|
||||
last_updated = "2024-01-01"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
# Catalog Text-Generation ids we intentionally don't publish: no lab file to map to, or
|
||||
# not reachable via unified billing (BYOK-only).
|
||||
skip = ["google/gemini-3.1-pro", "thinkingmachines/inkling", ...]
|
||||
|
||||
[cost]
|
||||
input = 0.15 # USD per 1M input tokens
|
||||
output = 0.60 # USD per 1M output tokens
|
||||
# reasoning_options for native-format providers whose shape the catalog schema doesn't expose.
|
||||
[models."alibaba/qwen3.7-plus"]
|
||||
note = ["Toggle: enable_thinking true|false.", "Budget: thinking_budget (integer)."]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens" }]
|
||||
|
||||
[limit]
|
||||
context = 128000 # Max context tokens
|
||||
output = 16384 # Max output tokens
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
# structured_output is a live-tested judgement, not a schema claim.
|
||||
[models."anthropic/claude-sonnet-4.5"]
|
||||
structured_output = true
|
||||
limit = { context = 1000000 }
|
||||
reasoning_options = [{ type = "budget_tokens", min = 1024 }]
|
||||
```
|
||||
|
||||
### 4. Utilities (utils.sh)
|
||||
### What belongs in curation vs. what's derived
|
||||
|
||||
Shared configuration and helper functions:
|
||||
| Field | Source |
|
||||
| --- | --- |
|
||||
| `cost`, `limit.context` | derived (catalog) |
|
||||
| `name`, `description`, `tool_call`, `attachment` | inherited from `base_model` (never written) |
|
||||
| `base_model` | auto-resolved from `model_id`; curated only when the file name differs |
|
||||
| `reasoning_options` | derived from the per-model `schema.input`; curated for native-format providers and always-on reasoners |
|
||||
| `structured_output` | curated — a live-tested judgement (schema acceptance ≠ conformance) |
|
||||
| `[provider] npm` | derived — `@ai-sdk/anthropic` / `@ai-sdk/openai` for the native-passthrough families |
|
||||
|
||||
**Configuration**:
|
||||
- `INCLUDE_ALL_PROVIDERS`: Providers to include all models from
|
||||
- `CROSS_REFERENCE_PROVIDERS`: Providers to copy from source directories
|
||||
- `WELL_KNOWN_MODELS`: Regex patterns for specific models to include
|
||||
- `SKIP_NAMESPACES`: Namespaces to exclude
|
||||
- `SKIP_MODELS`: Specific models to exclude
|
||||
`reasoning_options` is only written when the `base_model` declares `reasoning = true`; the
|
||||
schema forbids it otherwise. When a reasoning model has no derivable and no curated shape,
|
||||
the generator hard-fails rather than ship an invalid file.
|
||||
|
||||
**Helper Functions**:
|
||||
- `should_include_model()`: Determines if a model should be included
|
||||
- `get_mapped_name()`: Maps Cloudflare names to source provider names
|
||||
- `find_source_file()`: Locates source TOML files for cross-referencing
|
||||
### Adding a model
|
||||
|
||||
## Usage
|
||||
1. Confirm it appears in `ai/catalog/models`.
|
||||
2. If its canonical lab metadata is missing, add it under `models/<lab>/<model>.toml`.
|
||||
3. For a model with a matching lab file, nothing more is needed — the generator auto-resolves
|
||||
`base_model`. Add a `skip` entry instead if there's no lab file to map to, or if the model
|
||||
isn't reachable via unified billing.
|
||||
4. If it's a reasoning model whose knob the schema doesn't expose, add `reasoning_options`.
|
||||
5. Run the generator; `bun validate` must pass.
|
||||
|
||||
### Prerequisites
|
||||
## Provider configuration
|
||||
|
||||
- Cloudflare account with AI Gateway configured
|
||||
- Required environment variables:
|
||||
- `CLOUDFLARE_API_TOKEN`: Your Cloudflare API token
|
||||
- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID
|
||||
- `CLOUDFLARE_GATEWAY_ID`: Your AI Gateway name/ID
|
||||
|
||||
### Running the Scripts
|
||||
|
||||
Run scripts individually or in sequence:
|
||||
|
||||
```bash
|
||||
# Step 1: Fetch model data from Cloudflare API
|
||||
cd scripts
|
||||
CLOUDFLARE_API_TOKEN=xxx \
|
||||
CLOUDFLARE_ACCOUNT_ID=xxx \
|
||||
CLOUDFLARE_GATEWAY_ID=xxx \
|
||||
./01_fetch_model_data.sh
|
||||
|
||||
# Step 2: Update model name mappings
|
||||
./02_generate_model_names.sh
|
||||
|
||||
# Step 3: Generate TOML files
|
||||
./03_generate_model_toml.sh
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
Edit `scripts/utils.sh` to customize:
|
||||
|
||||
1. **Add a provider to include all models**:
|
||||
```bash
|
||||
INCLUDE_ALL_PROVIDERS="workers-ai replicate my-new-provider"
|
||||
```
|
||||
|
||||
2. **Add a well-known model**:
|
||||
```bash
|
||||
WELL_KNOWN_MODELS=(
|
||||
# ... existing patterns ...
|
||||
"openai/gpt-5$"
|
||||
)
|
||||
```
|
||||
|
||||
3. **Skip a namespace**:
|
||||
```bash
|
||||
SKIP_NAMESPACES="replicate/replicate-internal my-provider/internal"
|
||||
```
|
||||
|
||||
4. **Cross-reference a provider**:
|
||||
```bash
|
||||
CROSS_REFERENCE_PROVIDERS="openai anthropic google"
|
||||
```
|
||||
|
||||
### Model Name Mappings
|
||||
|
||||
Edit `data/model_names.json` to provide human-readable names:
|
||||
|
||||
```json
|
||||
{
|
||||
"workers-ai/llama-3-8b-instruct": "Llama 3 8B Instruct",
|
||||
"openai/gpt-4o": "GPT-4o",
|
||||
"anthropic/claude-3.5-sonnet": "Claude 3.5 Sonnet"
|
||||
}
|
||||
```
|
||||
|
||||
## Model ID Format
|
||||
|
||||
Cloudflare uses BOTH dots and hyphens in model IDs (the API returns both formats):
|
||||
- **OpenAI**: `openai/gpt-5.1` OR `openai/gpt-5-1`, `openai/gpt-3.5-turbo` OR `openai/gpt-3-5-turbo`
|
||||
- **Anthropic**: `anthropic/claude-3.5-sonnet` OR `anthropic/claude-3-5-sonnet`, `anthropic/claude-haiku-4-5`
|
||||
- **Workers AI**: `workers-ai/@cf/meta/llama-3-8b-instruct`
|
||||
- **Replicate**: `replicate/meta/meta-llama-3-70b-instruct`
|
||||
|
||||
**Important**: The API returns duplicate models with different naming conventions (dots vs hyphens). The WELL_KNOWN_MODELS patterns handle both formats using `[\.-]` regex to match either a dot or hyphen.
|
||||
|
||||
**File Path Conversion**:
|
||||
- Dots are preserved in filenames: `openai/gpt-5.1.toml`
|
||||
- Workers AI special handling: `workers-ai/@cf/meta/llama` → `workers-ai/llama.toml`
|
||||
|
||||
## Cross-Referencing Logic
|
||||
|
||||
For OpenAI and Anthropic models, the scripts map Cloudflare model IDs to canonical provider filenames:
|
||||
|
||||
**Anthropic Mappings**:
|
||||
- `claude-3.5-sonnet` → `claude-3-5-sonnet-20241022.toml`
|
||||
- `claude-3.5-haiku` → `claude-3-5-haiku-latest.toml`
|
||||
- `claude-3-opus` → `claude-3-opus-20240229.toml`
|
||||
|
||||
**OpenAI Mappings**:
|
||||
- `gpt-5.1` → `gpt-5.1.toml`
|
||||
- `gpt-3.5-turbo` → `gpt-3.5-turbo.toml`
|
||||
|
||||
This ensures consistency with the canonical provider definitions while supporting Cloudflare's naming conventions.
|
||||
|
||||
## Cleanup
|
||||
|
||||
The TOML generation script automatically:
|
||||
- Removes models that are no longer in the API response
|
||||
- Cleans up empty directories
|
||||
- Maintains a clean models directory
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**API errors**:
|
||||
- Verify environment variables are set correctly
|
||||
- Check API token has necessary permissions
|
||||
- Ensure Gateway ID matches your Cloudflare configuration
|
||||
|
||||
**Missing models**:
|
||||
- Check if the model is filtered by `utils.sh` configuration
|
||||
- Review `WELL_KNOWN_MODELS` patterns
|
||||
- Verify the model exists in `data/api_response.json`
|
||||
|
||||
**Cross-referencing failures**:
|
||||
- Ensure source provider directories exist (e.g., `../openai/models/`)
|
||||
- Check model name mappings in `get_mapped_name()`
|
||||
- Verify source TOML files exist with correct names
|
||||
|
||||
## Provider Configuration
|
||||
|
||||
The `provider.toml` file defines how OpenCode connects to Cloudflare AI Gateway:
|
||||
`provider.toml` defines how models.dev connects to the gateway:
|
||||
|
||||
```toml
|
||||
name = "Cloudflare AI Gateway"
|
||||
env = ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID", "CLOUDFLARE_GATEWAY_ID"]
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
api = "https://gateway.ai.cloudflare.com/v1/${CLOUDFLARE_ACCOUNT_ID}/${CLOUDFLARE_GATEWAY_ID}/compat/"
|
||||
npm = "ai-gateway-provider"
|
||||
doc = "https://developers.cloudflare.com/ai-gateway/"
|
||||
```
|
||||
|
||||
## Additional Resources
|
||||
It is hand-authored and not touched by the generator.
|
||||
|
||||
- [Cloudflare AI Gateway Documentation](https://developers.cloudflare.com/ai-gateway/)
|
||||
- [OpenAI Compatibility API](https://developers.cloudflare.com/ai-gateway/providers/openai/)
|
||||
- [Vercel AI SDK](https://sdk.vercel.ai/)
|
||||
## Known limitations
|
||||
|
||||
- `reasoning_options` for native-format providers (Google, Anthropic, DeepSeek, Moonshot)
|
||||
can't be derived from Cloudflare's schema and must be curated. New reasoning models from
|
||||
these providers hard-fail until their knob is added to `curation.toml`.
|
||||
- `structured_output` requires a live conformance test when adding a model; the schema
|
||||
advertises `response_format` even for models that don't honour it.
|
||||
@@ -0,0 +1,195 @@
|
||||
# Cloudflare AI Gateway - human curation layer (proxied third-party models only).
|
||||
#
|
||||
# The generator derives id, name, description, cost, and limit.context from the Cloudflare
|
||||
# catalog. This file holds only what the catalog cannot express:
|
||||
# - base_model: any proxied id whose canonical file name differs from its catalog id.
|
||||
# - structured_output: a quality judgement. Cloudflare advertises response_format for
|
||||
# nearly every model, but several do not honour it, so this stays hand-set.
|
||||
# - reasoning_options: the catalog has no reasoning schema, so reasoning shapes are curated.
|
||||
# - interleaved: whether a wire returns reasoning content as a separate field. Never
|
||||
# inheritable from base_model (this deployment's wire format can differ from the lab's).
|
||||
# - limit.output: the catalog's max_output_tokens is not a reliable ceiling (verified wrong
|
||||
# against lab/first-party for several models), so output is hand-curated; only
|
||||
# limit.context is auto-derived.
|
||||
# - note: leading `#` comment lines (wire-path docs, source citations) that would otherwise
|
||||
# be lost on every regeneration.
|
||||
# - skip: catalog ids with no lab file, or not reachable via unified billing (BYOK-only).
|
||||
# Consumed by: bun run cloudflare-ai-gateway:generate
|
||||
|
||||
# Proxied Text-Generation catalog ids with no lab file under models/ (cannot publish yet).
|
||||
skip = [
|
||||
"google/gemini-3-flash",
|
||||
"google/gemini-3.1-pro",
|
||||
"xai/grok-4.20-multi-agent-0309",
|
||||
"thinkingmachines/inkling-256k",
|
||||
"minimax/m2.7",
|
||||
"minimax/m3",
|
||||
"thinkingmachines/inkling",
|
||||
"google/gemini-2.5-flash-lite",
|
||||
"google/gemini-2.5-flash",
|
||||
"google/gemini-2.5-pro",
|
||||
"google/gemini-3.1-flash-lite",
|
||||
"google/gemini-3.5-flash-lite",
|
||||
"google/gemini-3.5-flash",
|
||||
"google/gemini-3.6-flash",
|
||||
"google/gemini-3.7-flash",
|
||||
]
|
||||
|
||||
[models."anthropic/claude-fable-5"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."anthropic/claude-haiku-4.5"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "budget_tokens", min = 1024 }]
|
||||
|
||||
[models."anthropic/claude-opus-4.5"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }, { type = "budget_tokens", min = 1024 }]
|
||||
|
||||
[models."anthropic/claude-opus-4.6"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "max"] }, { type = "budget_tokens", min = 1024 }]
|
||||
|
||||
[models."anthropic/claude-opus-4.7"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."anthropic/claude-opus-4.8"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."anthropic/claude-opus-5"]
|
||||
structured_output = true
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."anthropic/claude-sonnet-4.5"]
|
||||
structured_output = true
|
||||
limit = { context = 1000000 }
|
||||
reasoning_options = [{ type = "budget_tokens", min = 1024 }]
|
||||
|
||||
[models."anthropic/claude-sonnet-4.6"]
|
||||
structured_output = true
|
||||
limit = { context = 1000000, output = 128000 }
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "max"] }, { type = "budget_tokens", min = 1024 }]
|
||||
|
||||
[models."anthropic/claude-sonnet-5"]
|
||||
structured_output = true
|
||||
note = ["Toggle: thinking.type = adaptive|disabled.", "Effort: output_config.effort = low|medium|high|xhigh|max."]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."openai/gpt-5"]
|
||||
reasoning_options = [{ type = "effort", values = ["minimal", "low", "medium", "high"] }]
|
||||
|
||||
[models."openai/gpt-5-mini"]
|
||||
reasoning_options = [{ type = "effort", values = ["minimal", "low", "medium", "high"] }]
|
||||
|
||||
[models."openai/gpt-5-nano"]
|
||||
reasoning_options = [{ type = "effort", values = ["minimal", "low", "medium", "high"] }]
|
||||
|
||||
[models."openai/gpt-5.1"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high"] }]
|
||||
|
||||
[models."openai/gpt-5.4"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh"] }]
|
||||
|
||||
[models."openai/gpt-5.4-mini"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh"] }]
|
||||
|
||||
[models."openai/gpt-5.4-nano"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh"] }]
|
||||
|
||||
[models."openai/gpt-5.4-pro"]
|
||||
reasoning_options = [{ type = "effort", values = ["medium", "high", "xhigh"] }]
|
||||
|
||||
[models."openai/gpt-5.5"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh"] }]
|
||||
|
||||
[models."openai/gpt-5.5-pro"]
|
||||
reasoning_options = [{ type = "effort", values = ["medium", "high", "xhigh"] }]
|
||||
|
||||
[models."openai/gpt-5.6-luna"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."openai/gpt-5.6-sol"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."openai/gpt-5.6-terra"]
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high", "xhigh", "max"] }]
|
||||
|
||||
[models."openai/o3"]
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
|
||||
[models."openai/o3-mini"]
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
|
||||
[models."openai/o4-mini"]
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
|
||||
# Proxied reasoning models whose reasoning shape the Cloudflare catalog schema does not
|
||||
# expose (native-format providers). Values mirror models.dev's merge-gateway provider, which
|
||||
# proxies the same upstreams. Google uses thinkingConfig.thinkingBudget / thinking_level.
|
||||
#
|
||||
# DeepSeek: toggle-only would only be correct if AI Gateway drops the effort field on this
|
||||
# route (merge-gateway's own toggle-only shape is backed by a live-tested selected-route
|
||||
# comment specific to *their* relay, not evidence about Cloudflare's). Absent host-specific
|
||||
# proof that Cloudflare strips it, match the lab + Workers AI baseline: toggle + high/max.
|
||||
[models."deepseek/deepseek-v4-pro"]
|
||||
note = ["Toggle: thinking.type = enabled|disabled.", "Effort: reasoning_effort = high|max."]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["high", "max"] }]
|
||||
|
||||
# Alibaba is a first-party lab; the catalog's OpenAI-compat schema exposes a generic
|
||||
# `reasoning_effort` enum, but Alibaba's real API (see providers/alibaba/models/qwen3.7-plus.toml)
|
||||
# is toggle + budget_tokens, not graded effort. Match the lab shape per AGENTS.md.
|
||||
[models."alibaba/qwen3.7-plus"]
|
||||
note = ["Toggle: enable_thinking true|false.", "Budget: thinking_budget (integer reasoning tokens)."]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens" }]
|
||||
|
||||
[models."alibaba/qwen3.5-397b-a17b"]
|
||||
note = ["Toggle: enable_thinking true|false.", "Budget: thinking_budget (integer reasoning tokens)."]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens" }]
|
||||
|
||||
[models."alibaba/qwen3.7-max"]
|
||||
note = ["Toggle: enable_thinking true|false.", "Budget: thinking_budget (integer reasoning tokens)."]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens" }]
|
||||
|
||||
# providers/alibaba/models/qwen3.8-max.toml: hybrid toggle, low|medium|xhigh effort (high
|
||||
# aliases to xhigh), and a 0..262144 budget that cannot combine with effort.
|
||||
[models."alibaba/qwen3.8-max"]
|
||||
note = [
|
||||
"Toggle: enable_thinking true|false (hybrid).",
|
||||
"Effort: reasoning_effort = low|medium|xhigh (default xhigh); high accepted as alias -> xhigh.",
|
||||
"Budget: thinking_budget (0..262144) cannot be combined with reasoning_effort.",
|
||||
]
|
||||
interleaved = { field = "reasoning_content" }
|
||||
reasoning_options = [
|
||||
{ type = "toggle" },
|
||||
{ type = "effort", values = ["low", "medium", "xhigh"] },
|
||||
{ type = "budget_tokens", min = 0, max = 262_144 },
|
||||
]
|
||||
|
||||
# xAI Grok 4.6: the first-party API (providers/xai/models/grok-4.6.toml) includes xhigh, but
|
||||
# Cloudflare's gateway route rejects it (verified live: reasoning_effort accepts only
|
||||
# low|medium|high, code 7003) — a host delta, so match what the CF route actually accepts.
|
||||
[models."xai/grok-4.6"]
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
|
||||
# First-party xAI Grok 4.20 (Reasoning) is always-on with no caller control
|
||||
# (providers/xai/models/grok-4.20-0309-reasoning.toml: reasoning_options = []).
|
||||
[models."xai/grok-4.20-0309-reasoning"]
|
||||
reasoning_options = []
|
||||
|
||||
[models."moonshotai/kimi-k3"]
|
||||
note = [
|
||||
"API: thinking.type = enabled|disabled|adaptive; in adaptive mode the",
|
||||
"reasoning depth is set by output_config.effort = low|high|max.",
|
||||
]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["low", "high", "max"] }]
|
||||
|
||||
[models."thinkingmachines/inkling"]
|
||||
note = [
|
||||
"Tinker's Anthropic-compatible route: thinking.type = adaptive|disabled toggles reasoning;",
|
||||
"output_config.effort = low|medium|high|xhigh|max sets effort.",
|
||||
]
|
||||
reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["low", "medium", "high", "xhigh", "max"] }]
|
||||
limit = { output = 65_536 }
|
||||
@@ -1 +0,0 @@
|
||||
{"object":"list","data":[{"id":"google-ai-studio/gemini-3-flash-preview","object":"model","created_at":1766046035,"cost_in":5e-7,"cost_out":0.000003,"owned_by":"google-ai-studio"},{"id":"google-ai-studio/gemini-3-flash-preview-20251217","object":"model","created_at":1766046035,"cost_in":5e-7,"cost_out":0.000003,"owned_by":"google-ai-studio"},{"id":"mistral/mistral-small-creative-20251216","object":"model","created_at":1766046034,"cost_in":1e-7,"cost_out":3e-7,"owned_by":"mistral"},{"id":"openrouter/google/gemini-3-flash-preview","object":"model","created_at":1766046034,"cost_in":5e-7,"cost_out":0.000003,"owned_by":"openrouter"},{"id":"openrouter/mistralai/mistral-small-creative","object":"model","created_at":1766046033,"cost_in":1e-7,"cost_out":3e-7,"owned_by":"openrouter"},{"id":"mistral/mistral-small-creative","object":"model","created_at":1766046033,"cost_in":1e-7,"cost_out":3e-7,"owned_by":"mistral"},{"id":"openai/gpt-5.2-chat-latest","object":"model","created_at":1766046032,"cost_in":0.00000175,"cost_out":0.000014,"owned_by":"openai"},{"id":"azure-openai/kimi-k2-thinking","object":"model","created_at":1766046031,"cost_in":6e-7,"cost_out":0.0000025,"owned_by":"azure-openai"},{"id":"azure-openai/deepseek-v3.2","object":"model","created_at":1766046031,"cost_in":2.8e-7,"cost_out":4.2e-7,"owned_by":"azure-openai"},{"id":"azure-openai/gpt-5.2-chat","object":"model","created_at":1766046030,"cost_in":0.00000175,"cost_out":0.000014,"owned_by":"azure-openai"},{"id":"azure-openai/deepseek-v3.2-speciale","object":"model","created_at":1766046030,"cost_in":2.8e-7,"cost_out":4.2e-7,"owned_by":"azure-openai"},{"id":"aws-bedrock/moonshot.kimi-k2-thinking","object":"model","created_at":1766046029,"cost_in":6e-7,"cost_out":0.0000025,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.ministral-3-14b-instruct","object":"model","created_at":1766046028,"cost_in":2e-7,"cost_out":2e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/openai.gpt-oss-safeguard-120b","object":"model","created_at":1766046028,"cost_in":1.5e-7,"cost_out":6e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/nvidia.nemotron-nano-9b-v2","object":"model","created_at":1766046027,"cost_in":6e-8,"cost_out":2.3e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.mixtral-8x7b-instruct-v0:1","object":"model","created_at":1766046026,"cost_in":7e-7,"cost_out":7e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/amazon.titan-text-express-v1:0:8k","object":"model","created_at":1766046026,"cost_in":2e-7,"cost_out":6e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.mistral-7b-instruct-v0:2","object":"model","created_at":1766046025,"cost_in":1.1e-7,"cost_out":1.1e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/openai.gpt-oss-safeguard-20b","object":"model","created_at":1766046024,"cost_in":7e-8,"cost_out":2e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/openai.gpt-oss-20b-1:0","object":"model","created_at":1766046024,"cost_in":7e-8,"cost_out":3e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.voxtral-mini-3b-2507","object":"model","created_at":1766046023,"cost_in":4e-8,"cost_out":4e-8,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/amazon.nova-2-lite-v1:0","object":"model","created_at":1766046023,"cost_in":3.3e-7,"cost_out":0.00000275,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.ministral-3-8b-instruct","object":"model","created_at":1766046022,"cost_in":1.5e-7,"cost_out":1.5e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/openai.gpt-oss-120b-1:0","object":"model","created_at":1766046021,"cost_in":1.5e-7,"cost_out":6e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.voxtral-small-24b-2507","object":"model","created_at":1766046021,"cost_in":1.5e-7,"cost_out":3.5e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/nvidia.nemotron-nano-12b-v2","object":"model","created_at":1766046020,"cost_in":2e-7,"cost_out":6e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/google.gemma-3-12b-it","object":"model","created_at":1766046020,"cost_in":5e-8,"cost_out":1e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/google.gemma-3-27b-it","object":"model","created_at":1766046019,"cost_in":1.2e-7,"cost_out":2e-7,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/qwen.qwen3-vl-235b-a22b","object":"model","created_at":1766046018,"cost_in":3e-7,"cost_out":0.0000015,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/mistral.mistral-large-2402-v1:0","object":"model","created_at":1766046018,"cost_in":5e-7,"cost_out":0.0000015,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/minimax.minimax-m2","object":"model","created_at":1766046017,"cost_in":3e-7,"cost_out":0.0000012,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/qwen.qwen3-next-80b-a3b","object":"model","created_at":1766046017,"cost_in":1.4e-7,"cost_out":0.0000014,"owned_by":"aws-bedrock"},{"id":"aws-bedrock/google.gemma-3-4b-it","object":"model","created_at":1766046016,"cost_in":4e-8,"cost_out":8e-8,"owned_by":"aws-bedrock"},{"id":"azure-openai/gpt-5.2","object":"model","created_at":1766046015,"cost_in":0.00000175,"cost_out":0.000014,"owned_byLine truncated
|
||||
@@ -1,281 +0,0 @@
|
||||
{
|
||||
"_comment": "Model family mappings for Cloudflare AI Gateway models. Patterns are matched in order (first match wins).",
|
||||
"patterns": [
|
||||
{
|
||||
"pattern": "^openai/gpt-3\\.?5",
|
||||
"family": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-4o-mini",
|
||||
"family": "gpt-4o-mini"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-4o",
|
||||
"family": "gpt-4o"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-4\\.?1",
|
||||
"family": "gpt-4.1"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-4-turbo",
|
||||
"family": "gpt-4-turbo"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-4$",
|
||||
"family": "gpt-4"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-5\\.?1-codex",
|
||||
"family": "gpt-5.1-codex"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-5\\.?1",
|
||||
"family": "gpt-5.1"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-5\\.?2",
|
||||
"family": "gpt-5.2"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-5",
|
||||
"family": "gpt-5"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/o1",
|
||||
"family": "o1"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/o3-pro",
|
||||
"family": "o3-pro"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/o3-mini",
|
||||
"family": "o3-mini"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/o3",
|
||||
"family": "o3"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/o4-mini",
|
||||
"family": "o4-mini"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/o4",
|
||||
"family": "o4"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-oss-120b",
|
||||
"family": "gpt-oss-120b"
|
||||
},
|
||||
{
|
||||
"pattern": "^openai/gpt-oss-20b",
|
||||
"family": "gpt-oss-20b"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-sonnet-4",
|
||||
"family": "claude-sonnet"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-opus-4",
|
||||
"family": "claude-opus"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-haiku-4",
|
||||
"family": "claude-haiku"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-3\\.?5-sonnet",
|
||||
"family": "claude-sonnet"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-3\\.?5-haiku",
|
||||
"family": "claude-haiku"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-3-opus",
|
||||
"family": "claude-opus"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-3-sonnet",
|
||||
"family": "claude-sonnet"
|
||||
},
|
||||
{
|
||||
"pattern": "^anthropic/claude-3-haiku",
|
||||
"family": "claude-haiku"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-4-scout",
|
||||
"family": "llama-4-scout"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-4-maverick",
|
||||
"family": "llama-4-maverick"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-guard-3",
|
||||
"family": "llama-guard"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-3\\.?3",
|
||||
"family": "llama-3.3"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-3\\.?2-11b-vision",
|
||||
"family": "llama-3.2-vision"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-3\\.?2",
|
||||
"family": "llama-3.2"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-3\\.?1",
|
||||
"family": "llama-3.1"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-3",
|
||||
"family": "llama-3"
|
||||
},
|
||||
{
|
||||
"pattern": "llama-2",
|
||||
"family": "llama-2"
|
||||
},
|
||||
{
|
||||
"pattern": "qwen3-embedding",
|
||||
"family": "qwen3-embedding"
|
||||
},
|
||||
{
|
||||
"pattern": "qwen3-coder",
|
||||
"family": "qwen3-coder"
|
||||
},
|
||||
{
|
||||
"pattern": "qwen3",
|
||||
"family": "qwen3"
|
||||
},
|
||||
{
|
||||
"pattern": "qwen2\\.?5-coder",
|
||||
"family": "qwen2.5-coder"
|
||||
},
|
||||
{
|
||||
"pattern": "qwen2\\.?5",
|
||||
"family": "qwen2.5"
|
||||
},
|
||||
{
|
||||
"pattern": "qwq-32b",
|
||||
"family": "qwq"
|
||||
},
|
||||
{
|
||||
"pattern": "deepseek-r1-distill",
|
||||
"family": "deepseek-r1-distill-qwen"
|
||||
},
|
||||
{
|
||||
"pattern": "deepseek-r1",
|
||||
"family": "deepseek-r1"
|
||||
},
|
||||
{
|
||||
"pattern": "deepseek-v3",
|
||||
"family": "deepseek-v3"
|
||||
},
|
||||
{
|
||||
"pattern": "deepseek-coder",
|
||||
"family": "deepseek-coder"
|
||||
},
|
||||
{
|
||||
"pattern": "deepseek",
|
||||
"family": "deepseek"
|
||||
},
|
||||
{
|
||||
"pattern": "gemma-sea-lion",
|
||||
"family": "gemma-sea-lion"
|
||||
},
|
||||
{
|
||||
"pattern": "gemma-3",
|
||||
"family": "gemma-3"
|
||||
},
|
||||
{
|
||||
"pattern": "gemma-2",
|
||||
"family": "gemma-2"
|
||||
},
|
||||
{
|
||||
"pattern": "gemma",
|
||||
"family": "gemma"
|
||||
},
|
||||
{
|
||||
"pattern": "mistral-small-3",
|
||||
"family": "mistral-small"
|
||||
},
|
||||
{
|
||||
"pattern": "mistral-7b",
|
||||
"family": "mistral-7b"
|
||||
},
|
||||
{
|
||||
"pattern": "mistral",
|
||||
"family": "mistral"
|
||||
},
|
||||
{
|
||||
"pattern": "granite-4",
|
||||
"family": "granite-4"
|
||||
},
|
||||
{
|
||||
"pattern": "granite",
|
||||
"family": "granite"
|
||||
},
|
||||
{
|
||||
"pattern": "bge-reranker",
|
||||
"family": "bge-reranker"
|
||||
},
|
||||
{
|
||||
"pattern": "bge-m3",
|
||||
"family": "bge-m3"
|
||||
},
|
||||
{
|
||||
"pattern": "bge-large",
|
||||
"family": "bge-large"
|
||||
},
|
||||
{
|
||||
"pattern": "bge-base",
|
||||
"family": "bge-base"
|
||||
},
|
||||
{
|
||||
"pattern": "bge-small",
|
||||
"family": "bge-small"
|
||||
},
|
||||
{
|
||||
"pattern": "aura-2",
|
||||
"family": "aura-2"
|
||||
},
|
||||
{
|
||||
"pattern": "nova-3",
|
||||
"family": "nova"
|
||||
},
|
||||
{
|
||||
"pattern": "bart-large-cnn",
|
||||
"family": "bart"
|
||||
},
|
||||
{
|
||||
"pattern": "distilbert",
|
||||
"family": "distilbert"
|
||||
},
|
||||
{
|
||||
"pattern": "melotts",
|
||||
"family": "melotts"
|
||||
},
|
||||
{
|
||||
"pattern": "m2m100",
|
||||
"family": "m2m100"
|
||||
},
|
||||
{
|
||||
"pattern": "plamo-embedding",
|
||||
"family": "plamo-embedding"
|
||||
},
|
||||
{
|
||||
"pattern": "smart-turn",
|
||||
"family": "smart-turn"
|
||||
},
|
||||
{
|
||||
"pattern": "indictrans2",
|
||||
"family": "indictrans2"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
{
|
||||
"anthropic/claude-3-5-haiku": "Claude 3.5 Haiku",
|
||||
"anthropic/claude-3-haiku": "Claude 3 Haiku",
|
||||
"anthropic/claude-3-opus": "Claude 3 Opus",
|
||||
"anthropic/claude-3-sonnet": "Claude 3 Sonnet",
|
||||
"anthropic/claude-3.5-haiku": "Claude 3.5 Haiku",
|
||||
"anthropic/claude-3.5-sonnet": "Claude 3.5 Sonnet",
|
||||
"anthropic/claude-fable-5": "Claude Fable 5",
|
||||
"anthropic/claude-haiku-4-5": "Claude Haiku 4.5",
|
||||
"anthropic/claude-opus-4": "Claude Opus 4",
|
||||
"anthropic/claude-opus-4-1": "Claude Opus 4.1",
|
||||
"anthropic/claude-opus-4-5": "Claude Opus 4.5",
|
||||
"anthropic/claude-opus-4-6": "Claude Opus 4.6",
|
||||
"anthropic/claude-sonnet-4": "Claude Sonnet 4",
|
||||
"anthropic/claude-sonnet-4-5": "Claude Sonnet 4.5",
|
||||
"openai/gpt-3.5-turbo": "GPT 3.5 Turbo",
|
||||
"openai/gpt-4": "GPT 4",
|
||||
"openai/gpt-4-turbo": "GPT 4 Turbo",
|
||||
"openai/gpt-4o": "GPT 4o",
|
||||
"openai/gpt-4o-mini": "GPT 4o Mini",
|
||||
"openai/gpt-5.1": "GPT 5.1",
|
||||
"openai/gpt-5.1-codex": "GPT 5.1 Codex",
|
||||
"openai/gpt-5.2": "GPT 5.2",
|
||||
"openai/o1": "o1",
|
||||
"openai/o3": "o3",
|
||||
"openai/o3-mini": "o3 Mini",
|
||||
"openai/o3-pro": "o3 Pro",
|
||||
"openai/o4-mini": "o4 Mini",
|
||||
"workers-ai/@cf/ai4bharat/indictrans2-en-indic-1B": "IndicTrans2 EN-Indic 1B",
|
||||
"workers-ai/@cf/aisingapore/gemma-sea-lion-v4-27b-it": "Gemma SEA-LION v4 27B IT",
|
||||
"workers-ai/@cf/baai/bge-base-en-v1.5": "BGE Base EN v1.5",
|
||||
"workers-ai/@cf/baai/bge-large-en-v1.5": "BGE Large EN v1.5",
|
||||
"workers-ai/@cf/baai/bge-m3": "BGE M3",
|
||||
"workers-ai/@cf/baai/bge-reranker-base": "BGE Reranker Base",
|
||||
"workers-ai/@cf/baai/bge-small-en-v1.5": "BGE Small EN v1.5",
|
||||
"workers-ai/@cf/deepgram/aura-2-en": "Deepgram Aura 2 (EN)",
|
||||
"workers-ai/@cf/deepgram/aura-2-es": "Deepgram Aura 2 (ES)",
|
||||
"workers-ai/@cf/deepgram/nova-3": "Deepgram Nova 3",
|
||||
"workers-ai/@cf/deepseek-ai/deepseek-r1-distill-qwen-32b": "DeepSeek R1 Distill Qwen 32B",
|
||||
"workers-ai/@cf/facebook/bart-large-cnn": "BART Large CNN",
|
||||
"workers-ai/@cf/google/gemma-3-12b-it": "Gemma 3 12B IT",
|
||||
"workers-ai/@cf/huggingface/distilbert-sst-2-int8": "DistilBERT SST-2 INT8",
|
||||
"workers-ai/@cf/ibm-granite/granite-4.0-h-micro": "IBM Granite 4.0 H Micro",
|
||||
"workers-ai/@cf/meta/llama-2-7b-chat-fp16": "Llama 2 7B Chat FP16",
|
||||
"workers-ai/@cf/meta/llama-3-8b-instruct": "Llama 3 8B Instruct",
|
||||
"workers-ai/@cf/meta/llama-3-8b-instruct-awq": "Llama 3 8B Instruct AWQ",
|
||||
"workers-ai/@cf/meta/llama-3.1-8b-instruct": "Llama 3.1 8B Instruct",
|
||||
"workers-ai/@cf/meta/llama-3.1-8b-instruct-awq": "Llama 3.1 8B Instruct AWQ",
|
||||
"workers-ai/@cf/meta/llama-3.1-8b-instruct-fp8": "Llama 3.1 8B Instruct FP8",
|
||||
"workers-ai/@cf/meta/llama-3.2-11b-vision-instruct": "Llama 3.2 11B Vision Instruct",
|
||||
"workers-ai/@cf/meta/llama-3.2-1b-instruct": "Llama 3.2 1B Instruct",
|
||||
"workers-ai/@cf/meta/llama-3.2-3b-instruct": "Llama 3.2 3B Instruct",
|
||||
"workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast": "Llama 3.3 70B Instruct FP8 Fast",
|
||||
"workers-ai/@cf/meta/llama-4-scout-17b-16e-instruct": "Llama 4 Scout 17B 16E Instruct",
|
||||
"workers-ai/@cf/meta/llama-guard-3-8b": "Llama Guard 3 8B",
|
||||
"workers-ai/@cf/meta/m2m100-1.2b": "M2M100 1.2B",
|
||||
"workers-ai/@cf/mistral/mistral-7b-instruct-v0.1": "Mistral 7B Instruct v0.1",
|
||||
"workers-ai/@cf/mistralai/mistral-small-3.1-24b-instruct": "Mistral Small 3.1 24B Instruct",
|
||||
"workers-ai/@cf/myshell-ai/melotts": "MyShell MeloTTS",
|
||||
"workers-ai/@cf/openai/gpt-oss-120b": "GPT OSS 120B",
|
||||
"workers-ai/@cf/openai/gpt-oss-20b": "GPT OSS 20B",
|
||||
"workers-ai/@cf/pfnet/plamo-embedding-1b": "PLaMo Embedding 1B",
|
||||
"workers-ai/@cf/pipecat-ai/smart-turn-v2": "Pipecat Smart Turn v2",
|
||||
"workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct": "Qwen 2.5 Coder 32B Instruct",
|
||||
"workers-ai/@cf/qwen/qwen3-30b-a3b-fp8": "Qwen3 30B A3B FP8",
|
||||
"workers-ai/@cf/qwen/qwen3-embedding-0.6b": "Qwen3 Embedding 0.6B",
|
||||
"workers-ai/@cf/qwen/qwq-32b": "QwQ 32B"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
base_model = "alibaba/qwen3-max"
|
||||
|
||||
[cost]
|
||||
input = 1.2
|
||||
output = 6
|
||||
@@ -0,0 +1,14 @@
|
||||
# Toggle: enable_thinking true|false.
|
||||
# Budget: thinking_budget (integer reasoning tokens).
|
||||
|
||||
base_model = "alibaba/qwen3.5-397b-a17b"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
|
||||
[cost]
|
||||
input = 0.6
|
||||
output = 3.6
|
||||
@@ -0,0 +1,15 @@
|
||||
# Toggle: enable_thinking true|false.
|
||||
# Budget: thinking_budget (integer reasoning tokens).
|
||||
|
||||
base_model = "alibaba/qwen3.7-max"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
|
||||
[cost]
|
||||
input = 1.25
|
||||
output = 3.75
|
||||
cache_read = 0.25
|
||||
@@ -0,0 +1,15 @@
|
||||
# Toggle: enable_thinking true|false.
|
||||
# Budget: thinking_budget (integer reasoning tokens).
|
||||
|
||||
base_model = "alibaba/qwen3.7-plus"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
|
||||
[cost]
|
||||
input = 0.32
|
||||
output = 1.28
|
||||
cache_read = 0.064
|
||||
@@ -0,0 +1,25 @@
|
||||
# Toggle: enable_thinking true|false (hybrid).
|
||||
# Effort: reasoning_effort = low|medium|xhigh (default xhigh); high accepted as alias -> xhigh.
|
||||
# Budget: thinking_budget (0..262144) cannot be combined with reasoning_effort.
|
||||
|
||||
base_model = "alibaba/qwen3.8-max"
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["low", "medium", "xhigh"]
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = 0
|
||||
max = 262_144
|
||||
|
||||
[cost]
|
||||
input = 2
|
||||
output = 6
|
||||
cache_read = 0.25
|
||||
@@ -1,5 +1,4 @@
|
||||
base_model = "anthropic/claude-fable-5"
|
||||
release_date = "2026-06-07"
|
||||
structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
@@ -11,3 +10,9 @@ input = 10
|
||||
output = 50
|
||||
cache_read = 1
|
||||
cache_write = 12.5
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -3,10 +3,16 @@ structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = 1024
|
||||
min = 1_024
|
||||
|
||||
[cost]
|
||||
input = 1
|
||||
output = 5
|
||||
cache_read = 0.1
|
||||
cache_write = 1.25
|
||||
|
||||
[limit]
|
||||
context = 200_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -7,10 +7,16 @@ values = ["low", "medium", "high"]
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = 1024
|
||||
min = 1_024
|
||||
|
||||
[cost]
|
||||
input = 5
|
||||
output = 25
|
||||
cache_read = 0.5
|
||||
cache_write = 6.25
|
||||
|
||||
[limit]
|
||||
context = 200_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -1,5 +1,4 @@
|
||||
base_model = "anthropic/claude-opus-4-6"
|
||||
release_date = "2026-02-04"
|
||||
structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
@@ -8,10 +7,16 @@ values = ["low", "medium", "high", "max"]
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = 1024
|
||||
min = 1_024
|
||||
|
||||
[cost]
|
||||
input = 5
|
||||
output = 25
|
||||
cache_read = 0.5
|
||||
cache_write = 6.25
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -1,5 +1,4 @@
|
||||
base_model = "anthropic/claude-opus-4-7"
|
||||
release_date = "2026-04-14"
|
||||
structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
@@ -12,5 +11,8 @@ output = 25
|
||||
cache_read = 0.5
|
||||
cache_write = 6.25
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -10,3 +10,9 @@ input = 5
|
||||
output = 25
|
||||
cache_read = 0.5
|
||||
cache_write = 6.25
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -10,3 +10,9 @@ input = 5
|
||||
output = 25
|
||||
cache_read = 0.5
|
||||
cache_write = 6.25
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -3,7 +3,7 @@ structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = 1024
|
||||
min = 1_024
|
||||
|
||||
[cost]
|
||||
input = 3
|
||||
@@ -12,4 +12,7 @@ cache_read = 0.3
|
||||
cache_write = 3.75
|
||||
|
||||
[limit]
|
||||
context = 1000000
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -7,7 +7,7 @@ values = ["low", "medium", "high", "max"]
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = 1024
|
||||
min = 1_024
|
||||
|
||||
[cost]
|
||||
input = 3
|
||||
@@ -16,8 +16,8 @@ cache_read = 0.3
|
||||
cache_write = 3.75
|
||||
|
||||
[limit]
|
||||
context = 1000000
|
||||
output = 128000
|
||||
context = 1_000_000
|
||||
output = 128_000
|
||||
|
||||
[provider]
|
||||
npm = "ai-gateway-provider"
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -1,5 +1,7 @@
|
||||
# Toggle: thinking.type = adaptive|disabled.
|
||||
# Effort: output_config.effort = low|medium|high|xhigh|max.
|
||||
|
||||
base_model = "anthropic/claude-sonnet-5"
|
||||
release_date = "2026-06-29"
|
||||
structured_output = true
|
||||
|
||||
[[reasoning_options]]
|
||||
@@ -14,3 +16,9 @@ input = 2
|
||||
output = 10
|
||||
cache_read = 0.2
|
||||
cache_write = 2.5
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
@@ -0,0 +1,19 @@
|
||||
# Toggle: thinking.type = enabled|disabled.
|
||||
# Effort: reasoning_effort = high|max.
|
||||
|
||||
base_model = "deepseek/deepseek-v4-pro"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high", "max"]
|
||||
|
||||
[cost]
|
||||
input = 1.74
|
||||
output = 3.48
|
||||
cache_read = 0.145
|
||||
|
||||
[limit]
|
||||
context = 131_072
|
||||
@@ -0,0 +1,19 @@
|
||||
# API: thinking.type = enabled|disabled|adaptive; in adaptive mode the
|
||||
# reasoning depth is set by output_config.effort = low|high|max.
|
||||
|
||||
base_model = "moonshotai/kimi-k3"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["low", "high", "max"]
|
||||
|
||||
[cost]
|
||||
input = 3
|
||||
output = 15
|
||||
cache_read = 0.3
|
||||
|
||||
[limit]
|
||||
context = 1_048_576
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "openai/gpt-3.5-turbo"
|
||||
status = "deprecated"
|
||||
|
||||
[cost]
|
||||
input = 0.5
|
||||
output = 1.5
|
||||
cache_read = 0
|
||||
@@ -1,6 +0,0 @@
|
||||
base_model = "openai/gpt-4-turbo"
|
||||
status = "deprecated"
|
||||
|
||||
[cost]
|
||||
input = 10
|
||||
output = 30
|
||||
@@ -4,3 +4,9 @@ base_model = "openai/gpt-4.1-mini"
|
||||
input = 0.4
|
||||
output = 1.6
|
||||
cache_read = 0.1
|
||||
|
||||
[limit]
|
||||
context = 1_047_576
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -1,7 +1,12 @@
|
||||
base_model = "openai/gpt-4.1-nano"
|
||||
status = "deprecated"
|
||||
|
||||
[cost]
|
||||
input = 0.1
|
||||
output = 0.4
|
||||
cache_read = 0.025
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -4,3 +4,9 @@ base_model = "openai/gpt-4.1"
|
||||
input = 2
|
||||
output = 8
|
||||
cache_read = 0.5
|
||||
|
||||
[limit]
|
||||
context = 1_047_576
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -1,6 +0,0 @@
|
||||
base_model = "openai/gpt-4"
|
||||
status = "deprecated"
|
||||
|
||||
[cost]
|
||||
input = 30
|
||||
output = 60
|
||||
@@ -4,3 +4,9 @@ base_model = "openai/gpt-4o-mini"
|
||||
input = 0.075
|
||||
output = 0.3
|
||||
cache_read = 0.0375
|
||||
|
||||
[limit]
|
||||
context = 128_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -4,3 +4,9 @@ base_model = "openai/gpt-4o"
|
||||
input = 1.25
|
||||
output = 5
|
||||
cache_read = 0.625
|
||||
|
||||
[limit]
|
||||
context = 128_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -8,3 +8,9 @@ values = ["minimal", "low", "medium", "high"]
|
||||
input = 0.25
|
||||
output = 2
|
||||
cache_read = 0.025
|
||||
|
||||
[limit]
|
||||
context = 128_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -8,3 +8,9 @@ values = ["minimal", "low", "medium", "high"]
|
||||
input = 0.05
|
||||
output = 0.4
|
||||
cache_read = 0.005
|
||||
|
||||
[limit]
|
||||
context = 128_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -1,9 +0,0 @@
|
||||
base_model = "openai/gpt-5-pro"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high"]
|
||||
|
||||
[cost]
|
||||
input = 15
|
||||
output = 120
|
||||
@@ -8,3 +8,9 @@ values = ["none", "low", "medium", "high"]
|
||||
input = 1.25
|
||||
output = 10
|
||||
cache_read = 0.125
|
||||
|
||||
[limit]
|
||||
context = 128_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai"
|
||||
@@ -1,10 +0,0 @@
|
||||
base_model = "openai/gpt-5.2-chat-latest"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["medium"]
|
||||
|
||||
[cost]
|
||||
input = 1.75
|
||||
output = 14
|
||||
cache_read = 0.175
|
||||
@@ -1,9 +0,0 @@
|
||||
base_model = "openai/gpt-5.2-pro"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["medium", "high", "xhigh"]
|
||||
|
||||
[cost]
|
||||
input = 21
|
||||
output = 168
|
||||
@@ -1,10 +0,0 @@
|
||||
base_model = "openai/gpt-5.2"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["none", "low", "medium", "high", "xhigh"]
|
||||
|
||||
[cost]
|
||||
input = 1.75
|
||||
output = 14
|
||||
cache_read = 0.175
|
||||
@@ -1,6 +0,0 @@
|
||||
base_model = "openai/gpt-5.3-chat-latest"
|
||||
|
||||
[cost]
|
||||
input = 1.75
|
||||
output = 14
|
||||
cache_read = 0.175
|
||||
Loaded 100 of 730 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user