Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
// Model catalog for the composer's switcher.
//
// `id` is the selection key: it's what gets persisted in AppSettings.model
// (via app_set_model) and mirrored in desktop/src-tauri/src/commands/app.rs.
// `value` is the underlying model the row runs — informational here, since the
// Rust driver resolves the persisted `id` to the real `--model` string (local
// ids map to themselves; both proxy tiers map to PROXY_MODEL_MINIMAX_M3).
//
// Free and Pro deliberately share one `value` (same model; quota is enforced by
// the backend per subscription). They stay distinct rows only because their
// `id`s differ — that's what lets the switcher remember which tier you picked.
// The switcher only renders the "Pro" row for accounts already on an active Pro
// plan; Free accounts see an "Upgrade to Pro" CTA in its place (see
// ModelControl.jsx).
export const MODEL_CHOICES = [
{ id: "fable", value: "fable", label: "Fable", requiresPandaSignIn: false },
{ id: "opus", value: "opus", label: "Opus", requiresPandaSignIn: false },
{ id: "sonnet", value: "sonnet", label: "Sonnet", requiresPandaSignIn: false },
{ id: "vibe-free", value: "minimax,minimax/minimax-m3", label: "Free", requiresPandaSignIn: true },
{ id: "vibe-pro", value: "minimax,minimax/minimax-m3", label: "Pro", requiresPandaSignIn: true },
];
// Default selection when AppSettings.model is unset; matches the driver's
// `None → "fable"`. This is an `id`, like everything persisted.
export const DEFAULT_MODEL = "fable";
export function availableModelChoices({ signedInToPanda = false } = {}) {
return MODEL_CHOICES.filter(
(choice) => !choice.requiresPandaSignIn || signedInToPanda,
);
}
// Friendly label for a stored selection id. Falls back to the default's label
// for an unset or unrecognized id so a legacy/garbage setting still renders.
export function labelForModel(modelId) {
const found = MODEL_CHOICES.find((choice) => choice.id === modelId);
if (found) return found.label;
const fallback = MODEL_CHOICES.find((choice) => choice.id === DEFAULT_MODEL);
return (fallback ?? MODEL_CHOICES[0]).label;
}
26e259c5cThis file is pinned to the selected release. Download the original to open it in your design tool.