Add virtual model support for multi-key expansion

Virtual models generated from multi-key expansion are now marked and
filtered during config persistence. Virtual models display with a badge
in the UI and cannot be set as default.
This commit is contained in:
uiyzzi
2026-03-24 23:56:45 +08:00
parent 9fb01bc7f8
commit be6bf9f6c6
9 changed files with 214 additions and 4 deletions
@@ -28,7 +28,7 @@ export function ModelCard({
}: ModelCardProps) {
const { t } = useTranslation()
const isOAuth = model.auth_method === "oauth"
const canSetDefault = model.configured && !model.is_default
const canSetDefault = model.configured && !model.is_default && !model.is_virtual
return (
<div
@@ -64,6 +64,11 @@ export function ModelCard({
{t("models.badge.default")}
</span>
)}
{model.is_virtual && (
<span className="bg-muted text-muted-foreground shrink-0 rounded px-1.5 py-0.5 text-[10px] leading-none font-medium">
{t("models.badge.virtual")}
</span>
)}
</div>
<div className="flex shrink-0 items-center gap-0.5">