diff --git a/apps/web/src/settings/provider-models.test.ts b/apps/web/src/settings/provider-models.test.ts new file mode 100644 index 000000000..57214c161 --- /dev/null +++ b/apps/web/src/settings/provider-models.test.ts @@ -0,0 +1,19 @@ +import { describe, expect, test } from "bun:test"; + +import { PROVIDER_MODELS } from "./provider-models"; + +// Mirrors `grok models` on Grok Build CLI 1.0.46 (unauthenticated, served by +// the same cli-chat-proxy.grok.com the xai provider option mints offerings +// against): the default first, then the rest of the listed catalog. +const GROK_CLI_1_0_46_CATALOG = [ + { id: "grok-4.7", label: "Grok 4.7" }, + { id: "grok-4.7-build-fast", label: "Grok 4.7 Build Fast" }, + { id: "grok-4.6", label: "Grok 4.6" }, + { id: "grok-4.5", label: "Grok 4.5" }, +] as const; + +describe("xai provider models", () => { + test("matches the Grok Build CLI 1.0.46 proxy catalog, default first", () => { + expect(PROVIDER_MODELS["xai"]).toEqual([...GROK_CLI_1_0_46_CATALOG]); + }); +}); diff --git a/apps/web/src/settings/provider-models.ts b/apps/web/src/settings/provider-models.ts index 21a865907..5895df0c8 100644 --- a/apps/web/src/settings/provider-models.ts +++ b/apps/web/src/settings/provider-models.ts @@ -22,9 +22,10 @@ export const PROVIDER_MODELS: Readonly> { id: "x-ai/grok-4", label: "Grok 4" }, ], xai: [ + { id: "grok-4.7", label: "Grok 4.7" }, + { id: "grok-4.7-build-fast", label: "Grok 4.7 Build Fast" }, { id: "grok-4.6", label: "Grok 4.6" }, - { id: "grok-4", label: "Grok 4" }, - { id: "grok-4-fast", label: "Grok 4 Fast" }, + { id: "grok-4.5", label: "Grok 4.5" }, ], codex: [{ id: "gpt-5.5", label: "GPT-5.5" }], custom: [],