SPB Git forge

spb/polyllm

Public
15commits 1branches 0releases
2.2 MBsize
maindefault branch
13 days agolast push
TypeScript 97.4% SQL 1% JavaScript 0.9% CSS 0.6%
3.0 KB · 59 lines typescript
Raw Blame History
1import type { CatalogEntry } from "@/lib/ai/registry/catalog";2import type { ModelCapabilities } from "@/lib/ai/core/types";34/**5 * Cerebras documented augmentation — docs/provider-research/cerebras.md (audited 2026-09-08, ~170 probes).6 * Verified: strict validation (unknown params → 400), reasoning via `reasoning_effort` only7 * (gpt-oss: low|medium|high, `none` → 400; qwen: none|low|medium|high, default high; gemma: off by default),8 * reasoning tokens consume `max_completion_tokens`, `tools` + `response_format` → 400 on gpt-oss,9 * strict json_schema needs `additionalProperties:false`, images only on gemma/qwen (base64 data URIs).10 * Contexts are paid-tier (131k); free tier is ~64k. gemma-4-31b is officially retired (2026-09-03) but still served.11 */12const 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 });13const 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 } });1415export const CEREBRAS_CATALOG = new Map<string, CatalogEntry>([16  [17    "gpt-oss-120b",18    {19      displayName: "GPT-OSS 120B",20      family: "GPT-OSS",21      capabilities: caps(false, true),22      limits: { contextTokens: 131_000, maxOutputTokens: 40_000 },23      parameters: params(["low", "medium", "high"]),24      pricing: { inputPerMillion: 0.35, cachedInputPerMillion: 0.35, outputPerMillion: 0.75, source: "cerebras-pricing-page", asOf: "2026-09-08" },25      status: "active",26      sortWeight: 100,27      metadata: { reasoningKnob: "reasoning_effort", toolsWithResponseFormat: false, defaultReasoningEffort: "medium", minOutputForReasoning: 1000 },28    },29  ],30  [31    "qwen-3.8-27b",32    {33      displayName: "Qwen 3.8 27B",34      family: "Qwen",35      capabilities: caps(true, true),36      limits: { contextTokens: 131_072, maxOutputTokens: 40_960 },37      parameters: params(["none", "low", "medium", "high"]),38      pricing: { inputPerMillion: 0.99, cachedInputPerMillion: 0.99, outputPerMillion: 1.49, source: "cerebras-pricing-page", asOf: "2026-09-08" },39      status: "active",40      sortWeight: 90,41      metadata: { reasoningKnob: "reasoning_effort", defaultReasoningEffort: "high", minOutputForReasoning: 1000 },42    },43  ],44  [45    "gemma-4-31b",46    {47      displayName: "Gemma 4 31B",48      family: "Gemma",49      capabilities: caps(true, true),50      limits: { contextTokens: 131_072 },51      parameters: params(["none", "low", "medium", "high"]),52      pricing: null,53      status: "deprecated",54      sortWeight: 60,55      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." },56    },57  ],58]);59