import type { CatalogEntry } from "@/lib/ai/registry/catalog"; import type { ModelCapabilities } from "@/lib/ai/core/types"; /** * Cerebras documented augmentation — docs/provider-research/cerebras.md (audited 2026-09-08, ~170 probes). * Verified: strict validation (unknown params → 400), reasoning via `reasoning_effort` only * (gpt-oss: low|medium|high, `none` → 400; qwen: none|low|medium|high, default high; gemma: off by default), * reasoning tokens consume `max_completion_tokens`, `tools` + `response_format` → 400 on gpt-oss, * strict json_schema needs `additionalProperties:false`, images only on gemma/qwen (base64 data URIs). * Contexts are paid-tier (131k); free tier is ~64k. gemma-4-31b is officially retired (2026-09-03) but still served. */ const caps = (vision: boolean, reasoning: boolean): ModelCapabilities => ({ text: true, vision, audioInput: false, audioOutput: false, imageGeneration: false, video: false, reasoning, tools: true, structuredOutput: true, streaming: true, files: false, webSearch: false }); const params = (levels: string[]) => ({ temperature: true, topP: true, topK: false, maxTokens: true, stop: true, seed: true, frequencyPenalty: true, presencePenalty: true, reasoningEffort: true, reasoningEffortLevels: levels, thinkingBudget: false, temperatureRange: { min: 0, max: 2 } }); export const CEREBRAS_CATALOG = new Map([ [ "gpt-oss-120b", { displayName: "GPT-OSS 120B", family: "GPT-OSS", capabilities: caps(false, true), limits: { contextTokens: 131_000, maxOutputTokens: 40_000 }, parameters: params(["low", "medium", "high"]), pricing: { inputPerMillion: 0.35, cachedInputPerMillion: 0.35, outputPerMillion: 0.75, source: "cerebras-pricing-page", asOf: "2026-09-08" }, status: "active", sortWeight: 100, metadata: { reasoningKnob: "reasoning_effort", toolsWithResponseFormat: false, defaultReasoningEffort: "medium", minOutputForReasoning: 1000 }, }, ], [ "qwen-3.8-27b", { displayName: "Qwen 3.8 27B", family: "Qwen", capabilities: caps(true, true), limits: { contextTokens: 131_072, maxOutputTokens: 40_960 }, parameters: params(["none", "low", "medium", "high"]), pricing: { inputPerMillion: 0.99, cachedInputPerMillion: 0.99, outputPerMillion: 1.49, source: "cerebras-pricing-page", asOf: "2026-09-08" }, status: "active", sortWeight: 90, metadata: { reasoningKnob: "reasoning_effort", defaultReasoningEffort: "high", minOutputForReasoning: 1000 }, }, ], [ "gemma-4-31b", { displayName: "Gemma 4 31B", family: "Gemma", capabilities: caps(true, true), limits: { contextTokens: 131_072 }, parameters: params(["none", "low", "medium", "high"]), pricing: null, status: "deprecated", sortWeight: 60, metadata: { reasoningKnob: "reasoning_effort", defaultReasoningEffort: "none", retired: "2026-09-03", note: "Removed from public endpoints on 2026-09-03 but still served for existing keys." }, }, ], ]);