Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa4d6d2b4f |
No files matched your search
@@ -64,7 +64,6 @@ jobs:
|
||||
run: bun models:sync ${{ matrix.provider }}
|
||||
env:
|
||||
BASETEN_API_KEY: ${{ secrets.BASETEN_API_KEY }}
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
||||
VENICE_API_KEY: ${{ secrets.VENICE_API_KEY }}
|
||||
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
name = "Qwen3.5 9B"
|
||||
family = "qwen"
|
||||
release_date = "2026-02-23"
|
||||
last_updated = "2026-02-23"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = true
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 65_536
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/Qwen/Qwen3.5-9B"
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "Command R7B"
|
||||
family = "command-r"
|
||||
release_date = "2024-12-02"
|
||||
last_updated = "2024-12-02"
|
||||
release_date = "2024-02-27"
|
||||
last_updated = "2024-02-27"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
name = "Gemma 4 E2B IT"
|
||||
family = "gemma"
|
||||
release_date = "2026-04-02"
|
||||
last_updated = "2026-04-02"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = true
|
||||
|
||||
[limit]
|
||||
context = 131_072
|
||||
output = 8_192
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "audio"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/google/gemma-4-E2B-it"
|
||||
@@ -1,22 +0,0 @@
|
||||
name = "Gemma 4 E4B IT"
|
||||
family = "gemma"
|
||||
release_date = "2026-04-02"
|
||||
last_updated = "2026-04-02"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = true
|
||||
|
||||
[limit]
|
||||
context = 131_072
|
||||
output = 8_192
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "audio"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/google/gemma-4-E4B-it"
|
||||
@@ -6,7 +6,7 @@ attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 512_000
|
||||
@@ -15,7 +15,3 @@ output = 128_000
|
||||
[modalities]
|
||||
input = ["text", "image", "video"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/MiniMaxAI/MiniMax-M3"
|
||||
@@ -1,23 +0,0 @@
|
||||
name = "Kimi K2.7 Code Highspeed"
|
||||
family = "kimi-k2"
|
||||
release_date = "2026-06-12"
|
||||
last_updated = "2026-06-12"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = false
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
knowledge = "2025-01"
|
||||
open_weights = true
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 262_144
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "video"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/moonshotai/Kimi-K2.7-Code"
|
||||
@@ -1,17 +0,0 @@
|
||||
name = "GPT-Image-1.5"
|
||||
family = "gpt-image"
|
||||
release_date = "2025-11-25"
|
||||
last_updated = "2025-11-25"
|
||||
attachment = true
|
||||
reasoning = false
|
||||
temperature = false
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 0
|
||||
output = 0
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text", "image"]
|
||||
@@ -1,17 +0,0 @@
|
||||
name = "GPT-Image-1"
|
||||
family = "gpt-image"
|
||||
release_date = "2025-04-24"
|
||||
last_updated = "2025-04-24"
|
||||
attachment = true
|
||||
reasoning = false
|
||||
temperature = false
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 0
|
||||
output = 0
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["image"]
|
||||
@@ -1,17 +0,0 @@
|
||||
name = "GPT-Image-2"
|
||||
family = "gpt-image"
|
||||
release_date = "2026-04-21"
|
||||
last_updated = "2026-04-21"
|
||||
attachment = true
|
||||
reasoning = false
|
||||
temperature = false
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 0
|
||||
output = 0
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["image"]
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "GLM-5.1"
|
||||
family = "glm"
|
||||
release_date = "2026-04-07"
|
||||
last_updated = "2026-04-07"
|
||||
release_date = "2026-03-27"
|
||||
last_updated = "2026-03-27"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
|
||||
@@ -7,7 +7,7 @@ reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
open_weights = true
|
||||
open_weights = false
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
@@ -16,7 +16,3 @@ output = 131_072
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[[weights]]
|
||||
label = "Hugging Face"
|
||||
url = "https://huggingface.co/zai-org/GLM-5.2"
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "GLM-5"
|
||||
family = "glm"
|
||||
release_date = "2026-02-12"
|
||||
last_updated = "2026-02-12"
|
||||
release_date = "2026-02-11"
|
||||
last_updated = "2026-02-11"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
"chutes:generate": "bun ./packages/core/script/generate-chutes.ts",
|
||||
"databricks:generate": "bun ./packages/core/script/generate-databricks.ts",
|
||||
"helicone:generate": "bun ./packages/core/script/generate-helicone.ts",
|
||||
"huggingface:sync": "bun ./packages/core/script/sync-models.ts huggingface",
|
||||
"venice:sync": "bun ./packages/core/script/sync-models.ts venice",
|
||||
"vercel:generate": "bun ./packages/core/script/sync-models.ts vercel",
|
||||
"wandb:generate": "bun ./packages/core/script/generate-wandb.ts",
|
||||
|
||||
@@ -769,7 +769,7 @@ async function main() {
|
||||
cwd: modelsDir,
|
||||
absolute: false,
|
||||
})) {
|
||||
existingFiles.add(file.split(path.sep).join("/"));
|
||||
existingFiles.add(file);
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
|
||||
@@ -246,9 +246,6 @@ export const ModelFamilyValues = [
|
||||
// Lucid
|
||||
"lucid",
|
||||
|
||||
// LucidQuery
|
||||
"agi",
|
||||
|
||||
// Intellect
|
||||
"intellect",
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function generateModels(directory: string) {
|
||||
absolute: true,
|
||||
followSymlinks: true,
|
||||
})) {
|
||||
const modelID = path.relative(directory, modelPath).split(path.sep).join("/").slice(0, -5);
|
||||
const modelID = path.relative(directory, modelPath).slice(0, -5);
|
||||
const toml = await import(modelPath, {
|
||||
with: {
|
||||
type: "toml",
|
||||
@@ -94,7 +94,7 @@ async function generateProviders(
|
||||
absolute: true,
|
||||
followSymlinks: true,
|
||||
})) {
|
||||
const modelID = path.relative(modelsPath, modelPath).split(path.sep).join("/").slice(0, -5);
|
||||
const modelID = path.relative(modelsPath, modelPath).slice(0, -5);
|
||||
const toml = await import(modelPath, {
|
||||
with: {
|
||||
type: "toml",
|
||||
|
||||
@@ -7,7 +7,6 @@ import { AuthoredModel, AuthoredModelShape, ModelMetadata } from "../schema.js";
|
||||
import { baseten } from "./providers/baseten.js";
|
||||
import { cloudflareWorkersAi } from "./providers/cloudflare-workers-ai.js";
|
||||
import { google } from "./providers/google.js";
|
||||
import { huggingface } from "./providers/huggingface.js";
|
||||
import { openrouter } from "./providers/openrouter.js";
|
||||
import { ovhcloud } from "./providers/ovhcloud.js";
|
||||
import { vercel } from "./providers/vercel.js";
|
||||
@@ -81,7 +80,6 @@ export const providers: {
|
||||
baseten: SyncProvider<any>;
|
||||
"cloudflare-workers-ai": SyncProvider<any>;
|
||||
google: SyncProvider<any>;
|
||||
huggingface: SyncProvider<any>;
|
||||
openrouter: SyncProvider<any>;
|
||||
ovhcloud: SyncProvider<any>;
|
||||
vercel: SyncProvider<any>;
|
||||
@@ -91,7 +89,6 @@ export const providers: {
|
||||
baseten,
|
||||
"cloudflare-workers-ai": cloudflareWorkersAi,
|
||||
google,
|
||||
huggingface,
|
||||
openrouter,
|
||||
ovhcloud,
|
||||
vercel,
|
||||
@@ -100,7 +97,7 @@ export const providers: {
|
||||
};
|
||||
|
||||
export const groups = {
|
||||
aggregators: ["huggingface", "openrouter", "vercel"],
|
||||
aggregators: ["openrouter", "vercel"],
|
||||
cloudflare: ["cloudflare-workers-ai"],
|
||||
direct: ["baseten", "google", "ovhcloud", "venice", "xai"],
|
||||
} as const;
|
||||
|
||||
@@ -1,245 +0,0 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import type { ExistingModel, SyncProvider, SyncedFullModel, SyncedModel } from "../index.js";
|
||||
import { factorBaseModel, resolveCanonicalBaseModel } from "./openrouter.js";
|
||||
|
||||
const API_ENDPOINT = "https://router.huggingface.co/v1/models";
|
||||
|
||||
// Hugging Face org prefixes mapped to the canonical metadata prefixes understood
|
||||
// by resolveCanonicalBaseModel. Anything not listed falls back to a direct lookup.
|
||||
const CANONICAL_ORG_PREFIXES: Record<string, string> = {
|
||||
CohereLabs: "cohere",
|
||||
"deepseek-ai": "deepseek",
|
||||
google: "google",
|
||||
"meta-llama": "meta-llama",
|
||||
MiniMaxAI: "minimax",
|
||||
moonshotai: "moonshotai",
|
||||
nvidia: "nvidia",
|
||||
Qwen: "qwen",
|
||||
"stepfun-ai": "stepfun",
|
||||
XiaomiMiMo: "xiaomi",
|
||||
"zai-org": "zai",
|
||||
};
|
||||
|
||||
const HuggingFaceProvider = z.object({
|
||||
provider: z.string(),
|
||||
status: z.string(),
|
||||
context_length: z.number().int().positive().optional(),
|
||||
pricing: z.object({
|
||||
input: z.number(),
|
||||
output: z.number(),
|
||||
}).passthrough().optional(),
|
||||
throughput: z.number().nonnegative().optional(),
|
||||
first_token_latency_ms: z.number().nonnegative().optional(),
|
||||
is_free: z.boolean().optional(),
|
||||
supports_tools: z.boolean().optional(),
|
||||
supports_structured_output: z.boolean().optional(),
|
||||
is_model_author: z.boolean().optional(),
|
||||
}).passthrough();
|
||||
|
||||
export const HuggingFaceModel = z.object({
|
||||
id: z.string().min(1),
|
||||
created: z.number().optional(),
|
||||
owned_by: z.string().optional(),
|
||||
architecture: z.object({
|
||||
input_modalities: z.array(z.string()),
|
||||
output_modalities: z.array(z.string()),
|
||||
}).passthrough(),
|
||||
providers: z.array(HuggingFaceProvider),
|
||||
}).passthrough();
|
||||
|
||||
export const HuggingFaceResponse = z.object({
|
||||
data: z.array(HuggingFaceModel),
|
||||
}).passthrough();
|
||||
|
||||
export type HuggingFaceModel = z.infer<typeof HuggingFaceModel>;
|
||||
export type HuggingFaceProvider = z.infer<typeof HuggingFaceProvider>;
|
||||
|
||||
export const huggingface = {
|
||||
id: "huggingface",
|
||||
name: "Hugging Face",
|
||||
modelsDir: "providers/huggingface/models",
|
||||
deleteMissing: false,
|
||||
sourceID(model) {
|
||||
return model.id;
|
||||
},
|
||||
skippedNotice(ids) {
|
||||
if (ids.length === 0) return [];
|
||||
return [
|
||||
`${ids.length} Hugging Face Inference Providers models were not created because their IDs could not be mapped to provider-agnostic metadata, had no live provider, or had no priced provider.`,
|
||||
`Skipped remote IDs: ${ids.map((id) => `\`${id}\``).join(", ")}`,
|
||||
];
|
||||
},
|
||||
missingNotice(paths) {
|
||||
if (paths.length === 0) return [];
|
||||
return [
|
||||
`${paths.length} local Hugging Face models were absent from the Inference Providers catalog and were retained for manual lifecycle review.`,
|
||||
`Retained local paths: ${paths.map((item) => `\`${item}\``).join(", ")}`,
|
||||
];
|
||||
},
|
||||
async fetchModels() {
|
||||
const headers = process.env.HF_TOKEN
|
||||
? { Authorization: `Bearer ${process.env.HF_TOKEN}` }
|
||||
: undefined;
|
||||
const response = await fetch(API_ENDPOINT, { headers });
|
||||
if (!response.ok) {
|
||||
throw new Error(`Hugging Face models request failed: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
return response.json();
|
||||
},
|
||||
parseModels(raw) {
|
||||
return HuggingFaceResponse.parse(raw).data;
|
||||
},
|
||||
translateModel(model, context) {
|
||||
if (!model.providers.some((provider) => provider.status === "live")) return undefined;
|
||||
|
||||
const existing = context.existing(model.id);
|
||||
const baseModel = existing === undefined
|
||||
? resolveHuggingFaceBaseModel(model.id)
|
||||
: existing.base_model;
|
||||
if (existing === undefined && baseModel === undefined) return undefined;
|
||||
|
||||
// The router only exposes pricing per inference provider, so a new model with
|
||||
// no priced provider cannot be created with a meaningful cost.
|
||||
const aggregate = aggregateProviders(model);
|
||||
if (existing === undefined && aggregate.cost === undefined) return undefined;
|
||||
|
||||
return {
|
||||
id: model.id,
|
||||
model: buildHuggingFaceModel(model, existing, baseModel, aggregate),
|
||||
};
|
||||
},
|
||||
sameModel() {
|
||||
// For now the sync only creates new models; existing curated TOMLs are left
|
||||
// untouched. Treating every existing model as already in sync skips updates
|
||||
// while still allowing new files to be created.
|
||||
return true;
|
||||
},
|
||||
} satisfies SyncProvider<HuggingFaceModel>;
|
||||
|
||||
interface Aggregate {
|
||||
cost: { input: number; output: number } | undefined;
|
||||
context: number | undefined;
|
||||
tools: boolean;
|
||||
structuredOutput: boolean;
|
||||
}
|
||||
|
||||
function price(value: number) {
|
||||
return Number.isFinite(value) && value >= 0
|
||||
? Math.round(value * 1_000_000) / 1_000_000
|
||||
: undefined;
|
||||
}
|
||||
|
||||
// The router aggregates several inference providers per model and sends traffic to
|
||||
// the fastest one, so this collapses them into the route a request would actually
|
||||
// take: pricing and context from the highest-throughput provider, plus capabilities
|
||||
// advertised by any provider (a caller can always pin a slower provider).
|
||||
function aggregateProviders(model: HuggingFaceModel): Aggregate {
|
||||
const providers = model.providers.filter((provider) => provider.status === "live");
|
||||
|
||||
const byThroughput = (a: HuggingFaceProvider, b: HuggingFaceProvider) =>
|
||||
(b.throughput ?? -Infinity) - (a.throughput ?? -Infinity);
|
||||
// The provider the router routes to (fastest). Take its price when it reports one;
|
||||
// otherwise fall back to the fastest provider that does, so a new model can still
|
||||
// be costed.
|
||||
const routed = [...providers].sort(byThroughput).at(0);
|
||||
const costProvider = routed?.pricing !== undefined
|
||||
? routed
|
||||
: [...providers]
|
||||
.filter((provider): provider is HuggingFaceProvider & { pricing: { input: number; output: number } } =>
|
||||
provider.pricing !== undefined)
|
||||
.sort(byThroughput)
|
||||
.at(0);
|
||||
const input = costProvider?.pricing === undefined ? undefined : price(costProvider.pricing.input);
|
||||
const output = costProvider?.pricing === undefined ? undefined : price(costProvider.pricing.output);
|
||||
|
||||
const contexts = providers
|
||||
.map((provider) => provider.context_length)
|
||||
.filter((value): value is number => value !== undefined);
|
||||
|
||||
return {
|
||||
cost: input !== undefined && output !== undefined ? { input, output } : undefined,
|
||||
context: routed?.context_length ?? (contexts.length > 0 ? Math.max(...contexts) : undefined),
|
||||
tools: providers.some((provider) => provider.supports_tools === true),
|
||||
structuredOutput: providers.some((provider) => provider.supports_structured_output === true),
|
||||
};
|
||||
}
|
||||
|
||||
type Modality = "text" | "audio" | "image" | "video" | "pdf";
|
||||
|
||||
function modalities(values: string[], fallback: Modality[]): Modality[] {
|
||||
const allowed = new Set<Modality>(["text", "audio", "image", "video", "pdf"]);
|
||||
const result = values
|
||||
.map((value) => value.toLowerCase())
|
||||
.filter((value): value is Modality => allowed.has(value as Modality));
|
||||
return [...new Set(result.length > 0 ? result : fallback)];
|
||||
}
|
||||
|
||||
export function buildHuggingFaceModel(
|
||||
model: HuggingFaceModel,
|
||||
existing: ExistingModel | undefined,
|
||||
baseModel = existing === undefined ? resolveHuggingFaceBaseModel(model.id) : existing.base_model,
|
||||
aggregate: Aggregate = aggregateProviders(model),
|
||||
): SyncedModel {
|
||||
const input = modalities(model.architecture.input_modalities, existing?.modalities?.input ?? ["text"]);
|
||||
const output = modalities(model.architecture.output_modalities, existing?.modalities?.output ?? ["text"]);
|
||||
// Pricing is curated: keep what was authored and only fall back to the router
|
||||
// (fastest route) when the local model has no cost yet.
|
||||
const cost = existing?.cost ?? aggregate.cost;
|
||||
// context/output may be unset for a freshly created base_model entry, in which case
|
||||
// factorBaseModel inherits them from the canonical metadata; the standalone-model
|
||||
// path below validates their presence at runtime.
|
||||
const limit = {
|
||||
context: existing?.limit?.context ?? aggregate.context,
|
||||
input: existing?.limit?.input,
|
||||
output: existing?.limit?.output,
|
||||
} as SyncedFullModel["limit"];
|
||||
const values: Partial<SyncedFullModel> = {
|
||||
name: existing?.name,
|
||||
family: existing?.family,
|
||||
release_date: existing?.release_date,
|
||||
last_updated: existing?.last_updated,
|
||||
attachment: input.some((value) => value !== "text"),
|
||||
reasoning: existing?.reasoning,
|
||||
reasoning_options: existing?.reasoning_options,
|
||||
temperature: existing?.temperature,
|
||||
tool_call: aggregate.tools || existing?.tool_call || undefined,
|
||||
structured_output: aggregate.structuredOutput || existing?.structured_output || undefined,
|
||||
knowledge: existing?.knowledge,
|
||||
open_weights: existing?.open_weights ?? true,
|
||||
status: existing?.status,
|
||||
interleaved: existing?.interleaved,
|
||||
cost,
|
||||
limit,
|
||||
modalities: { input, output },
|
||||
};
|
||||
|
||||
if (baseModel !== undefined) {
|
||||
return factorBaseModel(baseModel, values, limit, existing?.base_model_omit);
|
||||
}
|
||||
|
||||
// Standalone (non base_model) models require concrete booleans the router does
|
||||
// not always report; default the capability flags it leaves out.
|
||||
const full = { ...values, tool_call: values.tool_call ?? false };
|
||||
const required = z.object({
|
||||
name: z.string(),
|
||||
release_date: z.string(),
|
||||
last_updated: z.string(),
|
||||
reasoning: z.boolean(),
|
||||
open_weights: z.boolean(),
|
||||
cost: z.object({ input: z.number(), output: z.number() }),
|
||||
limit: z.object({ context: z.number(), output: z.number() }),
|
||||
}).safeParse(full);
|
||||
if (!required.success) {
|
||||
throw new Error(`Hugging Face model ${model.id} has incomplete local metadata required for sync`);
|
||||
}
|
||||
return full as SyncedFullModel;
|
||||
}
|
||||
|
||||
export function resolveHuggingFaceBaseModel(id: string) {
|
||||
const [prefix, ...parts] = id.split("/");
|
||||
if (prefix === undefined || parts.length === 0) return undefined;
|
||||
const canonicalPrefix = CANONICAL_ORG_PREFIXES[prefix];
|
||||
if (canonicalPrefix === undefined) return resolveCanonicalBaseModel(id);
|
||||
return resolveCanonicalBaseModel(`${canonicalPrefix}/${parts.join("/").toLowerCase()}`);
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import type { ExistingModel, SyncProvider, SyncedFullModel, SyncedModel } from "
|
||||
|
||||
const API_ENDPOINT = "https://openrouter.ai/api/v1/models";
|
||||
const MODELS_DIR = path.join(import.meta.dirname, "..", "..", "..", "..", "..", "models");
|
||||
const MODEL_NAME_BLACKLIST = ["fable-5"];
|
||||
const modelMetadataByID = new Map<string, Record<string, unknown>>();
|
||||
const modelMetadataFilesByProvider = new Map<string, Set<string>>();
|
||||
|
||||
@@ -80,10 +79,7 @@ export const openrouter = {
|
||||
return response.json();
|
||||
},
|
||||
parseModels(raw) {
|
||||
return OpenRouterResponse.parse(raw).data.filter((model) => {
|
||||
const name = `${model.id} ${model.name}`.toLowerCase();
|
||||
return MODEL_NAME_BLACKLIST.every((value) => !name.includes(value));
|
||||
});
|
||||
return OpenRouterResponse.parse(raw).data;
|
||||
},
|
||||
translateModel(model, context) {
|
||||
return {
|
||||
|
||||
@@ -6,16 +6,7 @@ import { factorBaseModel, resolveCanonicalBaseModel } from "./openrouter.js";
|
||||
|
||||
const API_ENDPOINT = "https://ai-gateway.vercel.sh/v1/models";
|
||||
|
||||
const ModelType = z.enum([
|
||||
"language",
|
||||
"embedding",
|
||||
"image",
|
||||
"video",
|
||||
"reranking",
|
||||
"transcription",
|
||||
"speech",
|
||||
"realtime",
|
||||
]);
|
||||
const ModelType = z.enum(["language", "embedding", "image", "video", "reranking"]);
|
||||
|
||||
const PricingTier = z.object({
|
||||
cost: z.string(),
|
||||
@@ -39,8 +30,8 @@ export const VercelModel = z.object({
|
||||
name: z.string(),
|
||||
created: z.number(),
|
||||
released: z.number().optional(),
|
||||
context_window: z.number().optional().default(0),
|
||||
max_tokens: z.number().optional().default(0),
|
||||
context_window: z.number(),
|
||||
max_tokens: z.number(),
|
||||
type: ModelType,
|
||||
tags: z.array(z.string()).optional().default([]),
|
||||
pricing: Pricing.optional(),
|
||||
@@ -116,17 +107,9 @@ export function buildVercelModel(model: VercelModel, existing: ExistingModel | u
|
||||
cost,
|
||||
limit: { context, input, output },
|
||||
modalities: {
|
||||
input: model.type === "transcription"
|
||||
? ["audio"]
|
||||
: model.type === "realtime"
|
||||
? ["text", "audio"]
|
||||
: ["text", tags.has("vision") ? "image" : undefined, tags.has("file-input") ? "pdf" : undefined]
|
||||
.filter((value): value is "text" | "image" | "pdf" => value !== undefined),
|
||||
output: model.type === "speech"
|
||||
? ["audio"]
|
||||
: model.type === "realtime"
|
||||
? ["text", "audio"]
|
||||
: model.type === "image"
|
||||
input: ["text", tags.has("vision") ? "image" : undefined, tags.has("file-input") ? "pdf" : undefined]
|
||||
.filter((value): value is "text" | "image" | "pdf" => value !== undefined),
|
||||
output: model.type === "image"
|
||||
? ["image"]
|
||||
: model.type === "video"
|
||||
? ["video"]
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
import { afterEach, expect, test } from "bun:test";
|
||||
import path from "node:path";
|
||||
import { mkdir, mkdtemp } from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
|
||||
import { syncProvider } from "../src/sync/index.js";
|
||||
import {
|
||||
BasetenResponse,
|
||||
baseten,
|
||||
buildBasetenModel,
|
||||
fetchBasetenModels,
|
||||
type BasetenModel,
|
||||
} from "../src/sync/providers/baseten.js";
|
||||
|
||||
const catalogModel: BasetenModel = {
|
||||
id: "zai-org/GLM-5.1",
|
||||
name: "GLM 5.1",
|
||||
context_length: 128_000,
|
||||
max_completion_tokens: 32_000,
|
||||
input_modalities: ["text"],
|
||||
output_modalities: ["text"],
|
||||
pricing: {
|
||||
prompt: "0.00000012",
|
||||
completion: "0.0000005",
|
||||
},
|
||||
supported_features: ["reasoning", "reasoning_effort", "tools", "structured_outputs"],
|
||||
supported_sampling_parameters: ["temperature", "top_p"],
|
||||
};
|
||||
|
||||
const newCatalogModel: BasetenModel = {
|
||||
...catalogModel,
|
||||
};
|
||||
|
||||
afterEach(() => {
|
||||
baseten.modelsDir = "providers/baseten/models";
|
||||
baseten.fetchModels = async () => {
|
||||
const key = process.env.BASETEN_API_KEY;
|
||||
if (key === undefined) throw new Error("Baseten sync requires BASETEN_API_KEY");
|
||||
return fetchBasetenModels(key);
|
||||
};
|
||||
});
|
||||
|
||||
test("Baseten maps authoritative fields and preserves curated metadata", () => {
|
||||
const synced = buildBasetenModel(catalogModel, {
|
||||
name: "Old name",
|
||||
release_date: "2025-08-05",
|
||||
last_updated: "2025-09-01",
|
||||
attachment: false,
|
||||
reasoning: true,
|
||||
reasoning_options: [{ type: "effort", values: ["low", "high"] }],
|
||||
tool_call: true,
|
||||
open_weights: true,
|
||||
status: "deprecated",
|
||||
interleaved: { field: "reasoning_content" },
|
||||
base_model: "zhipuai/glm-5.1",
|
||||
base_model_omit: ["limit.input"],
|
||||
cost: { input: 0.1, output: 0.4, cache_write: 0.2 },
|
||||
limit: { context: 64_000, output: 16_000 },
|
||||
modalities: { input: ["text"], output: ["text"] },
|
||||
});
|
||||
|
||||
expect(synced).toMatchObject({
|
||||
base_model: "zhipuai/glm-5.1",
|
||||
base_model_omit: ["limit.input"],
|
||||
reasoning_options: [{ type: "effort", values: ["low", "high"] }],
|
||||
status: "deprecated",
|
||||
interleaved: { field: "reasoning_content" },
|
||||
cost: { input: 0.12, output: 0.5, cache_write: 0.2 },
|
||||
limit: { context: 128_000, output: 32_000 },
|
||||
});
|
||||
});
|
||||
|
||||
test("Baseten preserves curated reasoning when an opt-in capability is omitted", () => {
|
||||
const synced = buildBasetenModel({
|
||||
...catalogModel,
|
||||
supported_features: ["tools", "structured_outputs"],
|
||||
}, {
|
||||
name: "GLM 5.1",
|
||||
release_date: "2026-05-20",
|
||||
last_updated: "2026-05-20",
|
||||
attachment: false,
|
||||
reasoning: true,
|
||||
reasoning_options: [{ type: "toggle" }],
|
||||
tool_call: true,
|
||||
open_weights: true,
|
||||
cost: { input: 1, output: 4 },
|
||||
limit: { context: 100_000, output: 50_000 },
|
||||
modalities: { input: ["text"], output: ["text"] },
|
||||
});
|
||||
|
||||
expect(synced).toMatchObject({
|
||||
reasoning: true,
|
||||
reasoning_options: [{ type: "toggle" }],
|
||||
});
|
||||
});
|
||||
|
||||
test("Baseten sync adds exact base models, retains missing entries, and is idempotent", async () => {
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "models-dev-baseten-"));
|
||||
const modelsDir = path.join(root, "providers", "baseten", "models");
|
||||
const metadataDir = path.join(root, "models", "zhipuai");
|
||||
await mkdir(path.join(modelsDir, "stale"), { recursive: true });
|
||||
await mkdir(metadataDir, { recursive: true });
|
||||
await Bun.write(
|
||||
path.join(metadataDir, "glm-5.1.toml"),
|
||||
Bun.file(path.join(import.meta.dirname, "../../../models/zhipuai/glm-5.1.toml")),
|
||||
);
|
||||
await Bun.write(path.join(modelsDir, "stale", "model.toml"), [
|
||||
'name = "Retained"',
|
||||
'release_date = "2025-01-01"',
|
||||
'last_updated = "2025-01-01"',
|
||||
"attachment = false",
|
||||
"reasoning = false",
|
||||
"tool_call = false",
|
||||
"open_weights = false",
|
||||
"[cost]",
|
||||
"input = 1",
|
||||
"output = 1",
|
||||
"[limit]",
|
||||
"context = 1000",
|
||||
"output = 100",
|
||||
"[modalities]",
|
||||
'input = ["text"]',
|
||||
'output = ["text"]',
|
||||
"",
|
||||
].join("\n"));
|
||||
baseten.modelsDir = modelsDir;
|
||||
baseten.fetchModels = async () => ({ data: [newCatalogModel] });
|
||||
|
||||
const first = await syncProvider(baseten);
|
||||
const second = await syncProvider(baseten);
|
||||
|
||||
expect(first.created).toBe(1);
|
||||
expect(first.deleted).toBe(0);
|
||||
expect(first.notices.join(" ")).toContain("stale/model.toml");
|
||||
expect(second).toMatchObject({ created: 0, updated: 0, deleted: 0 });
|
||||
});
|
||||
|
||||
test("Baseten rejects malformed catalog responses", () => {
|
||||
expect(() => BasetenResponse.parse({ data: "broken" })).toThrow();
|
||||
});
|
||||
|
||||
test("Baseten rejects non-success API responses", async () => {
|
||||
const fetcher = async () => new Response("unauthorized", {
|
||||
status: 401,
|
||||
statusText: "Unauthorized",
|
||||
});
|
||||
|
||||
expect(fetchBasetenModels("fixture-key", fetcher as typeof fetch))
|
||||
.rejects.toThrow("Baseten models request failed: 401 Unauthorized");
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { buildWorkersAiModel } from "../src/sync/providers/cloudflare-workers-ai.js";
|
||||
import type { OpenRouterModel } from "../src/sync/providers/openrouter.js";
|
||||
|
||||
test("Cloudflare Workers AI sync preserves reasoning options", () => {
|
||||
const model: OpenRouterModel = {
|
||||
id: "@cf/nvidia/nemotron-3-120b-a12b",
|
||||
name: "Nemotron 3 Super 120B",
|
||||
created: 1_773_187_200,
|
||||
hugging_face_id: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16",
|
||||
knowledge_cutoff: null,
|
||||
context_length: 256_000,
|
||||
architecture: {
|
||||
input_modalities: ["text"],
|
||||
output_modalities: ["text"],
|
||||
},
|
||||
pricing: {
|
||||
prompt: "0.0000005",
|
||||
completion: "0.0000015",
|
||||
},
|
||||
top_provider: {
|
||||
context_length: 256_000,
|
||||
max_completion_tokens: 256_000,
|
||||
},
|
||||
supported_parameters: ["reasoning", "tools", "temperature"],
|
||||
};
|
||||
|
||||
const synced = buildWorkersAiModel(model, {
|
||||
base_model: "nvidia/nemotron-3-super-120b-a12b",
|
||||
reasoning_options: [{ type: "toggle" }],
|
||||
});
|
||||
|
||||
expect(synced.reasoning_options).toEqual([{ type: "toggle" }]);
|
||||
});
|
||||
@@ -0,0 +1,35 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { buildGoogleModel } from "../src/sync/providers/google.js";
|
||||
|
||||
test("Google sync keeps base models compact", () => {
|
||||
const synced = buildGoogleModel({
|
||||
name: "models/gemini-3-pro-image-preview",
|
||||
displayName: "Nano Banana Pro",
|
||||
inputTokenLimit: 131_072,
|
||||
outputTokenLimit: 32_768,
|
||||
temperature: 1,
|
||||
thinking: true,
|
||||
}, {
|
||||
base_model: "google/gemini-3-pro-image-preview",
|
||||
name: "Nano Banana Pro",
|
||||
family: "gemini-pro",
|
||||
release_date: "2025-11-20",
|
||||
last_updated: "2025-11-20",
|
||||
attachment: true,
|
||||
reasoning: true,
|
||||
temperature: true,
|
||||
tool_call: false,
|
||||
knowledge: "2025-01",
|
||||
open_weights: false,
|
||||
cost: { input: 2, output: 120 },
|
||||
limit: { context: 65_536, output: 32_768 },
|
||||
modalities: { input: ["text", "image"], output: ["text", "image"] },
|
||||
});
|
||||
|
||||
expect(synced).toEqual({
|
||||
base_model: "google/gemini-3-pro-image-preview",
|
||||
cost: { input: 2, output: 120 },
|
||||
limit: { context: 131_072 },
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,121 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { preserveBaseModel } from "../src/sync/index.js";
|
||||
import { resolveCloudflareBaseModel } from "../src/sync/providers/cloudflare-workers-ai.js";
|
||||
import { buildOpenRouterModel, type OpenRouterModel } from "../src/sync/providers/openrouter.js";
|
||||
|
||||
test("OpenRouter z-ai models inherit from zhipuai metadata", () => {
|
||||
const model: OpenRouterModel = {
|
||||
id: "z-ai/glm-5.1",
|
||||
name: "Z.AI: GLM-5.1",
|
||||
created: 1_777_680_000,
|
||||
hugging_face_id: "zai-org/GLM-5.1",
|
||||
knowledge_cutoff: null,
|
||||
context_length: 200_000,
|
||||
architecture: {
|
||||
input_modalities: ["text"],
|
||||
output_modalities: ["text"],
|
||||
},
|
||||
pricing: {
|
||||
prompt: "0.0000014",
|
||||
completion: "0.0000044",
|
||||
},
|
||||
top_provider: {
|
||||
context_length: 200_000,
|
||||
max_completion_tokens: 131_072,
|
||||
},
|
||||
supported_parameters: ["tools", "tool_choice", "temperature", "structured_outputs"],
|
||||
};
|
||||
|
||||
const synced = buildOpenRouterModel(model, undefined);
|
||||
|
||||
expect("base_model" in synced ? synced.base_model : undefined).toBe("zhipuai/glm-5.1");
|
||||
});
|
||||
|
||||
test("OpenRouter-derived syncs preserve existing base model links", () => {
|
||||
const model: OpenRouterModel = {
|
||||
id: "@cf/nvidia/nemotron-3-120b-a12b",
|
||||
name: "Nemotron 3 Super 120B",
|
||||
created: 1_773_187_200,
|
||||
hugging_face_id: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16",
|
||||
knowledge_cutoff: null,
|
||||
context_length: 256_000,
|
||||
architecture: {
|
||||
input_modalities: ["text"],
|
||||
output_modalities: ["text"],
|
||||
},
|
||||
pricing: {
|
||||
prompt: "0.0000005",
|
||||
completion: "0.0000015",
|
||||
},
|
||||
top_provider: {
|
||||
context_length: 256_000,
|
||||
max_completion_tokens: 256_000,
|
||||
},
|
||||
supported_parameters: ["reasoning", "tools", "temperature", "structured_outputs"],
|
||||
};
|
||||
|
||||
const synced = preserveBaseModel(buildOpenRouterModel(model, undefined), {
|
||||
base_model: "nvidia/nemotron-3-super-120b-a12b",
|
||||
base_model_omit: ["limit.input"],
|
||||
});
|
||||
|
||||
expect("base_model" in synced ? synced.base_model : undefined)
|
||||
.toBe("nvidia/nemotron-3-super-120b-a12b");
|
||||
expect("base_model_omit" in synced ? synced.base_model_omit : undefined)
|
||||
.toEqual(["limit.input"]);
|
||||
});
|
||||
|
||||
test("newly detected base models do not replace existing links", () => {
|
||||
const model: OpenRouterModel = {
|
||||
id: "z-ai/glm-5.1",
|
||||
name: "Z.AI: GLM-5.1",
|
||||
created: 1_777_680_000,
|
||||
hugging_face_id: null,
|
||||
knowledge_cutoff: null,
|
||||
context_length: 200_000,
|
||||
architecture: { input_modalities: ["text"], output_modalities: ["text"] },
|
||||
pricing: { prompt: "0.0000014", completion: "0.0000044" },
|
||||
top_provider: { context_length: 200_000, max_completion_tokens: 131_072 },
|
||||
supported_parameters: ["tools"],
|
||||
};
|
||||
const synced = buildOpenRouterModel(model, {
|
||||
base_model: "zhipuai/glm-5",
|
||||
});
|
||||
|
||||
expect("base_model" in synced ? synced.base_model : undefined).toBe("zhipuai/glm-5");
|
||||
});
|
||||
|
||||
test("undefined translated links preserve existing base model fields", () => {
|
||||
const synced = preserveBaseModel({
|
||||
base_model: undefined,
|
||||
} as never, {
|
||||
base_model: "nvidia/nemotron-3-super-120b-a12b",
|
||||
base_model_omit: ["limit.input"],
|
||||
});
|
||||
|
||||
expect("base_model" in synced ? synced.base_model : undefined)
|
||||
.toBe("nvidia/nemotron-3-super-120b-a12b");
|
||||
expect("base_model_omit" in synced ? synced.base_model_omit : undefined)
|
||||
.toEqual(["limit.input"]);
|
||||
});
|
||||
|
||||
test("new Cloudflare models discover a unique metadata base model", () => {
|
||||
const model: OpenRouterModel = {
|
||||
id: "@cf/nvidia/nemotron-3-120b-a12b",
|
||||
name: "Nemotron 3 Super 120B",
|
||||
created: 1_773_187_200,
|
||||
hugging_face_id: null,
|
||||
knowledge_cutoff: null,
|
||||
context_length: 256_000,
|
||||
architecture: { input_modalities: ["text"], output_modalities: ["text"] },
|
||||
pricing: { prompt: "0.0000005", completion: "0.0000015" },
|
||||
top_provider: { context_length: 256_000, max_completion_tokens: 256_000 },
|
||||
supported_parameters: ["reasoning"],
|
||||
};
|
||||
|
||||
expect(resolveCloudflareBaseModel(model)).toBe("nvidia/nemotron-3-super-120b-a12b");
|
||||
const synced = buildOpenRouterModel(model, undefined, resolveCloudflareBaseModel(model));
|
||||
expect("base_model" in synced ? synced.base_model : undefined)
|
||||
.toBe("nvidia/nemotron-3-super-120b-a12b");
|
||||
});
|
||||
@@ -0,0 +1,227 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import path from "node:path";
|
||||
import { mkdtemp, mkdir, readlink, symlink } from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
|
||||
import { AuthoredModelShape } from "../src/schema.js";
|
||||
import { syncProvider, type SyncProvider, type SyncedFullModel } from "../src/sync/index.js";
|
||||
|
||||
const model: SyncedFullModel = {
|
||||
name: "Test model",
|
||||
release_date: "2026-01-01",
|
||||
last_updated: "2026-01-01",
|
||||
attachment: false,
|
||||
reasoning: false,
|
||||
tool_call: false,
|
||||
open_weights: false,
|
||||
cost: { input: 1, output: 2 },
|
||||
limit: { context: 1_000, output: 100 },
|
||||
modalities: { input: ["text"], output: ["text"] },
|
||||
};
|
||||
|
||||
test("reasoning budgets allow only the -1 negative sentinel", () => {
|
||||
const authored = { id: "model", ...model };
|
||||
|
||||
expect(AuthoredModelShape.safeParse({
|
||||
...authored,
|
||||
reasoning_options: [{ type: "budget_tokens", min: -1, max: 32_768 }],
|
||||
}).success).toBe(true);
|
||||
expect(AuthoredModelShape.safeParse({
|
||||
...authored,
|
||||
reasoning_options: [{ type: "budget_tokens", min: -2, max: 32_768 }],
|
||||
}).success).toBe(false);
|
||||
});
|
||||
|
||||
test("reasoning efforts accept the provider default value", () => {
|
||||
expect(AuthoredModelShape.safeParse({
|
||||
id: "model",
|
||||
...model,
|
||||
reasoning: true,
|
||||
reasoning_options: [{ type: "effort", values: ["none", "default"] }],
|
||||
}).success).toBe(true);
|
||||
});
|
||||
|
||||
async function fixture() {
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "models-dev-sync-"));
|
||||
const modelsDir = path.join(root, "providers", "test", "models");
|
||||
await mkdir(modelsDir, { recursive: true });
|
||||
return { root, modelsDir };
|
||||
}
|
||||
|
||||
function provider(
|
||||
modelsDir: string,
|
||||
ids: string[],
|
||||
deleteMissing = true,
|
||||
preserveSymlinks = false,
|
||||
): SyncProvider<string> {
|
||||
return {
|
||||
id: "test",
|
||||
name: "Test",
|
||||
modelsDir,
|
||||
deleteMissing,
|
||||
preserveSymlinks,
|
||||
missingNotice: (paths) => paths.map((item) => `missing: ${item}`),
|
||||
async fetchModels() {
|
||||
return ids;
|
||||
},
|
||||
parseModels(raw) {
|
||||
return raw as string[];
|
||||
},
|
||||
translateModel(id) {
|
||||
return { id, model };
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
test("sync repairs a broken symlink returned by the source", async () => {
|
||||
const { modelsDir } = await fixture();
|
||||
const filePath = path.join(modelsDir, "model.toml");
|
||||
await symlink("missing.toml", filePath);
|
||||
|
||||
const result = await syncProvider(provider(modelsDir, ["model"]));
|
||||
|
||||
expect(result.created).toBe(1);
|
||||
expect(await Bun.file(filePath).text()).toContain('name = "Test model"');
|
||||
expect(readlink(filePath)).rejects.toThrow();
|
||||
});
|
||||
|
||||
test("sync preserves valid symlink aliases when configured", async () => {
|
||||
const { root, modelsDir } = await fixture();
|
||||
const targetPath = path.join(root, "target.toml");
|
||||
const filePath = path.join(modelsDir, "model.toml");
|
||||
await Bun.write(targetPath, `name = "Alias target"\n`);
|
||||
await symlink(targetPath, filePath);
|
||||
|
||||
const result = await syncProvider(provider(modelsDir, ["model"], true, true));
|
||||
|
||||
expect(result.updated).toBe(0);
|
||||
expect(await readlink(filePath)).toBe(targetPath);
|
||||
});
|
||||
|
||||
test("sync removes a broken symlink absent from the source", async () => {
|
||||
const { modelsDir } = await fixture();
|
||||
const filePath = path.join(modelsDir, "model.toml");
|
||||
await symlink("missing.toml", filePath);
|
||||
|
||||
const result = await syncProvider(provider(modelsDir, []));
|
||||
|
||||
expect(result.deleted).toBe(1);
|
||||
expect(await Bun.file(filePath).exists()).toBe(false);
|
||||
});
|
||||
|
||||
test("non-deleting sync reports missing broken symlinks", async () => {
|
||||
const { modelsDir } = await fixture();
|
||||
const filePath = path.join(modelsDir, "model.toml");
|
||||
await symlink("missing.toml", filePath);
|
||||
|
||||
const result = await syncProvider(provider(modelsDir, [], false));
|
||||
|
||||
expect(result.deleted).toBe(0);
|
||||
expect(result.notices).toEqual(["missing: model.toml"]);
|
||||
expect(await readlink(filePath)).toBe("missing.toml");
|
||||
});
|
||||
|
||||
test("sync preserves authored reasoning options omitted by a translator", async () => {
|
||||
const { modelsDir } = await fixture();
|
||||
const filePath = path.join(modelsDir, "model.toml");
|
||||
await Bun.write(filePath, `name = "Old name"
|
||||
release_date = "2026-01-01"
|
||||
last_updated = "2026-01-01"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["low", "high"]
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "budget_tokens"
|
||||
min = -1
|
||||
max = 32768
|
||||
|
||||
[cost]
|
||||
input = 1
|
||||
output = 2
|
||||
|
||||
[limit]
|
||||
context = 1000
|
||||
output = 100
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
`);
|
||||
const sync = provider(modelsDir, ["model"]);
|
||||
sync.translateModel = (id) => ({
|
||||
id,
|
||||
model: { ...model, reasoning: true },
|
||||
});
|
||||
|
||||
const first = await syncProvider(sync);
|
||||
const content = await Bun.file(filePath).text();
|
||||
const second = await syncProvider(sync);
|
||||
|
||||
expect(first.updated).toBe(1);
|
||||
expect(content).toContain("[[reasoning_options]]");
|
||||
expect(content).toContain('values = ["low", "high"]');
|
||||
expect(content).toContain("min = -1");
|
||||
expect(content).toContain("max = 32_768");
|
||||
expect(second.updated).toBe(0);
|
||||
expect(second.unchanged).toBe(1);
|
||||
});
|
||||
|
||||
test("sync writes metadata returned by a provider translator", async () => {
|
||||
const root = await mkdtemp(path.join(os.tmpdir(), "models-dev-sync-metadata-"));
|
||||
const modelsDir = path.join(root, "providers", "test", "models");
|
||||
await mkdir(modelsDir, { recursive: true });
|
||||
const sync = provider(modelsDir, ["model"]);
|
||||
sync.translateModel = () => ({
|
||||
id: "model",
|
||||
model: {
|
||||
base_model: "test/model",
|
||||
reasoning_options: [],
|
||||
cost: { input: 1, output: 2 },
|
||||
},
|
||||
metadata: {
|
||||
id: "test/model",
|
||||
model: {
|
||||
name: "Model",
|
||||
release_date: "2026-06-10",
|
||||
last_updated: "2026-06-10",
|
||||
attachment: false,
|
||||
reasoning: false,
|
||||
tool_call: true,
|
||||
open_weights: false,
|
||||
limit: { context: 1_000, output: 100 },
|
||||
modalities: { input: ["text"], output: ["text"] },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const first = await syncProvider(sync);
|
||||
const second = await syncProvider(sync);
|
||||
|
||||
expect(first).toMatchObject({ created: 2, updated: 0 });
|
||||
expect(second).toMatchObject({ created: 0, updated: 0 });
|
||||
expect(await Bun.file(path.join(root, "models", "test", "model.toml")).text()).toContain('name = "Model"');
|
||||
});
|
||||
|
||||
test("sync removes missing metadata only from its owned namespace", async () => {
|
||||
const { root, modelsDir } = await fixture();
|
||||
const ownedDir = path.join(root, "models", "test");
|
||||
const otherDir = path.join(root, "models", "other");
|
||||
await mkdir(ownedDir, { recursive: true });
|
||||
await mkdir(otherDir, { recursive: true });
|
||||
await Bun.write(path.join(ownedDir, "stale.toml"), 'name = "Stale"\n');
|
||||
await Bun.write(path.join(otherDir, "retained.toml"), 'name = "Retained"\n');
|
||||
const sync = provider(modelsDir, []);
|
||||
sync.metadataNamespace = "test";
|
||||
|
||||
const result = await syncProvider(sync);
|
||||
|
||||
expect(result.deleted).toBe(1);
|
||||
expect(await Bun.file(path.join(ownedDir, "stale.toml")).exists()).toBe(false);
|
||||
expect(await Bun.file(path.join(otherDir, "retained.toml")).exists()).toBe(true);
|
||||
});
|
||||
@@ -0,0 +1,167 @@
|
||||
import { expect, test } from "bun:test";
|
||||
import { readdirSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
import {
|
||||
buildVeniceModel,
|
||||
resolveVeniceBaseModel,
|
||||
venice,
|
||||
VeniceResponse,
|
||||
type VeniceModel,
|
||||
} from "../src/sync/providers/venice.js";
|
||||
|
||||
const catalogModel: VeniceModel = {
|
||||
id: "openai-gpt-54",
|
||||
created: 1_772_668_800,
|
||||
model_spec: {
|
||||
name: "GPT-5.4",
|
||||
availableContextTokens: 400_000,
|
||||
maxCompletionTokens: 128_000,
|
||||
modelSource: "OpenAI",
|
||||
capabilities: {
|
||||
supportsVision: true,
|
||||
supportsReasoning: true,
|
||||
supportsReasoningEffort: true,
|
||||
reasoningEffortOptions: ["none", "low", "medium", "high"],
|
||||
supportsFunctionCalling: true,
|
||||
supportsResponseSchema: true,
|
||||
},
|
||||
pricing: {
|
||||
input: { usd: 3.13 },
|
||||
output: { usd: 18.75 },
|
||||
cache_input: { usd: 0.313 },
|
||||
extended: {
|
||||
context_token_threshold: 200_000,
|
||||
input: { usd: 6.26 },
|
||||
output: { usd: 28.125 },
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test("Venice resolves flattened IDs to canonical metadata", () => {
|
||||
expect(resolveVeniceBaseModel("openai-gpt-54", "GPT-5.4")).toBe("openai/gpt-5.4");
|
||||
expect(resolveVeniceBaseModel("claude-opus-4-8-fast", "Claude Opus 4.8 Fast"))
|
||||
.toBe("anthropic/claude-opus-4-8");
|
||||
});
|
||||
|
||||
test("Venice emits empty reasoning options when efforts are unavailable", () => {
|
||||
const synced = buildVeniceModel({
|
||||
...catalogModel,
|
||||
id: "reasoning-without-efforts",
|
||||
model_spec: {
|
||||
...catalogModel.model_spec,
|
||||
name: "Reasoning Without Efforts",
|
||||
capabilities: {
|
||||
...catalogModel.model_spec.capabilities,
|
||||
reasoningEffortOptions: [],
|
||||
},
|
||||
},
|
||||
}, undefined, undefined, "2026-06-10");
|
||||
|
||||
expect(synced).toMatchObject({ reasoning: true, reasoning_options: [] });
|
||||
});
|
||||
|
||||
test("Venice does not infer temperature support", () => {
|
||||
const synced = buildVeniceModel(catalogModel, undefined, null, "2026-06-10");
|
||||
|
||||
expect(synced.temperature).toBeUndefined();
|
||||
});
|
||||
|
||||
test("Venice skips E2EE models", () => {
|
||||
const translated = venice.translateModel({
|
||||
...catalogModel,
|
||||
id: "e2ee-test-model",
|
||||
model_spec: {
|
||||
...catalogModel.model_spec,
|
||||
capabilities: { ...catalogModel.model_spec.capabilities, supportsE2EE: true },
|
||||
},
|
||||
}, { existing: () => undefined });
|
||||
|
||||
expect(translated).toBeUndefined();
|
||||
});
|
||||
|
||||
test("Venice uses boundary-aware family matching", () => {
|
||||
const synced = buildVeniceModel({
|
||||
...catalogModel,
|
||||
id: "google-gemma-4-31b-it",
|
||||
model_spec: { ...catalogModel.model_spec, name: "Google Gemma 4 31B Instruct" },
|
||||
}, undefined, null, "2026-06-10");
|
||||
|
||||
expect(synced).toMatchObject({ family: "gemma" });
|
||||
});
|
||||
|
||||
test("Venice maps API fields without bumping inherited model timestamps", () => {
|
||||
const synced = buildVeniceModel(catalogModel, {
|
||||
base_model: "openai/gpt-5.4",
|
||||
name: "GPT-5.4",
|
||||
family: "gpt",
|
||||
release_date: "2026-03-05",
|
||||
last_updated: "2026-03-09",
|
||||
attachment: true,
|
||||
reasoning: true,
|
||||
tool_call: true,
|
||||
structured_output: true,
|
||||
temperature: true,
|
||||
open_weights: false,
|
||||
interleaved: { field: "reasoning_content" },
|
||||
cost: { input: 3, output: 18, input_audio: 4 },
|
||||
limit: { context: 400_000, output: 128_000 },
|
||||
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
||||
}, "openai/gpt-5.4", "2026-06-10");
|
||||
|
||||
expect(synced).toMatchObject({
|
||||
base_model: "openai/gpt-5.4",
|
||||
base_model_omit: ["limit.input"],
|
||||
last_updated: "2026-03-09",
|
||||
reasoning_options: [{ type: "effort", values: ["none", "low", "medium", "high"] }],
|
||||
interleaved: { field: "reasoning_content" },
|
||||
cost: {
|
||||
input: 3.13,
|
||||
output: 18.75,
|
||||
cache_read: 0.313,
|
||||
input_audio: 4,
|
||||
tiers: [{ tier: { type: "context", size: 200_000 }, input: 6.26, output: 28.125 }],
|
||||
},
|
||||
});
|
||||
expect(synced).not.toHaveProperty("family");
|
||||
expect(synced).not.toHaveProperty("release_date");
|
||||
expect(synced).not.toHaveProperty("open_weights");
|
||||
expect(synced).not.toHaveProperty("modalities");
|
||||
expect(synced).not.toHaveProperty("temperature");
|
||||
});
|
||||
|
||||
test("Venice preserves last_updated when authoritative data is unchanged", () => {
|
||||
const providerModel = {
|
||||
...catalogModel,
|
||||
id: "venice-only-test-model",
|
||||
model_spec: { ...catalogModel.model_spec, name: "Venice Only Test Model" },
|
||||
};
|
||||
const full = buildVeniceModel(providerModel, undefined, undefined, "2026-06-10");
|
||||
if ("base_model" in full) throw new Error("Expected a full provider model fixture");
|
||||
const synced = buildVeniceModel(providerModel, full, undefined, "2026-06-11");
|
||||
|
||||
expect(synced).toMatchObject({ last_updated: "2026-06-10" });
|
||||
});
|
||||
|
||||
test("Venice rejects malformed responses", () => {
|
||||
expect(() => VeniceResponse.parse({ data: [{ id: "broken" }] })).toThrow();
|
||||
});
|
||||
|
||||
test("Venice models use only canonical metadata and declare reasoning options", async () => {
|
||||
const root = path.join(import.meta.dirname, "..", "..", "..");
|
||||
const modelsDir = path.join(root, "providers", "venice", "models");
|
||||
|
||||
for (const file of readdirSync(modelsDir).filter((item) => item.endsWith(".toml"))) {
|
||||
const model = Bun.TOML.parse(await Bun.file(path.join(modelsDir, file)).text()) as {
|
||||
base_model?: string;
|
||||
reasoning_options?: unknown[];
|
||||
};
|
||||
expect(model.reasoning_options, file).toBeDefined();
|
||||
if (model.base_model !== undefined) {
|
||||
expect(model.base_model.startsWith("venice/"), file).toBe(false);
|
||||
expect(await Bun.file(path.join(root, "models", `${model.base_model}.toml`)).exists(), file).toBe(true);
|
||||
}
|
||||
expect(file.startsWith("e2ee-"), file).toBe(false);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,113 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { buildVercelModel, type VercelModel, vercel } from "../src/sync/providers/vercel.js";
|
||||
|
||||
const model: VercelModel = {
|
||||
id: "openai/gpt-test",
|
||||
name: "GPT Test",
|
||||
created: 1_700_000_000,
|
||||
released: 1_710_000_000,
|
||||
context_window: 128_000,
|
||||
max_tokens: 32_000,
|
||||
type: "language",
|
||||
tags: ["reasoning", "tool-use", "vision", "file-input"],
|
||||
pricing: {
|
||||
input: "0.000001",
|
||||
output: "0.000004",
|
||||
input_cache_read: "0.0000001",
|
||||
},
|
||||
};
|
||||
|
||||
test("Vercel models translate gateway metadata", () => {
|
||||
const synced = buildVercelModel(model, undefined);
|
||||
|
||||
expect(synced).toMatchObject({
|
||||
name: "GPT Test",
|
||||
release_date: "2024-03-09",
|
||||
last_updated: "2024-03-09",
|
||||
attachment: true,
|
||||
reasoning: true,
|
||||
tool_call: true,
|
||||
open_weights: false,
|
||||
cost: { input: 1, output: 4, cache_read: 0.1 },
|
||||
limit: { context: 128_000, input: 96_000, output: 32_000 },
|
||||
modalities: { input: ["text", "image", "pdf"], output: ["text"] },
|
||||
});
|
||||
});
|
||||
|
||||
test("Vercel models preserve curated metadata and missing limits", () => {
|
||||
const synced = buildVercelModel({
|
||||
...model,
|
||||
context_window: 0,
|
||||
max_tokens: 0,
|
||||
}, {
|
||||
name: "Curated name",
|
||||
release_date: "2024-01-01",
|
||||
last_updated: "2025-01-01",
|
||||
reasoning_options: [{ type: "effort", values: ["low", "high"] }],
|
||||
cost: {
|
||||
input: 2,
|
||||
output: 8,
|
||||
tiers: [{
|
||||
tier: { type: "context", size: 200_000 },
|
||||
input: 3,
|
||||
output: 12,
|
||||
}],
|
||||
},
|
||||
limit: { context: 64_000, input: 48_000, output: 16_000 },
|
||||
});
|
||||
|
||||
expect(synced.name).toBe("Curated name");
|
||||
expect(synced.last_updated).toBe("2025-01-01");
|
||||
expect(synced.reasoning_options).toEqual([{ type: "effort", values: ["low", "high"] }]);
|
||||
expect(synced.cost?.tiers).toHaveLength(1);
|
||||
expect(synced.limit).toEqual({ context: 64_000, input: 48_000, output: 16_000 });
|
||||
});
|
||||
|
||||
test("Vercel non-language models use API tool capabilities", () => {
|
||||
const synced = buildVercelModel({
|
||||
...model,
|
||||
type: "image",
|
||||
tags: [],
|
||||
}, {
|
||||
tool_call: true,
|
||||
});
|
||||
|
||||
expect(synced.tool_call).toBe(false);
|
||||
});
|
||||
|
||||
test("Vercel sync includes non-language model types", () => {
|
||||
for (const [type, output] of [
|
||||
["image", ["image"]],
|
||||
["video", ["video"]],
|
||||
["reranking", ["text"]],
|
||||
] as const) {
|
||||
const source = {
|
||||
...model,
|
||||
id: `test/${type}`,
|
||||
type,
|
||||
tags: [],
|
||||
context_window: 0,
|
||||
max_tokens: 0,
|
||||
pricing: undefined,
|
||||
};
|
||||
|
||||
expect(vercel.translateModel(source, { existing: () => undefined })).toBeDefined();
|
||||
expect(buildVercelModel(source, undefined)).toMatchObject({
|
||||
tool_call: false,
|
||||
modalities: { input: ["text"], output },
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
test("Vercel models use canonical metadata when available", () => {
|
||||
const synced = buildVercelModel({
|
||||
...model,
|
||||
id: "nvidia/nemotron-3-ultra-550b-a55b",
|
||||
name: "Nemotron 3 Ultra",
|
||||
}, undefined);
|
||||
|
||||
expect("base_model" in synced ? synced.base_model : undefined)
|
||||
.toBe("nvidia/nemotron-3-ultra-550b-a55b");
|
||||
expect("last_updated" in synced ? synced.last_updated : undefined).toBeUndefined();
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import { expect, test } from "bun:test";
|
||||
|
||||
import { buildXAIModel, type XAIModel } from "../src/sync/providers/xai.js";
|
||||
|
||||
const model: XAIModel = {
|
||||
id: "grok-test",
|
||||
created: 1_700_000_000,
|
||||
input_modalities: ["text"],
|
||||
output_modalities: ["text"],
|
||||
prompt_text_token_price: 10_000,
|
||||
completion_text_token_price: 20_000,
|
||||
};
|
||||
|
||||
test("xAI sync preserves reasoning options", () => {
|
||||
const synced = buildXAIModel(model, {
|
||||
name: "Grok Test",
|
||||
release_date: "2024-01-01",
|
||||
last_updated: "2024-01-01",
|
||||
attachment: false,
|
||||
reasoning: true,
|
||||
reasoning_options: [{ type: "effort", values: ["none", "high"] }],
|
||||
tool_call: true,
|
||||
open_weights: false,
|
||||
limit: { context: 2_000_000, output: 30_000 },
|
||||
modalities: { input: ["text"], output: ["text"] },
|
||||
});
|
||||
|
||||
expect(synced.reasoning_options).toEqual([{ type: "effort", values: ["none", "high"] }]);
|
||||
expect(synced.limit?.context).toBe(2_000_000);
|
||||
});
|
||||
@@ -3,7 +3,6 @@ release_date = "2026-02-18"
|
||||
last_updated = "2026-03-13"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-02-18"
|
||||
last_updated = "2026-03-13"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens", min = 1024, max = 63999 }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2025-01-20"
|
||||
last_updated = "2025-01-20"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -3,7 +3,6 @@ release_date = "2025-12-01"
|
||||
last_updated = "2025-12-01"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -3,7 +3,6 @@ release_date = "2025-07-15"
|
||||
last_updated = "2025-07-15"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -3,7 +3,6 @@ release_date = "2025-09-05"
|
||||
last_updated = "2025-09-05"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -3,7 +3,6 @@ release_date = "2025-09-05"
|
||||
last_updated = "2025-09-05"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high", "max"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 1.1268
|
||||
output = 3.9438
|
||||
cache_read = 0.2817
|
||||
|
||||
[limit]
|
||||
context = 1_000_000
|
||||
output = 128_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-05-01"
|
||||
last_updated = "2026-05-01"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high"] }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-01"
|
||||
last_updated = "2026-01"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = false
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-04-21"
|
||||
last_updated = "2026-04-21"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = false
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-04-02"
|
||||
last_updated = "2026-04-02"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-05-09"
|
||||
last_updated = "2026-05-09"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-05-09"
|
||||
last_updated = "2026-05-09"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high", "max"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
cache_read = 0
|
||||
cache_write = 0
|
||||
@@ -1,13 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
base_model_omit = ["structured_output"]
|
||||
family = "kimi-k2"
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens" }]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
cache_read = 0
|
||||
cache_write = 0
|
||||
@@ -1,14 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high", "max"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
cache_read = 0
|
||||
cache_write = 0
|
||||
@@ -1,13 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
base_model_omit = ["structured_output"]
|
||||
family = "kimi-k2"
|
||||
reasoning_options = [{ type = "toggle" }, { type = "budget_tokens" }]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
cache_read = 0
|
||||
cache_write = 0
|
||||
@@ -1,8 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
temperature = true
|
||||
|
||||
[cost]
|
||||
input = 0.75
|
||||
output = 3.5
|
||||
cache_read = 0.16
|
||||
cache_write = 0
|
||||
@@ -1,6 +1,5 @@
|
||||
base_model = "zhipuai/glm-5.1"
|
||||
name = "GLM 5.1"
|
||||
reasoning_options = []
|
||||
base_model = "zhipuai/glm-5.1"
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
base_model = "anthropic/claude-opus-4-8"
|
||||
temperature = true
|
||||
knowledge = "2025-12-31"
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "max"] }]
|
||||
|
||||
[cost]
|
||||
input = 5.00
|
||||
output = 25.00
|
||||
cache_read = 0.50
|
||||
cache_write = 6.25
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { size = 200_000 }
|
||||
input = 10.00
|
||||
output = 37.50
|
||||
cache_read = 1.00
|
||||
cache_write = 12.50
|
||||
|
||||
[limit]
|
||||
context = 200_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
api = "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"
|
||||
@@ -1,16 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.5"
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = true
|
||||
interleaved = true
|
||||
|
||||
[cost]
|
||||
input = 0.60
|
||||
output = 3.00
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
|
||||
[provider]
|
||||
shape = "completions"
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
api = "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"
|
||||
@@ -0,0 +1 @@
|
||||
../../azure/models/kimi-k2.5.toml
|
||||
@@ -1,16 +1,30 @@
|
||||
base_model = "moonshotai/kimi-k2.6"
|
||||
name = "Kimi K2.6"
|
||||
family = "kimi-k2"
|
||||
release_date = "2026-04-22"
|
||||
last_updated = "2026-04-22"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
structured_output = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
knowledge = "2025-01"
|
||||
interleaved = true
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.95
|
||||
output = 4.00
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 262_144
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
|
||||
[provider]
|
||||
shape = "completions"
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
api = "https://${AZURE_COGNITIVE_SERVICES_RESOURCE_NAME}.services.ai.azure.com/models"
|
||||
api = "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/models"
|
||||
@@ -1,24 +0,0 @@
|
||||
base_model = "anthropic/claude-opus-4-8"
|
||||
temperature = true
|
||||
knowledge = "2025-12-31"
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high", "max"] }]
|
||||
|
||||
[cost]
|
||||
input = 5.00
|
||||
output = 25.00
|
||||
cache_read = 0.50
|
||||
cache_write = 6.25
|
||||
|
||||
[[cost.tiers]]
|
||||
tier = { size = 200_000 }
|
||||
input = 10.00
|
||||
output = 37.50
|
||||
cache_read = 1.00
|
||||
cache_write = 12.50
|
||||
|
||||
[limit]
|
||||
context = 200_000
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/anthropic"
|
||||
api = "https://${AZURE_RESOURCE_NAME}.services.ai.azure.com/anthropic/v1"
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "openai/gpt-image-1.5"
|
||||
reasoning_options = []
|
||||
|
||||
[cost]
|
||||
input = 5.00
|
||||
output = 32.00
|
||||
cache_read = 1.25
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "openai/gpt-image-1"
|
||||
reasoning_options = []
|
||||
|
||||
[cost]
|
||||
input = 5.00
|
||||
output = 40.00
|
||||
cache_read = 1.25
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "openai/gpt-image-2"
|
||||
reasoning_options = []
|
||||
|
||||
[cost]
|
||||
input = 5.00
|
||||
output = 30.00
|
||||
cache_read = 1.25
|
||||
@@ -1,14 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
temperature = true
|
||||
|
||||
[cost]
|
||||
input = 0.95
|
||||
output = 4
|
||||
cache_read = 0.16
|
||||
|
||||
[limit]
|
||||
context = 262_000
|
||||
output = 262_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
@@ -10,7 +10,7 @@ type = "toggle"
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0.3
|
||||
input = 0.06
|
||||
output = 0.75
|
||||
cache_read = 0.06
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ type = "toggle"
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0.6
|
||||
input = 0.12
|
||||
output = 2.2
|
||||
cache_read = 0.12
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
name = "GLM 5.2"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 1.4
|
||||
output = 4.4
|
||||
cache_read = 0.3
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 262_144
|
||||
@@ -12,8 +12,8 @@ structured_output = true
|
||||
open_weights = true
|
||||
|
||||
[cost]
|
||||
input = 0.22
|
||||
output = 0.83
|
||||
input = 0.44
|
||||
output = 0.99
|
||||
|
||||
[limit]
|
||||
context = 128_000
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "high"] }]
|
||||
|
||||
[cost]
|
||||
input = 1.54
|
||||
output = 4.84
|
||||
|
||||
[limit]
|
||||
context = 524_288
|
||||
output = 32_768
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
@@ -1,21 +0,0 @@
|
||||
name = "Claudius"
|
||||
release_date = "2026-05-12"
|
||||
last_updated = "2026-05-12"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
tool_call = true
|
||||
open_weights = false
|
||||
knowledge = "2026-05"
|
||||
|
||||
[cost]
|
||||
input = 3.00
|
||||
output = 8.00
|
||||
cache_read = 0.900
|
||||
|
||||
[limit]
|
||||
context = 256_000
|
||||
output = 64_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image", "audio", "video"]
|
||||
output = ["text"]
|
||||
@@ -1,11 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
name = "Glm 5.2"
|
||||
|
||||
[cost]
|
||||
input = 1.4
|
||||
output = 4.4
|
||||
cache_read = 0.26
|
||||
|
||||
[limit]
|
||||
context = 262_144
|
||||
output = 262_144
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "Command R7B"
|
||||
family = "command-r"
|
||||
release_date = "2024-12-02"
|
||||
last_updated = "2024-12-02"
|
||||
release_date = "2024-02-27"
|
||||
last_updated = "2024-02-27"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
name = "Devstral Small 2 2512"
|
||||
release_date = "2025-12-09"
|
||||
last_updated = "2025-12-09"
|
||||
knowledge = "2025-12"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
tool_call = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
|
||||
[limit]
|
||||
context = 262_000
|
||||
output = 262_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "zhipuai/glm-5-turbo"
|
||||
|
||||
[cost]
|
||||
input = 1.235
|
||||
output = 4.118
|
||||
cache_read = 0.308
|
||||
cache_write = 1.544
|
||||
@@ -1,10 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
reasoning_options = [{ type = "effort", values = ["high", "max"]}]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 1.44
|
||||
output = 4.53
|
||||
cache_read = 0.39
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "zhipuai/glm-5v-turbo"
|
||||
|
||||
[cost]
|
||||
input = 1.235
|
||||
output = 4.118
|
||||
cache_read = 0.308
|
||||
cache_write = 1.544
|
||||
@@ -1,6 +1,5 @@
|
||||
base_model = "openai/gpt-5.4"
|
||||
base_model_omit = ["limit.input"]
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
|
||||
[cost]
|
||||
input = 3
|
||||
|
||||
@@ -5,7 +5,6 @@ last_updated = "2025-08-05"
|
||||
knowledge = "2024-01"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
reasoning_options = [{ type = "effort", values = ["low", "medium", "high"] }]
|
||||
tool_call = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
@@ -21,4 +20,4 @@ output = 128_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
output = ["text"]
|
||||
@@ -4,7 +4,6 @@ last_updated = "2025-08-26"
|
||||
knowledge = "2023-12"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
tool_call = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
|
||||
@@ -4,7 +4,6 @@ last_updated = "2025-11-26"
|
||||
knowledge = "2025-11"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
tool_call = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
@@ -20,4 +19,4 @@ output = 128_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
output = ["text"]
|
||||
@@ -4,7 +4,6 @@ last_updated = "2025-12-08"
|
||||
knowledge = "2025-12"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
tool_call = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
@@ -22,4 +21,4 @@ output = 262_000
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
output = ["text"]
|
||||
@@ -5,7 +5,6 @@ last_updated = "2026-01-27"
|
||||
knowledge = "2025-01"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
|
||||
@@ -4,7 +4,6 @@ release_date = "2026-04-17"
|
||||
last_updated = "2026-04-17"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = [{ type = "toggle" }]
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
reasoning_options = []
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 1.28
|
||||
output = 4.63
|
||||
cache_read = 0.32
|
||||
@@ -2,7 +2,6 @@ base_model = "meta/llama-3.3-70b-instruct"
|
||||
name = "Llama 3.3 70B Instruct"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
|
||||
[cost]
|
||||
input = 0.089
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
base_model = "meta/llama-4-maverick-17b-instruct"
|
||||
|
||||
[cost]
|
||||
input = 0.124
|
||||
output = 0.603
|
||||
cache_read = 0.03
|
||||
cache_write = 0.151
|
||||
@@ -1,6 +0,0 @@
|
||||
base_model = "minimax/MiniMax-M3"
|
||||
|
||||
[cost]
|
||||
input = 0.355
|
||||
output = 1.775
|
||||
cache_read = 0.089
|
||||
@@ -4,7 +4,6 @@ last_updated = "2023-12-11"
|
||||
knowledge = "2023-09"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
tool_call = false
|
||||
temperature = true
|
||||
open_weights = true
|
||||
|
||||
@@ -5,7 +5,6 @@ last_updated = "2026-03-11"
|
||||
knowledge = "2025-12"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
tool_call = true
|
||||
temperature = true
|
||||
open_weights = true
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
base_model = "deepseek/deepseek-v4-pro"
|
||||
name = "DeepSeek V4 Pro Lightning"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high"] }]
|
||||
|
||||
[interleaved]
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high"] }]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0.5
|
||||
output = 2.2
|
||||
cache_read = 0.08
|
||||
|
||||
[limit]
|
||||
output = 131_072
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
@@ -1,6 +1,6 @@
|
||||
name = "Greg 2 Super"
|
||||
release_date = "2026-06-14"
|
||||
last_updated = "2026-06-14"
|
||||
name = "Greg 1 Super"
|
||||
release_date = "2026-01-27"
|
||||
last_updated = "2026-01-27"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
@@ -8,9 +8,9 @@ tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[cost]
|
||||
input = 1.5
|
||||
output = 5
|
||||
cache_read = 0.25
|
||||
input = 1.00
|
||||
output = 5.00
|
||||
cache_read = 0.20
|
||||
|
||||
[limit]
|
||||
context = 229_376
|
||||
@@ -1,6 +1,6 @@
|
||||
name = "Greg 2 Ultra"
|
||||
release_date = "2026-06-14"
|
||||
last_updated = "2026-06-14"
|
||||
name = "Greg 1 Normal"
|
||||
release_date = "2026-01-27"
|
||||
last_updated = "2026-01-27"
|
||||
attachment = false
|
||||
reasoning = false
|
||||
temperature = true
|
||||
@@ -8,9 +8,9 @@ tool_call = false
|
||||
open_weights = false
|
||||
|
||||
[cost]
|
||||
input = 3
|
||||
output = 10
|
||||
cache_read = 0.5
|
||||
input = 0.10
|
||||
output = 0.30
|
||||
cache_read = 0.02
|
||||
|
||||
[limit]
|
||||
context = 229_376
|
||||
@@ -18,4 +18,4 @@ output = 229_376
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
output = ["text"]
|
||||
@@ -1,13 +0,0 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
reasoning_options = [{ type = "effort", values = ["none", "low", "medium", "high"] }]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 0.55
|
||||
output = 2.25
|
||||
cache_read = 0.05
|
||||
|
||||
[provider]
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.45 5.74999L11.9991 11.6956L9.54562 5.74999H7.97237L10.6604 12.2495C10.7678 12.5138 10.9515 12.7402 11.1882 12.8996C11.4248 13.059 11.7036 13.1442 11.9889 13.1444C12.2742 13.1446 12.5531 13.0597 12.79 12.9006C13.0268 12.7415 13.2109 12.5154 13.3186 12.2512L16.0232 5.74999H14.45ZM15.4965 14.808L19.98 10.2195L19.3684 8.75911L14.4719 13.7807C14.272 13.9856 14.1369 14.2448 14.0835 14.5261C14.0301 14.8073 14.0608 15.098 14.1718 15.3619C14.2807 15.624 14.4648 15.848 14.7008 16.0056C14.9369 16.1632 15.2144 16.2473 15.4983 16.2474L15.5 16.25L22.5 16.2325L21.8884 14.7721L15.4983 14.808H15.4965ZM4.02 10.216L4.63162 8.75561L9.52813 13.7772C9.93763 14.1964 10.0557 14.8176 9.82825 15.3584C9.71925 15.6204 9.53511 15.8443 9.29905 16.0019C9.06299 16.1595 8.78557 16.2437 8.50175 16.2439L1.50175 16.2281L1.5 16.2299L2.11163 14.7695L8.50175 14.8062L4.02 10.216Z" fill="currentColor"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 992 B |
@@ -0,0 +1,28 @@
|
||||
name = "Kimi K2.6 Turbo"
|
||||
family = "kimi-thinking"
|
||||
release_date = "2026-04-17"
|
||||
last_updated = "2026-04-17"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[cost]
|
||||
input = 0
|
||||
output = 0
|
||||
cache_read = 0
|
||||
|
||||
[limit]
|
||||
context = 262_000
|
||||
output = 262_000
|
||||
|
||||
[modalities]
|
||||
input = ["text", "image"]
|
||||
output = ["text"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
@@ -0,0 +1,5 @@
|
||||
name = "Fireworks (Firepass)"
|
||||
env = ["FIREPASS_API_KEY"]
|
||||
npm = "@ai-sdk/openai-compatible"
|
||||
api = "https://api.fireworks.ai/inference/v1/"
|
||||
doc = "https://docs.fireworks.ai/firepass"
|
||||
@@ -1,5 +1,4 @@
|
||||
base_model = "deepseek/deepseek-v4-flash"
|
||||
last_updated = "2026-06-16"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
@@ -14,4 +13,4 @@ field = "reasoning_content"
|
||||
[cost]
|
||||
input = 0.14
|
||||
output = 0.28
|
||||
cache_read = 0.028
|
||||
cache_read = 0.03
|
||||
@@ -1,32 +0,0 @@
|
||||
name = "GLM 5.2"
|
||||
family = "glm"
|
||||
release_date = "2026-06-16"
|
||||
last_updated = "2026-06-16"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high", "max"]
|
||||
|
||||
[cost]
|
||||
input = 1.40
|
||||
output = 4.40
|
||||
cache_read = 0.26
|
||||
|
||||
[limit]
|
||||
context = 1_048_576
|
||||
output = 131_072
|
||||
|
||||
[modalities]
|
||||
input = ["text"]
|
||||
output = ["text"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "GPT OSS 120B"
|
||||
family = "gpt-oss"
|
||||
release_date = "2025-08-05"
|
||||
last_updated = "2026-06-16"
|
||||
last_updated = "2025-08-05"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
temperature = true
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
name = "Kimi K2.7 Code"
|
||||
family = "kimi-k2"
|
||||
release_date = "2026-06-12"
|
||||
last_updated = "2026-06-16"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
base_model = "moonshotai/kimi-k2.7-code"
|
||||
name = "Kimi K2.7 Code Fast"
|
||||
family = "kimi-k2"
|
||||
release_date = "2026-06-12"
|
||||
last_updated = "2026-06-16"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
temperature = true
|
||||
tool_call = true
|
||||
open_weights = true
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "toggle"
|
||||
|
||||
[cost]
|
||||
cache_read = 0.38
|
||||
input = 1.90
|
||||
input = 2.00
|
||||
output = 8.00
|
||||
|
||||
[limit]
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
name = "GLM-5.2"
|
||||
base_model = "zhipuai/glm-5.2"
|
||||
|
||||
[[reasoning_options]]
|
||||
type = "effort"
|
||||
values = ["high", "max"]
|
||||
|
||||
[interleaved]
|
||||
field = "reasoning_content"
|
||||
|
||||
[cost]
|
||||
input = 1.4
|
||||
output = 4.4
|
||||
cache_read = 0.26
|
||||
@@ -3,7 +3,6 @@ release_date = "1970-01-01"
|
||||
last_updated = "1970-01-01"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -3,7 +3,6 @@ release_date = "1970-01-01"
|
||||
last_updated = "1970-01-01"
|
||||
attachment = false
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
temperature = true
|
||||
tool_call = true
|
||||
structured_output = true
|
||||
|
||||
@@ -2,7 +2,6 @@ name = "Qwen 3.6 Plus"
|
||||
family = "qwen"
|
||||
attachment = true
|
||||
reasoning = true
|
||||
reasoning_options = []
|
||||
tool_call = true
|
||||
temperature = true
|
||||
release_date = "2026-04-02"
|
||||
|
||||
Loaded 100 of 689 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user