mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
This builds the model catalog from per-provider definitions and models.dev v2 data. It eplacer `generate-models.ts` with one `defineProvider()` file per built-in provider, shared model-family rules (Claude, GPT, DeepSeek, Kimi, Google), and source adapters. models.dev is read through its v2 API. Outputs and CLI flags are unchanged.
14 lines
595 B
TypeScript
14 lines
595 B
TypeScript
import { defineProvider } from "../define.ts";
|
|
import { isKimiK3FamilyId, KIMI_K3_MAX_TOKENS } from "../families/kimi.ts";
|
|
|
|
export default defineProvider({
|
|
id: "vercel-ai-gateway",
|
|
models: (ctx) =>
|
|
structuredClone(ctx.sources.aiGateway.chat).map((model) =>
|
|
// Keep Kimi K3's canonical output limit when gateway metadata is missing or incorrect.
|
|
model.id.startsWith("moonshotai/") && isKimiK3FamilyId(model.id.slice("moonshotai/".length))
|
|
? { ...model, maxTokens: KIMI_K3_MAX_TOKENS }
|
|
: model,
|
|
),
|
|
classifiers: (ctx) => structuredClone(ctx.sources.aiGateway.classifiers),
|
|
});
|