Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: bring the picker's Connected rows up to the On Device rows (#11196)
Michael Hanb902425d7944
diff --git a/studio/backend/core/inference/provider_model_capabilities.py b/studio/backend/core/inference/provider_model_capabilities.pyindex 9932251f3ca..a4f8d75243b 100644--- a/studio/backend/core/inference/provider_model_capabilities.py+++ b/studio/backend/core/inference/provider_model_capabilities.py@@ -114,6 +114,13 @@ def _trim_models_dev_model(model: dict[str, Any]) -> dict[str, Any]:inputs = modalities.get("input") if isinstance(modalities, dict) else Noneif isinstance(inputs, list) and inputs:entry["input"] = [m for m in inputs if isinstance(m, str)]+ # Total context window. The frontend merges this payload over its bundled snapshot per model,+ # so a field missing here erases the bundled one. limit.input is the prompt share of the+ # window and limit.output the completion cap, which max_output_tokens already carries.+ limit = model.get("limit")+ context = limit.get("context") if isinstance(limit, dict) else None+ if isinstance(context, int) and not isinstance(context, bool) and context > 0:+ entry["context"] = contextreturn entrydiff --git a/studio/backend/tests/test_provider_model_capabilities.py b/studio/backend/tests/test_provider_model_capabilities.pyindex a9de3483f9a..1cf72532909 100644--- a/studio/backend/tests/test_provider_model_capabilities.py+++ b/studio/backend/tests/test_provider_model_capabilities.py@@ -298,6 +298,59 @@ def test_models_dev_catalog_is_trimmed_and_remapped():assert catalog["gemini"]["gemini-9-flash"] == {"reasoning": True, "input": ["text", "image"]}+#: `limit` shapes that must and must not yield a context window. The frontend merges this payload+#: over its bundled snapshot per model, so emitting a junk value is worse than emitting none: it+#: displaces a good bundled window rather than falling back to it.+_CONTEXT_CASES = [+ ({"context": 1_050_000, "output": 100_000}, 1_050_000),+ ({"context": 480}, 480),+ (None, None),+ ("not-a-dict", None),+ ({"output": 4096}, None),+ ({"context": None}, None),+ ({"context": 0}, None),+ ({"context": -1}, None),+ # bool is an int in Python, and True > 0, so without the explicit bool check this would+ # emit `"context": True` for any provider that sends a flag here.+ ({"context": True}, None),+ ({"context": False}, None),+ ({"context": 1000.5}, None),+ ({"context": "1000"}, None),+]++[email protected](("limit", "expected"), _CONTEXT_CASES)+def test_the_published_context_window_survives_trimming(limit, expected):+ from core.inference.provider_model_capabilities import _trim_models_dev_model++ model = {"modalities": {"input": ["text"]}}+ if limit is not None:+ model["limit"] = limit+ entry = _trim_models_dev_model(model)+ assert entry.get("context") == expected+++def test_the_context_window_reaches_the_served_catalog():+ from core.inference.provider_model_capabilities import trim_models_dev_catalog++ raw = {+ "openrouter": {+ "models": {+ "openai/gpt-4o": {+ "modalities": {"input": ["text", "image"]},+ "limit": {"context": 128_000, "input": 120_000, "output": 16_384},+ }+ }+ }+ }+ catalog = trim_models_dev_catalog(raw)+ # limit.input is the prompt share and limit.output the completion cap; neither is the window.+ assert catalog["openrouter"]["openai/gpt-4o"] == {+ "input": ["text", "image"],+ "context": 128_000,+ }++class _FakeCatalogClient:calls = 0fail = Falsediff --git a/studio/frontend/scripts/refresh-model-catalog-snapshot.mjs b/studio/frontend/scripts/refresh-model-catalog-snapshot.mjsindex 1a97c0b8084..e856ede39b6 100644--- a/studio/frontend/scripts/refresh-model-catalog-snapshot.mjs+++ b/studio/frontend/scripts/refresh-model-catalog-snapshot.mjs@@ -47,6 +47,9 @@ function trimModel(model) {if (options.some((option) => option?.type === "toggle")) entry.toggle = true;const input = model.modalities?.input;if (Array.isArray(input) && input.length > 0) entry.input = input;+ // Total context window. limit.input is the prompt share, limit.output the completion cap.+ const context = model.limit?.context;+ if (typeof context === "number" && context > 0) entry.context = context;return entry;}@@ -80,6 +83,8 @@ const lines = [" efforts?: readonly string[];"," toggle?: true;"," input?: readonly string[];",+ " /** Published context window in tokens. */",+ " context?: number;","}","","export const MODEL_CATALOG_SNAPSHOT: Readonly<",diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsxindex af6b9d99e88..2ae839a7058 100644--- a/studio/frontend/src/features/chat/chat-page.tsx+++ b/studio/frontend/src/features/chat/chat-page.tsx@@ -21,6 +21,8 @@ import {SidebarModelConfig,useActiveModelConfig,useModelConfigHandoffStore,+ pinnedReasoningEffort,+ useModelReasoningEffortStore,} from "@/features/model-picker";import { ProjectComposer, Thread } from "@/components/assistant-ui/thread";import { usePlatformStore } from "@/config/env";@@ -182,7 +184,7 @@ import {getTrainingCompareHandoff,} from "./lib/training-compare-handoff";import {- clampReasoningEffortToLevels,+ externalReasoningTakesEffort,getExternalReasoningCapabilities,getProviderCapabilities,modelCatalogVersion,@@ -193,6 +195,7 @@ import {providerSupportsBuiltinWebSearch,providerSupportsFastMode,reasoningFieldsAfterCatalogRefresh,+ resolveExternalReasoningEffort,subscribeModelCatalog,} from "./provider-capabilities";import {@@ -220,7 +223,11 @@ import {CHAT_WEB_FETCH_TOOLS_ENABLED_KEY,PENDING_CHAT_ATTACHMENT_KEY,loadOptionalBool,+ noteEffortDisplacedByPin,+ pinHoldsLiveEffort,readPendingAttachmentTargetClaim,+ reconcilePinnedReasoningEffort,+ takeEffortDisplacedByPin,threadScopedOverride,useChatRuntimeStore,} from "./stores/chat-runtime-store";@@ -2538,41 +2545,28 @@ export function ChatPage({},);const state = useChatRuntimeStore.getState();- const preferredEffort = state.reasoningEffort;const effortLevels = reasoningCaps.reasoningEffortLevels;- const clampedEffort = clampReasoningEffortToLevels(- preferredEffort,- effortLevels,- );- // Per-provider default effort: Anthropic gets the highest level, since Claude's adaptive thinking- // adjusts cost per turn; OpenAI gets "high"; everyone else "medium". Overridable via Think.- const isAnthropic = provider?.providerType === "anthropic";- const isOpenAI = provider?.providerType === "openai";- const anthropicTopEffort = effortLevels.includes("xhigh")- ? "xhigh"- : effortLevels.includes("high")- ? "high"- : clampedEffort;- const openaiDefaultEffort = effortLevels.includes("high")- ? "high"- : effortLevels.includes("medium")- ? "medium"- : clampedEffort;- const catalogDefaultEffort =- reasoningCaps.defaultEffort &&- effortLevels.includes(reasoningCaps.defaultEffort)- ? reasoningCaps.defaultEffort- : null;- const nextReasoningEffort = reasoningCaps.supportsReasoning- ? (catalogDefaultEffort ??- (isAnthropic- ? anthropicTopEffort- : isOpenAI- ? openaiDefaultEffort- : effortLevels.includes("medium")- ? "medium"- : clampedEffort))- : state.reasoningEffort;+ // Through the shared resolver, pin included: this runs on reload and on every provider+ // resync, and resolving it without the pin is what put the provider default back over a+ // level the user had set on the model's row.+ const pinnedEffort = externalReasoningTakesEffort(reasoningCaps)+ ? pinnedReasoningEffort(inferenceParams.checkpoint, effortLevels)+ : null;+ const nextReasoningEffort = resolveExternalReasoningEffort({+ caps: reasoningCaps,+ providerType: provider?.providerType,+ // Same as the switch below: a checkpoint that changed without going through it leaves the+ // previous model's pin in the live level, which an unpinned model must not inherit.+ current:+ !pinnedEffort && pinHoldsLiveEffort()+ ? (takeEffortDisplacedByPin() ?? state.reasoningEffort)+ : state.reasoningEffort,+ pinned: pinnedEffort,+ });+ // The chat's own level, before the pin takes its place, so clearing the pin can put it back.+ if (pinnedEffort && nextReasoningEffort !== state.reasoningEffort) {+ noteEffortDisplacedByPin(state.reasoningEffort);+ }const supportsBuiltinWebSearch = providerSupportsBuiltinWebSearch(provider?.providerType,selection.modelId,@@ -2668,6 +2662,36 @@ export function ChatPage({// Reruns once settings hydrate: this normalization reads the stored pills and clamps them to the// model, and hydration refreshes what it reads, so it has to be applied last.}, [externalProvidersForChat, inferenceParams.checkpoint, settingsHydrated]);+ // Another tab can change the active model's pin (the pin store listens for the storage event),+ // and the normalization above reads the pin through a getState helper without subscribing, so+ // the composer kept the old level until a switch. Only the effort here: the pills and the rest+ // of that block are not this one's to rerun.+ const activePinnedEffort = useModelReasoningEffortStore(+ (state) => state.effortByModel[inferenceParams.checkpoint],+ );+ const appliedPinnedEffort = useRef(activePinnedEffort);+ useEffect(() => {+ if (appliedPinnedEffort.current === activePinnedEffort) return;+ appliedPinnedEffort.current = activePinnedEffort;+ const selection = parseExternalModelId(inferenceParams.checkpoint);+ if (!selection) return;+ const provider = externalProvidersForChat.find(+ (p) => p.id === selection.providerId,+ );+ const caps = getExternalReasoningCapabilities(+ provider?.providerType,+ selection.modelId,+ {+ isReasoningProvider: provider?.isReasoningModel === true,+ baseUrl: provider?.baseUrl ?? null,+ },+ );+ reconcilePinnedReasoningEffort({+ checkpoint: inferenceParams.checkpoint,+ caps,+ providerType: provider?.providerType,+ });+ }, [activePinnedEffort, externalProvidersForChat, inferenceParams.checkpoint]);// A catalog that lands after selection refreshes only the stored reasoning fields (the effort shortcut reads them),// never the selection defaults above, so a chosen effort and the pills survive the refresh.const modelCatalogChange = useSyncExternalStore(@@ -2695,6 +2719,13 @@ export function ChatPage({useChatRuntimeStore.setState(reasoningFieldsAfterCatalogRefresh(useChatRuntimeStore.getState(), caps),);+ // After the levels, not before: a pin is only applied while the catalogue calls it legal, so+ // the refresh that publishes the level is what puts the model's own pin in force.+ reconcilePinnedReasoningEffort({+ checkpoint: inferenceParams.checkpoint,+ caps,+ providerType: provider?.providerType,+ });}, [modelCatalogChange, inferenceParams.checkpoint]);const canCompare = useMemo(() => {return Boolean(inferenceParams.checkpoint) && !isExternalModel;@@ -3190,41 +3221,25 @@ export function ChatPage({baseUrl: selectedProvider?.baseUrl ?? null,},);- const preferredEffort = store.reasoningEffort;const effortLevels = reasoningCaps.reasoningEffortLevels;- const clampedEffort = clampReasoningEffortToLevels(- preferredEffort,- effortLevels,- );- // Same per-provider default policy as the useEffect above: Anthropic highest level, OpenAI- // "high", everyone else "medium".- const isAnthropic = selectedProvider?.providerType === "anthropic";- const isOpenAI = selectedProvider?.providerType === "openai";- const anthropicTopEffort = effortLevels.includes("xhigh")- ? "xhigh"- : effortLevels.includes("high")- ? "high"- : clampedEffort;- const openaiDefaultEffort = effortLevels.includes("high")- ? "high"- : effortLevels.includes("medium")- ? "medium"- : clampedEffort;- const catalogDefaultEffort =- reasoningCaps.defaultEffort &&- effortLevels.includes(reasoningCaps.defaultEffort)- ? reasoningCaps.defaultEffort- : null;- const nextReasoningEffort = reasoningCaps.supportsReasoning- ? (catalogDefaultEffort ??- (isAnthropic- ? anthropicTopEffort- : isOpenAI- ? openaiDefaultEffort- : effortLevels.includes("medium")- ? "medium"- : clampedEffort))- : store.reasoningEffort;+ const pinnedEffort = externalReasoningTakesEffort(reasoningCaps)+ ? pinnedReasoningEffort(value, effortLevels)+ : null;+ const nextReasoningEffort = resolveExternalReasoningEffort({+ caps: reasoningCaps,+ providerType: selectedProvider?.providerType,+ // The outgoing model's pin is what the live level holds, so an unpinned target resolves+ // from the chat's own effort rather than inheriting one model's override.+ current:+ !pinnedEffort && pinHoldsLiveEffort()+ ? (takeEffortDisplacedByPin() ?? store.reasoningEffort)+ : store.reasoningEffort,+ pinned: pinnedEffort,+ });+ // The chat's own level, before the pin takes its place, so clearing it can put it back.+ if (pinnedEffort && nextReasoningEffort !== store.reasoningEffort) {+ noteEffortDisplacedByPin(store.reasoningEffort);+ }// Clear any cached router-picked openrouter/free model unless staying on openrouter/free, else// the chip keeps a stale ":<chosen>" suffix.const stillOnOpenRouterFree =@@ -3337,6 +3352,9 @@ export function ChatPage({}// Local model picked: drop any cached openrouter/free chosen model.useChatRuntimeStore.setState({ lastOpenRouterChosenModel: null });+ // The chat's own effort goes back where the load applies its own reasoning fields, since+ // everything from here on can still abort or only queue a download, leaving the pinned+ // model the one running.void (async () => {let showImageCompatibilityWarning = false;if (view.mode === "single" && activeThreadId) {diff --git a/studio/frontend/src/features/chat/chat-providers-dialog.tsx b/studio/frontend/src/features/chat/chat-providers-dialog.tsxindex 438c06c0709..7fcfefa6bd1 100644--- a/studio/frontend/src/features/chat/chat-providers-dialog.tsx+++ b/studio/frontend/src/features/chat/chat-providers-dialog.tsx@@ -161,6 +161,11 @@ function formatModelSummary(models: string[]): string {interface ChatProvidersSettingsProps {providers: ExternalProviderConfig[];onProvidersChange: (providers: ExternalProviderConfig[]) => void;+ /** Open this connection's edit form on arrival instead of the list. Ignored until `providers`+ * carries the id. */+ openProviderId?: string | null;+ /** Called once honoured, so the request cannot replay on a later visit. */+ onOpenProviderConsumed?: () => void;}export function codexCapabilitiesWithPlanModels(@@ -230,6 +235,8 @@ export function resolveCodexPickerModels(export function ChatProvidersSettings({providers,onProvidersChange,+ openProviderId = null,+ onOpenProviderConsumed,}: ChatProvidersSettingsProps) {const providersRef = useRef(providers);const seededProviderTypeRef = useRef<string | null>(null);@@ -253,6 +260,7 @@ export function ChatProvidersSettings({const [registry, setRegistry] = useState<ProviderRegistryEntry[]>([]);const [availableModels, setAvailableModels] = useState<string[]>([]);const [selectedModelIds, setSelectedModelIds] = useState<string[]>([]);+ const [providersReady, setProvidersReady] = useState(false);const [syncingProviders, setSyncingProviders] = useState(false);const [registryLoading, setRegistryLoading] = useState(false);const [modelsLoading, setModelsLoading] = useState(false);@@ -444,6 +452,7 @@ export function ChatProvidersSettings({// Trust the backend response. An empty array means every connection was removed, often from// another tab; mirror that locally, else stale entries are un-removable here.onProvidersChange(syncedProviders);+ setProvidersReady(true);// An empty list never says what this page is for, so open the form instead. Reads the synced// response, not the local snapshot, so a stale empty list cannot flash the form at an// existing user. Once only, else the focus re-sync would pull the user back here.@@ -460,6 +469,9 @@ export function ChatProvidersSettings({error instanceof Error ? error.message : "Unknown error";toast.error(`Failed to load connections: ${message}`);}+ // A failed sync leaves the hydrated list as all there is. Waiting on a success the backend+ // may never give would leave the deep link dead offline, with the gear opening nothing.+ if (isMounted) setProvidersReady(true);} finally {if (isMounted && showSpinner) {setRegistryLoading(false);@@ -1206,6 +1218,26 @@ export function ChatProvidersSettings({}}+ // Wait for backend data before opening a connection's form.+ const openedProviderRef = useRef<string | null>(null);+ useEffect(() => {+ if (!openProviderId) {+ openedProviderRef.current = null;+ return;+ }+ if (!providersReady) return;+ if (openedProviderRef.current === openProviderId) return;+ const provider = providers.find(+ (candidate) => candidate.id === openProviderId,+ );+ if (!provider) return;+ openedProviderRef.current = openProviderId;+ void editProvider(provider);+ onOpenProviderConsumed?.();+ // editProvider is redeclared each render; the latch above is what fires this once per id.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [openProviderId, providers, providersReady, onOpenProviderConsumed]);+async function deleteProvider(providerId: string) {setMutatingProvider(true);try {diff --git a/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.ts b/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.tsindex f746eab20a1..3b79aaea1da 100644--- a/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.ts+++ b/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.ts@@ -80,12 +80,14 @@ import {loadedGpuMemoryFields,noteLoadedModelReasoningMode,persistGpuMemoryModeOnLoad,+ pinHoldsLiveEffort,readPersistedGpuMemoryMode,readPersistedSpeculativeType,reconcilePersistedGpuIds,resolvePreserveThinkingOnLoad,resolveToolsEnabledOnLoad,saveSpeculativeType,+ takeEffortDisplacedByPin,useChatRuntimeStore,type LoadingModelPick,type ReasoningEffort,@@ -1965,7 +1967,12 @@ export function useChatModelRuntime() {loadResponse.reasoning_effort_levels.length > 0? (loadResponse.reasoning_effort_levels as ReasoningEffort[]): (["low", "medium", "high"] as const);- const existingReasoningEffort = useChatRuntimeStore.getState().reasoningEffort;+ // The chat's own level when the model this replaces was running a pin's, for the+ // reason applyActiveModelStatusToStore gives at its own clamp: a pin is one model's,+ // and everything between the pick and this response can abort without loading.+ const existingReasoningEffort =+ (pinHoldsLiveEffort() ? takeEffortDisplacedByPin() : null) ??+ useChatRuntimeStore.getState().reasoningEffort;const clampedReasoningEffort =reasoningStyle === "enable_thinking_effort" ||reasoningStyle === "reasoning_effort"diff --git a/studio/frontend/src/features/chat/index.ts b/studio/frontend/src/features/chat/index.tsindex 96f198162bb..5cea8f5cffd 100644--- a/studio/frontend/src/features/chat/index.ts+++ b/studio/frontend/src/features/chat/index.ts@@ -201,6 +201,14 @@ export {isExternalModelId,parseExternalModelId,} from "./external-providers";+// A provider catalogue lands async, so capability reads need to re-run when it does.+export { modelCatalogVersion, subscribeModelCatalog } from "./model-catalog";+// What a per-model reasoning pin displaced in the live runtime, so clearing it can put it back.+export {+ noteEffortDisplacedByPin,+ reconcilePinnedReasoningEffort,+ takeEffortDisplacedByPin,+} from "./stores/chat-runtime-store";export {type AttachmentText,assertDocumentAttachmentSize,diff --git a/studio/frontend/src/features/chat/lib/apply-inference-status-to-store.ts b/studio/frontend/src/features/chat/lib/apply-inference-status-to-store.tsindex f79c0386732..a24b163badf 100644--- a/studio/frontend/src/features/chat/lib/apply-inference-status-to-store.ts+++ b/studio/frontend/src/features/chat/lib/apply-inference-status-to-store.ts@@ -25,8 +25,10 @@ import {loadedGpuMemoryFields,normalizeSpeculativeType,noteLoadedModelReasoningMode,+ pinHoldsLiveEffort,resolvePreserveThinkingOnLoad,resolveToolsEnabledOnLoad,+ takeEffortDisplacedByPin,useChatRuntimeStore,} from "../stores/chat-runtime-store";import {@@ -205,14 +207,18 @@ export function applyActiveModelStatusToStore(const storedReasoningEnabled = loadOptionalBool(CHAT_REASONING_ENABLED_KEY);const currentSpecType = normalizeSpeculativeType(status.speculative_type);const prevState = useChatRuntimeStore.getState();+ // The chat's own level when the model this replaces was running a per-model pin's: the clamp+ // narrows the chat's level to this model's ladder, and a pin is one model's, not the chat's.+ // Taken here rather than where the model was picked, because this is a model that has actually+ // become resident: everything from the pick to here can still abort, or only queue a download.+ const effortToClamp =+ (pinHoldsLiveEffort() ? takeEffortDisplacedByPin() : null) ??+ prevState.reasoningEffort;const clampedReasoningEffort =reasoningStyle === "enable_thinking_effort" ||reasoningStyle === "reasoning_effort"- ? clampReasoningEffortToLevels(- prevState.reasoningEffort,- reasoningEffortLevels,- )- : clampLocalReasoningEffort(prevState.reasoningEffort);+ ? clampReasoningEffortToLevels(effortToClamp, reasoningEffortLevels)+ : clampLocalReasoningEffort(effortToClamp);const nextDefaultChatTemplate =status.chat_template === undefined? prevState.defaultChatTemplatediff --git a/studio/frontend/src/features/chat/model-catalog-snapshot.ts b/studio/frontend/src/features/chat/model-catalog-snapshot.tsindex fd43ba66475..4a3198de333 100644--- a/studio/frontend/src/features/chat/model-catalog-snapshot.ts+++ b/studio/frontend/src/features/chat/model-catalog-snapshot.ts@@ -1,13 +1,15 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0-// Generated by scripts/refresh-model-catalog-snapshot.mjs from https://models.dev/api.json on 2026-09-14. Do not edit by hand.+// Generated by scripts/refresh-model-catalog-snapshot.mjs from https://models.dev/api.json on 2026-09-17. Do not edit by hand.export interface ModelCatalogSnapshotEntry {reasoning?: true;efforts?: readonly string[];toggle?: true;input?: readonly string[];+ /** Published context window in tokens. */+ context?: number;}export const MODEL_CATALOG_SNAPSHOT: Readonly<@@ -15,709 +17,712 @@ export const MODEL_CATALOG_SNAPSHOT: Readonly<> = {"openai": {"chatgpt-image-latest": {"input":["text","image"]},- "gpt-3.5-turbo": {"input":["text"]},- "gpt-4": {"input":["text"]},- "gpt-4-turbo": {"input":["text","image"]},- "gpt-4.1": {"input":["text","image","pdf"]},- "gpt-4.1-mini": {"input":["text","image","pdf"]},- "gpt-4.1-nano": {"input":["text","image"]},- "gpt-4o": {"input":["text","image","pdf"]},- "gpt-4o-2024-05-13": {"input":["text","image"]},- "gpt-4o-2024-08-06": {"input":["text","image"]},- "gpt-4o-2024-11-20": {"input":["text","image"]},- "gpt-4o-mini": {"input":["text","image","pdf"]},- "gpt-5": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image"]},- "gpt-5-mini": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image"]},- "gpt-5-nano": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image"]},- "gpt-5-pro": {"reasoning":true,"efforts":["high"],"input":["text","image"]},- "gpt-5.1": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text","image"]},- "gpt-5.2": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image"]},- "gpt-5.2-chat-latest": {"reasoning":true,"efforts":["medium"],"input":["text","image"]},- "gpt-5.2-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image"]},- "gpt-5.3-chat-latest": {"input":["text","image"]},- "gpt-5.3-codex": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "gpt-5.3-codex-spark": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "gpt-5.4": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "gpt-5.4-mini": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image"]},- "gpt-5.4-nano": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image"]},- "gpt-5.4-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image"]},- "gpt-5.5": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "gpt-5.5-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image","pdf"]},- "gpt-5.6": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "gpt-5.6-luna": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "gpt-5.6-sol": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "gpt-5.6-terra": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "gpt-6-astra": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},+ "gpt-3.5-turbo": {"input":["text"],"context":16385},+ "gpt-4": {"input":["text"],"context":8192},+ "gpt-4-turbo": {"input":["text","image"],"context":128000},+ "gpt-4.1": {"input":["text","image","pdf"],"context":1047576},+ "gpt-4.1-mini": {"input":["text","image","pdf"],"context":1047576},+ "gpt-4.1-nano": {"input":["text","image"],"context":1047576},+ "gpt-4o": {"input":["text","image","pdf"],"context":128000},+ "gpt-4o-2024-05-13": {"input":["text","image"],"context":128000},+ "gpt-4o-2024-08-06": {"input":["text","image"],"context":128000},+ "gpt-4o-2024-11-20": {"input":["text","image"],"context":128000},+ "gpt-4o-mini": {"input":["text","image","pdf"],"context":128000},+ "gpt-5": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image"],"context":400000},+ "gpt-5-mini": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image"],"context":400000},+ "gpt-5-nano": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image"],"context":400000},+ "gpt-5-pro": {"reasoning":true,"efforts":["high"],"input":["text","image"],"context":400000},+ "gpt-5.1": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text","image"],"context":400000},+ "gpt-5.2": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image"],"context":400000},+ "gpt-5.2-chat-latest": {"reasoning":true,"efforts":["medium"],"input":["text","image"],"context":128000},+ "gpt-5.2-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image"],"context":400000},+ "gpt-5.3-chat-latest": {"input":["text","image"],"context":128000},+ "gpt-5.3-codex": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":400000},+ "gpt-5.3-codex-spark": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":128000},+ "gpt-5.4": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "gpt-5.4-mini": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image"],"context":400000},+ "gpt-5.4-nano": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image"],"context":400000},+ "gpt-5.4-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image"],"context":1050000},+ "gpt-5.5": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "gpt-5.5-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "gpt-5.6": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "gpt-5.6-luna": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "gpt-5.6-sol": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "gpt-5.6-terra": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "gpt-6-astra": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},"gpt-image-1": {"input":["text","image"]},"gpt-image-1-mini": {"input":["text","image"]},"gpt-image-1.5": {"input":["text","image"]},"gpt-image-2": {"input":["text","image"]},- "gpt-realtime-2.1": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","audio","image"]},- "o1": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"]},- "o1-pro": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"]},- "o3": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"]},- "o3-mini": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "o3-pro": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"]},- "o4-mini": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"]},- "text-embedding-3-large": {"input":["text"]},- "text-embedding-3-small": {"input":["text"]},- "text-embedding-ada-002": {"input":["text"]},+ "gpt-realtime-2.1": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","audio","image"],"context":128000},+ "o1": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"],"context":200000},+ "o1-pro": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"],"context":200000},+ "o3": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"],"context":200000},+ "o3-mini": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":200000},+ "o3-pro": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"],"context":200000},+ "o4-mini": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"],"context":200000},+ "text-embedding-3-large": {"input":["text"],"context":8191},+ "text-embedding-3-small": {"input":["text"],"context":8191},+ "text-embedding-ada-002": {"input":["text"],"context":8192},},"anthropic": {- "claude-fable-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "claude-fable-5-1": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "claude-haiku-4-5": {"reasoning":true,"input":["text","image","pdf"]},- "claude-haiku-4-5-20251001": {"reasoning":true,"input":["text","image","pdf"]},- "claude-opus-4-5": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"]},- "claude-opus-4-5-20251101": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"]},- "claude-opus-4-6": {"reasoning":true,"efforts":["low","medium","high","max"],"input":["text","image","pdf"]},- "claude-opus-4-7": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "claude-opus-4-8": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "claude-opus-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "claude-sonnet-4-5": {"reasoning":true,"input":["text","image","pdf"]},- "claude-sonnet-4-5-20250929": {"reasoning":true,"input":["text","image","pdf"]},- "claude-sonnet-4-6": {"reasoning":true,"efforts":["low","medium","high","max"],"input":["text","image","pdf"]},- "claude-sonnet-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},+ "claude-fable-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-fable-5-1": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-haiku-4-5": {"reasoning":true,"input":["text","image","pdf"],"context":200000},+ "claude-haiku-4-5-20251001": {"reasoning":true,"input":["text","image","pdf"],"context":200000},+ "claude-opus-4-5": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"],"context":200000},+ "claude-opus-4-5-20251101": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"],"context":200000},+ "claude-opus-4-6": {"reasoning":true,"efforts":["low","medium","high","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-opus-4-7": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-opus-4-8": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-opus-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-sonnet-4-5": {"reasoning":true,"input":["text","image","pdf"],"context":1000000},+ "claude-sonnet-4-5-20250929": {"reasoning":true,"input":["text","image","pdf"],"context":1000000},+ "claude-sonnet-4-6": {"reasoning":true,"efforts":["low","medium","high","max"],"input":["text","image","pdf"],"context":1000000},+ "claude-sonnet-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},},"openrouter": {- "~anthropic/claude-fable-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "~anthropic/claude-haiku-latest": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "~anthropic/claude-opus-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},- "~anthropic/claude-sonnet-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},- "~deepseek/deepseek-v4-flash-latest": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"]},- "~google/gemini-flash-latest": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","pdf","audio"]},- "~google/gemini-pro-latest": {"reasoning":true,"efforts":["low","medium","high"],"input":["audio","pdf","image","text","video"]},- "~moonshotai/kimi-latest": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image","video"]},- "~openai/gpt-astra-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["pdf","image","text"]},- "~openai/gpt-luna-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["pdf","image","text"]},- "~openai/gpt-mini-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"]},- "~openai/gpt-sol-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["pdf","image","text"]},- "~openai/gpt-terra-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["pdf","image","text"]},- "~x-ai/grok-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image","pdf"]},- "~z-ai/glm-flash-latest": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image","video"]},- "~z-ai/glm-latest": {"reasoning":true,"efforts":["low","high","max"],"input":["text"]},- "aion-labs/aion-2.0": {"reasoning":true,"input":["text"]},- "aion-labs/aion-3.0": {"reasoning":true,"input":["text"]},- "aion-labs/aion-3.0-mini": {"reasoning":true,"input":["text"]},- "aion-labs/aion-rp-llama-3.1-8b": {"input":["text"]},- "amazon/nova-2-lite-v1": {"reasoning":true,"toggle":true,"input":["text","image","video","pdf"]},- "amazon/nova-lite-v1": {"input":["text","image"]},- "amazon/nova-micro-v1": {"input":["text"]},- "amazon/nova-premier-v1": {"input":["text","image"]},- "amazon/nova-pro-v1": {"input":["text","image"]},- "anthracite-org/magnum-v4-72b": {"input":["text"]},- "anthropic/claude-3-haiku": {"input":["text","image"]},- "anthropic/claude-fable-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "anthropic/claude-fable-5.1": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "anthropic/claude-haiku-4.5": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-opus-4": {"reasoning":true,"toggle":true,"input":["image","text","pdf"]},- "anthropic/claude-opus-4.1": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-opus-4.5": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-opus-4.6": {"reasoning":true,"efforts":["low","medium","high","max"],"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-opus-4.7": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-opus-4.8": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-opus-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-sonnet-4": {"reasoning":true,"toggle":true,"input":["image","text","pdf"]},- "anthropic/claude-sonnet-4.5": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-sonnet-4.6": {"reasoning":true,"efforts":["low","medium","high","max"],"toggle":true,"input":["text","image","pdf"]},- "anthropic/claude-sonnet-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"]},- "arcee-ai/trinity-large-thinking": {"reasoning":true,"input":["text"]},- "baidu/ernie-4.5-vl-424b-a47b": {"reasoning":true,"toggle":true,"input":["image","text"]},- "bytedance-seed/seed-1.6": {"reasoning":true,"toggle":true,"input":["image","text","video"]},- "bytedance-seed/seed-1.6-flash": {"reasoning":true,"toggle":true,"input":["image","text","video"]},- "bytedance-seed/seed-2-1-turbo": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "bytedance-seed/seed-2.0-code": {"reasoning":true,"efforts":["low","medium","high"],"toggle":true,"input":["text","image","video"]},- "bytedance-seed/seed-2.0-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video"]},- "bytedance-seed/seed-2.0-mini": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video"]},- "bytedance/ui-tars-1.5-7b": {"input":["image","text"]},- "cognitivecomputations/dolphin-mistral-24b-venice-edition": {"input":["text"]},- "cohere/command-a": {"input":["text"]},- "cohere/command-r-08-2024": {"input":["text"]},- "cohere/command-r-plus-08-2024": {"input":["text"]},- "cohere/command-r7b-12-2024": {"input":["text"]},- "cohere/north-mini-code:free": {"reasoning":true,"toggle":true,"input":["text"]},- "deepseek/deepseek-chat": {"input":["text"]},- "deepseek/deepseek-chat-v3-0324": {"input":["text"]},- "deepseek/deepseek-chat-v3.1": {"reasoning":true,"toggle":true,"input":["text"]},- "deepseek/deepseek-r1": {"reasoning":true,"input":["text"]},- "deepseek/deepseek-r1-0528": {"reasoning":true,"input":["text"]},- "deepseek/deepseek-r1-distill-llama-70b": {"reasoning":true,"toggle":true,"input":["text"]},- "deepseek/deepseek-v3.1-terminus": {"reasoning":true,"toggle":true,"input":["text"]},- "deepseek/deepseek-v3.2": {"reasoning":true,"toggle":true,"input":["text"]},- "deepseek/deepseek-v3.2-exp": {"reasoning":true,"toggle":true,"input":["text"]},- "deepseek/deepseek-v4-flash": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"]},- "deepseek/deepseek-v4-flash-0731": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"]},- "deepseek/deepseek-v4-flash-vision-exp": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "deepseek/deepseek-v4-pro": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"]},- "deepseek/deepseek-v4-pro-0813": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"]},- "deepseek/deepseek-v4.1-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "dots-studio/dots-3-note-preview:free": {"reasoning":true,"toggle":true,"input":["text","image"]},- "google/gemini-2.5-flash": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"]},- "google/gemini-2.5-flash-image": {"input":["text","image"]},- "google/gemini-2.5-flash-lite": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"]},- "google/gemini-2.5-pro": {"reasoning":true,"input":["text","image","audio","video","pdf"]},- "google/gemini-2.5-pro-preview": {"reasoning":true,"input":["pdf","image","text","audio"]},- "google/gemini-2.5-pro-preview-05-06": {"reasoning":true,"input":["text","image","pdf","audio","video"]},- "google/gemini-3-flash-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video","audio","pdf"]},- "google/gemini-3-pro-image": {"reasoning":true,"input":["text","image"]},- "google/gemini-3-pro-image-preview": {"reasoning":true,"input":["text","image"]},- "google/gemini-3.1-flash-image": {"reasoning":true,"efforts":["minimal","high"],"toggle":true,"input":["image","text"]},- "google/gemini-3.1-flash-image-preview": {"reasoning":true,"efforts":["minimal","high"],"toggle":true,"input":["image","text"]},- "google/gemini-3.1-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video","audio","pdf"]},- "google/gemini-3.1-flash-lite-image": {"reasoning":true,"efforts":["minimal","high"],"toggle":true,"input":["text","image"]},- "google/gemini-3.1-flash-lite-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video","audio","pdf"]},- "google/gemini-3.1-pro-preview": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemini-3.1-pro-preview-customtools": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemini-3.5-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemini-3.5-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemini-3.6-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemini-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemini-3.8-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "google/gemma-2-27b-it": {"input":["text"]},- "google/gemma-3-12b-it": {"input":["text","image"]},- "google/gemma-3-27b-it": {"input":["text","image"]},- "google/gemma-3-4b-it": {"input":["text","image"]},- "google/gemma-4-26b-a4b-it": {"reasoning":true,"toggle":true,"input":["image","text","video"]},- "google/gemma-4-26b-a4b-it:free": {"reasoning":true,"toggle":true,"input":["image","text","video"]},- "google/gemma-4-31b-it": {"reasoning":true,"toggle":true,"input":["image","text","video"]},- "google/gemma-4-31b-it:free": {"reasoning":true,"toggle":true,"input":["image","text","video"]},- "google/lyria-3-clip-preview": {"input":["text","image"]},- "google/lyria-3-pro-preview": {"input":["text","image"]},- "gryphe/mythomax-l2-13b": {"input":["text"]},- "ibm-granite/granite-4.0-h-micro": {"input":["text"]},- "ibm-granite/granite-4.2-8b": {"reasoning":true,"efforts":["none","low","high"],"input":["text"]},- "inception/mercury-2": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text"]},- "inception/mercury-2.5": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text"]},- "inclusionai/ling-3.0-flash": {"reasoning":true,"toggle":true,"input":["text"]},- "inclusionai/ling-3.0-flash-fin": {"reasoning":true,"toggle":true,"input":["text"]},- "inclusionai/ling-3.0-flash-fin:free": {"reasoning":true,"toggle":true,"input":["text"]},- "inclusionai/ling-3.0-flash-sante:free": {"reasoning":true,"toggle":true,"input":["text"]},- "inclusionai/ling-3.0-flash-vl": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "inclusionai/ling-3.0-flash-vl:free": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "inference-net/schematron-v2-small": {"input":["text"]},- "inference-net/schematron-v2-turbo": {"input":["text"]},- "kwaipilot/kat-coder-pro-v2": {"input":["text"]},- "kwaipilot/kat-coder-pro-v2.5": {"input":["text"]},- "liquid/lfm-2.5-2.6b:free": {"reasoning":true,"input":["text"]},- "mancer/weaver": {"input":["text"]},- "meituan/longcat-2.0": {"reasoning":true,"toggle":true,"input":["text"]},- "meta-llama/llama-3.1-70b-instruct": {"input":["text"]},- "meta-llama/llama-3.1-8b-instruct": {"input":["text"]},- "meta-llama/llama-3.2-1b-instruct": {"input":["text"]},- "meta-llama/llama-3.2-3b-instruct": {"input":["text"]},- "meta-llama/llama-3.3-70b-instruct": {"input":["text"]},- "meta-llama/llama-4-maverick": {"input":["text","image"]},- "meta-llama/llama-4-scout": {"input":["text","image"]},- "meta-llama/llama-guard-4-12b": {"input":["image","text"]},- "meta/muse-glimmer-30b": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image"]},- "meta/muse-spark-1.1": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video","pdf","audio"]},- "meta/muse-spark-1.2": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video","pdf","audio"]},- "meta/muse-spark-1.2-contributor": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video","pdf","audio"]},- "meta/muse-spark-1.3": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh","max"],"input":["text","image","video","pdf","audio"]},- "meta/muse-spark-1.3-contributor": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh","max"],"input":["text","image","video","pdf","audio"]},- "microsoft/phi-4": {"input":["text"]},- "microsoft/wizardlm-2-8x22b": {"input":["text"]},- "minimax/minimax-01": {"input":["text","image"]},- "minimax/minimax-m1": {"reasoning":true,"toggle":true,"input":["text"]},- "minimax/minimax-m2": {"reasoning":true,"input":["text"]},- "minimax/minimax-m2-her": {"input":["text"]},- "minimax/minimax-m2.1": {"reasoning":true,"input":["text"]},- "minimax/minimax-m2.5": {"reasoning":true,"input":["text"]},- "minimax/minimax-m2.7": {"reasoning":true,"input":["text"]},- "minimax/minimax-m3": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "mistralai/codestral-2508": {"input":["text","pdf"]},- "mistralai/devstral-2512": {"input":["text","pdf"]},- "mistralai/ministral-14b-2512": {"input":["text","image"]},- "mistralai/ministral-3b-2512": {"input":["text","image"]},- "mistralai/ministral-8b-2512": {"input":["text","image"]},- "mistralai/mistral-large": {"input":["text","pdf"]},- "mistralai/mistral-large-2407": {"input":["text","pdf"]},- "mistralai/mistral-large-2512": {"input":["text","image","pdf"]},- "mistralai/mistral-medium-3": {"input":["text","image","pdf"]},- "mistralai/mistral-medium-3-5": {"reasoning":true,"efforts":["none","high"],"input":["text","image","pdf"]},- "mistralai/mistral-medium-3.1": {"input":["text","image","pdf"]},- "mistralai/mistral-nemo": {"input":["text"]},- "mistralai/mistral-saba": {"input":["text","pdf"]},- "mistralai/mistral-small-24b-instruct-2501": {"input":["text"]},- "mistralai/mistral-small-2603": {"reasoning":true,"efforts":["none","high"],"input":["text","image"]},- "mistralai/mistral-small-3.1-24b-instruct": {"input":["text","image"]},- "mistralai/mistral-small-3.2-24b-instruct": {"input":["image","text"]},- "mistralai/mixtral-8x22b-instruct": {"input":["text","pdf"]},- "mistralai/voxtral-small-24b-2507": {"input":["text","audio","pdf"]},- "moonshotai/kimi-k2": {"input":["text"]},- "moonshotai/kimi-k2-0905": {"input":["text"]},- "moonshotai/kimi-k2-thinking": {"reasoning":true,"input":["text"]},- "moonshotai/kimi-k2.5": {"reasoning":true,"toggle":true,"input":["text","image"]},- "moonshotai/kimi-k2.6": {"reasoning":true,"toggle":true,"input":["text","image"]},- "moonshotai/kimi-k2.7-code": {"reasoning":true,"input":["text","image"]},- "moonshotai/kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image","video"]},- "morph/morph-v3-fast": {"input":["text"]},- "morph/morph-v3-large": {"input":["text"]},- "nex-agi/nex-n2.5-mini:free": {"reasoning":true,"efforts":["none","medium","high"],"input":["text","image"]},- "nex-agi/nex-n2.5-pro:free": {"reasoning":true,"efforts":["none","medium","high"],"input":["text","image"]},- "nousresearch/hermes-3-llama-3.1-405b": {"input":["text"]},- "nousresearch/hermes-3-llama-3.1-70b": {"input":["text"]},- "nousresearch/hermes-4-405b": {"reasoning":true,"toggle":true,"input":["text"]},- "nvidia/nemotron-3-nano-30b-a3b": {"reasoning":true,"toggle":true,"input":["text"]},- "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "nvidia/nemotron-3-super-120b-a12b": {"reasoning":true,"efforts":["low","medium"],"toggle":true,"input":["text"]},- "nvidia/nemotron-3-super-120b-a12b:free": {"reasoning":true,"efforts":["low","medium"],"toggle":true,"input":["text"]},- "nvidia/nemotron-3-ultra-550b-a55b": {"reasoning":true,"efforts":["medium","high"],"toggle":true,"input":["text"]},- "nvidia/nemotron-3-ultra-550b-a55b:free": {"reasoning":true,"efforts":["medium","high"],"toggle":true,"input":["text"]},- "nvidia/nemotron-3.5-content-safety": {"reasoning":true,"toggle":true,"input":["text","image"]},- "nvidia/nemotron-3.5-content-safety:free": {"reasoning":true,"toggle":true,"input":["text","image"]},- "nvidia/nemotron-3.5-lightning": {"reasoning":true,"toggle":true,"input":["text"]},- "nvidia/nemotron-3.5-lightning:free": {"reasoning":true,"toggle":true,"input":["text"]},- "openai/gpt-3.5-turbo": {"input":["text"]},- "openai/gpt-3.5-turbo-0613": {"input":["text"]},- "openai/gpt-3.5-turbo-16k": {"input":["text"]},- "openai/gpt-3.5-turbo-instruct": {"input":["text"]},- "openai/gpt-4": {"input":["text"]},- "openai/gpt-4-turbo": {"input":["text","image"]},- "openai/gpt-4-turbo-preview": {"input":["text"]},- "openai/gpt-4.1": {"input":["text","image","pdf"]},- "openai/gpt-4.1-mini": {"input":["text","image","pdf"]},- "openai/gpt-4.1-nano": {"input":["image","text","pdf"]},- "openai/gpt-4o": {"input":["text","image","pdf"]},- "openai/gpt-4o-2024-05-13": {"input":["text","image","pdf"]},- "openai/gpt-4o-2024-08-06": {"input":["text","image","pdf"]},- "openai/gpt-4o-2024-11-20": {"input":["text","image","pdf"]},- "openai/gpt-4o-mini": {"input":["text","image","pdf"]},- "openai/gpt-4o-mini-2024-07-18": {"input":["text","image","pdf"]},- "openai/gpt-5": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","pdf"]},- "openai/gpt-5-image": {"reasoning":true,"input":["image","text","pdf"]},- "openai/gpt-5-image-mini": {"reasoning":true,"input":["pdf","image","text"]},- "openai/gpt-5-mini": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","pdf"]},- "openai/gpt-5-nano": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","pdf"]},- "openai/gpt-5-pro": {"reasoning":true,"efforts":["high"],"input":["image","text","pdf"]},- "openai/gpt-5.1": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["image","text","pdf"]},- "openai/gpt-5.1-codex": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"]},- "openai/gpt-5.1-codex-max": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image"]},- "openai/gpt-5.1-codex-mini": {"reasoning":true,"efforts":["low","medium","high"],"toggle":true,"input":["text","image"]},- "openai/gpt-5.2": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"]},- "openai/gpt-5.2-chat": {"input":["pdf","image","text"]},- "openai/gpt-5.2-codex": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image"]},- "openai/gpt-5.2-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["image","text","pdf"]},- "openai/gpt-5.3-codex": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "openai/gpt-5.4": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "openai/gpt-5.4-image-2": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["image","text","pdf"]},- "openai/gpt-5.4-mini": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"]},- "openai/gpt-5.4-nano": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"]},- "openai/gpt-5.4-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image","pdf"]},- "openai/gpt-5.5": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"]},- "openai/gpt-5.5-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image","pdf"]},- "openai/gpt-5.6-luna": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-5.6-luna-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-5.6-sol": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-5.6-sol-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-5.6-terra": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-5.6-terra-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-6-astra": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"]},- "openai/gpt-6-astra-pro": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["pdf","image","text"]},- "openai/gpt-audio": {"input":["text","audio"]},- "openai/gpt-audio-mini": {"input":["text","audio"]},- "openai/gpt-chat-latest": {"input":["text","image","pdf"]},- "openai/gpt-oss-120b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "openai/gpt-oss-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "openai/gpt-oss-safeguard-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "openai/o1": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "openai/o1-pro": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "openai/o3": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "openai/o3-mini": {"reasoning":true,"toggle":true,"input":["text","pdf"]},- "openai/o3-mini-high": {"reasoning":true,"efforts":["high"],"input":["text","pdf"]},- "openai/o3-pro": {"reasoning":true,"toggle":true,"input":["text","pdf","image"]},- "openai/o4-mini": {"reasoning":true,"toggle":true,"input":["image","text","pdf"]},- "openai/o4-mini-high": {"reasoning":true,"efforts":["high"],"input":["image","text","pdf"]},- "openrouter/auto": {"reasoning":true,"input":["text","image","audio","pdf","video"]},- "openrouter/bodybuilder": {"input":["text"]},- "openrouter/free": {"reasoning":true,"input":["text","image"]},- "openrouter/fusion": {"input":["text"]},- "openrouter/pareto-code": {"input":["text"]},- "perceptron/perceptron-mk1": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "perplexity/sonar": {"input":["text","image"]},- "perplexity/sonar-deep-research": {"reasoning":true,"toggle":true,"input":["text"]},- "perplexity/sonar-pro": {"input":["text","image"]},- "perplexity/sonar-pro-search": {"reasoning":true,"input":["text","image"]},- "perplexity/sonar-reasoning-pro": {"reasoning":true,"toggle":true,"input":["text","image"]},- "poolside/laguna-s-2.1": {"reasoning":true,"toggle":true,"input":["text"]},- "poolside/laguna-s-2.1:free": {"reasoning":true,"toggle":true,"input":["text"]},- "poolside/laguna-xs-2.1": {"reasoning":true,"toggle":true,"input":["text"]},- "poolside/laguna-xs-2.1:free": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen-2.5-72b-instruct": {"input":["text"]},- "qwen/qwen-2.5-7b-instruct": {"input":["text"]},- "qwen/qwen-2.5-coder-32b-instruct": {"input":["text"]},- "qwen/qwen-plus": {"input":["text"]},- "qwen/qwen-plus-2025-07-28": {"input":["text"]},- "qwen/qwen2.5-vl-72b-instruct": {"input":["text","image"]},- "qwen/qwen3-14b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3-235b-a22b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3-235b-a22b-2507": {"input":["text"]},- "qwen/qwen3-235b-a22b-thinking-2507": {"reasoning":true,"input":["text"]},- "qwen/qwen3-30b-a3b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3-30b-a3b-instruct-2507": {"input":["text"]},- "qwen/qwen3-30b-a3b-thinking-2507": {"reasoning":true,"input":["text"]},- "qwen/qwen3-32b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3-8b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3-coder": {"input":["text"]},- "qwen/qwen3-coder-30b-a3b-instruct": {"input":["text"]},- "qwen/qwen3-coder-flash": {"input":["text"]},- "qwen/qwen3-coder-next": {"input":["text"]},- "qwen/qwen3-coder-plus": {"input":["text"]},- "qwen/qwen3-max": {"input":["text"]},- "qwen/qwen3-max-thinking": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3-next-80b-a3b-instruct": {"input":["text"]},- "qwen/qwen3-next-80b-a3b-thinking": {"reasoning":true,"input":["text"]},- "qwen/qwen3-vl-235b-a22b-instruct": {"input":["text","image"]},- "qwen/qwen3-vl-235b-a22b-thinking": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3-vl-30b-a3b-instruct": {"input":["text","image"]},- "qwen/qwen3-vl-30b-a3b-thinking": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3-vl-32b-instruct": {"input":["text","image"]},- "qwen/qwen3-vl-8b-instruct": {"input":["image","text"]},- "qwen/qwen3-vl-8b-thinking": {"reasoning":true,"input":["image","text"]},- "qwen/qwen3.5-122b-a10b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-27b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-397b-a17b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-9b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-flash-02-23": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-plus-02-15": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.5-plus-20260420": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.6-27b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.6-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.6-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.6-max-preview": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3.6-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.7-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.7-max": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen/qwen3.7-plus": {"reasoning":true,"toggle":true,"input":["text","image"]},- "qwen/qwen3.8-2.4t-a95b": {"reasoning":true,"efforts":["low","medium","xhigh"],"input":["text"]},- "qwen/qwen3.8-27b": {"reasoning":true,"efforts":["low","medium","xhigh"],"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.8-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen/qwen3.8-max-0902": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video"]},- "rekaai/reka-edge": {"input":["image","text","video"]},- "rekaai/reka-flash-3": {"reasoning":true,"input":["text"]},- "relace/relace-apply-3": {"input":["text"]},- "relace/relace-search": {"input":["text"]},- "sakana/fugu-max": {"reasoning":true,"efforts":["high","xhigh","max"],"input":["text","image","pdf"]},- "sakana/fugu-ultra": {"reasoning":true,"efforts":["high","xhigh","max"],"input":["text","image"]},- "sakana/fugu-ultra-v2": {"reasoning":true,"efforts":["high","xhigh","max"],"input":["text","image","pdf"]},- "sakana/sakana-namazu": {"reasoning":true,"efforts":["none","high"],"input":["text","image","pdf"]},- "sao10k/l3-lunaris-8b": {"input":["text"]},- "sao10k/l3.1-euryale-70b": {"input":["text"]},- "sao10k/l3.3-euryale-70b": {"input":["text"]},- "stepfun/step-3.5-flash": {"reasoning":true,"input":["text"]},- "stepfun/step-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video"]},- "tencent/hunyuan-a13b-instruct": {"reasoning":true,"toggle":true,"input":["text"]},- "tencent/hy-mt2-1.8b": {"input":["text"]},- "tencent/hy-mt2-30b-a3b": {"input":["text"]},- "tencent/hy-mt2-7b": {"input":["text"]},- "tencent/hy3": {"reasoning":true,"efforts":["none","low","high"],"input":["text"]},- "tencent/hy3-preview": {"reasoning":true,"efforts":["none","low","high"],"input":["text"]},- "tencent/hy4-preview": {"reasoning":true,"efforts":["none","low","high"],"input":["text"]},- "thedrummer/cydonia-24b-v4.1": {"input":["text"]},- "thedrummer/skyfall-36b-v2": {"input":["text"]},- "thedrummer/unslopnemo-12b": {"input":["text"]},- "thinkingmachines/inkling": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"]},- "thinkingmachines/inkling-small": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"]},- "thinkingmachines/inkling-small:free": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"]},- "thinkingmachines/inkling:free": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"]},- "undi95/remm-slerp-l2-13b": {"input":["text"]},- "upstage/solar-pro-3": {"reasoning":true,"toggle":true,"input":["text"]},- "upstage/solar-pro4": {"reasoning":true,"toggle":true,"input":["text"]},- "writer/palmyra-x5": {"input":["text"]},- "x-ai/grok-4.20": {"reasoning":true,"toggle":true,"input":["text","image","pdf"]},- "x-ai/grok-4.20-multi-agent": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image","pdf"]},- "x-ai/grok-4.3": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text","image","pdf"]},- "x-ai/grok-4.5": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"]},- "x-ai/grok-4.6": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image","pdf"]},- "x-ai/grok-build-0.1": {"reasoning":true,"input":["text","image","pdf"]},- "xiaomi/mimo-v2.5": {"reasoning":true,"toggle":true,"input":["text","image","audio","video"]},- "xiaomi/mimo-v2.5-pro": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-4.5": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-4.5-air": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-4.5v": {"reasoning":true,"toggle":true,"input":["text","image"]},- "z-ai/glm-4.6": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-4.6v": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "z-ai/glm-4.7": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-4.7-flash": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-5": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-5-turbo": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-5.1": {"reasoning":true,"toggle":true,"input":["text"]},- "z-ai/glm-5.2": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"]},- "z-ai/glm-5.3": {"reasoning":true,"efforts":["low","high","max"],"input":["text"]},- "z-ai/glm-5.3-flash": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image","video"]},- "z-ai/glm-5v-turbo": {"reasoning":true,"toggle":true,"input":["image","text","video"]},+ "~anthropic/claude-fable-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "~anthropic/claude-haiku-latest": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "~anthropic/claude-opus-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "~anthropic/claude-sonnet-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "~deepseek/deepseek-flash-latest": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1048576},+ "~deepseek/deepseek-pro-latest": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"],"context":1048576},+ "~deepseek/deepseek-v4-flash-latest": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"],"context":1310720},+ "~google/gemini-flash-latest": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","pdf","audio"],"context":1048576},+ "~google/gemini-pro-latest": {"reasoning":true,"efforts":["low","medium","high"],"input":["audio","pdf","image","text","video"],"context":1048576},+ "~moonshotai/kimi-latest": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image","video"],"context":1048576},+ "~openai/gpt-astra-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["pdf","image","text"],"context":1050000},+ "~openai/gpt-luna-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["pdf","image","text"],"context":1050000},+ "~openai/gpt-mini-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"],"context":400000},+ "~openai/gpt-sol-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["pdf","image","text"],"context":1050000},+ "~openai/gpt-terra-latest": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["pdf","image","text"],"context":1050000},+ "~x-ai/grok-latest": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image","pdf"],"context":500000},+ "~z-ai/glm-flash-latest": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image","video"],"context":1310720},+ "~z-ai/glm-latest": {"reasoning":true,"efforts":["low","high","max"],"input":["text"],"context":1310720},+ "aion-labs/aion-2.0": {"reasoning":true,"input":["text"],"context":131072},+ "aion-labs/aion-3.0": {"reasoning":true,"input":["text"],"context":131072},+ "aion-labs/aion-3.0-mini": {"reasoning":true,"input":["text"],"context":131072},+ "aion-labs/aion-rp-llama-3.1-8b": {"input":["text"],"context":32768},+ "amazon/nova-2-lite-v1": {"reasoning":true,"toggle":true,"input":["text","image","video","pdf"],"context":1000000},+ "amazon/nova-lite-v1": {"input":["text","image"],"context":300000},+ "amazon/nova-micro-v1": {"input":["text"],"context":128000},+ "amazon/nova-premier-v1": {"input":["text","image"],"context":1000000},+ "amazon/nova-pro-v1": {"input":["text","image"],"context":300000},+ "anthracite-org/magnum-v4-72b": {"input":["text"],"context":32768},+ "anthropic/claude-3-haiku": {"input":["text","image"],"context":200000},+ "anthropic/claude-fable-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-fable-5.1": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-haiku-4.5": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "anthropic/claude-opus-4": {"reasoning":true,"toggle":true,"input":["image","text","pdf"],"context":200000},+ "anthropic/claude-opus-4.1": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "anthropic/claude-opus-4.5": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "anthropic/claude-opus-4.6": {"reasoning":true,"efforts":["low","medium","high","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-opus-4.7": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-opus-4.8": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-opus-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-sonnet-4": {"reasoning":true,"toggle":true,"input":["image","text","pdf"],"context":1000000},+ "anthropic/claude-sonnet-4.5": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-sonnet-4.6": {"reasoning":true,"efforts":["low","medium","high","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "anthropic/claude-sonnet-5": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"toggle":true,"input":["text","image","pdf"],"context":1000000},+ "arcee-ai/trinity-large-thinking": {"reasoning":true,"input":["text"],"context":262144},+ "baidu/ernie-4.5-vl-424b-a47b": {"reasoning":true,"toggle":true,"input":["image","text"],"context":123000},+ "bytedance-seed/seed-1.6": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":262144},+ "bytedance-seed/seed-1.6-flash": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":262144},+ "bytedance-seed/seed-2-1-turbo": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "bytedance-seed/seed-2.0-code": {"reasoning":true,"efforts":["low","medium","high"],"toggle":true,"input":["text","image","video"],"context":262144},+ "bytedance-seed/seed-2.0-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video"],"context":262144},+ "bytedance-seed/seed-2.0-mini": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video"],"context":262144},+ "bytedance/ui-tars-1.5-7b": {"input":["image","text"],"context":128000},+ "cognitivecomputations/dolphin-mistral-24b-venice-edition": {"input":["text"],"context":128000},+ "cohere/command-a": {"input":["text"],"context":256000},+ "cohere/command-r-08-2024": {"input":["text"],"context":128000},+ "cohere/command-r-plus-08-2024": {"input":["text"],"context":128000},+ "cohere/command-r7b-12-2024": {"input":["text"],"context":128000},+ "cohere/north-mini-code:free": {"reasoning":true,"toggle":true,"input":["text"],"context":256000},+ "deepseek/deepseek-chat": {"input":["text"],"context":163840},+ "deepseek/deepseek-chat-v3-0324": {"input":["text"],"context":163840},+ "deepseek/deepseek-chat-v3.1": {"reasoning":true,"toggle":true,"input":["text"],"context":163840},+ "deepseek/deepseek-r1": {"reasoning":true,"input":["text"],"context":64000},+ "deepseek/deepseek-r1-0528": {"reasoning":true,"input":["text"],"context":163840},+ "deepseek/deepseek-r1-distill-llama-70b": {"reasoning":true,"toggle":true,"input":["text"],"context":8192},+ "deepseek/deepseek-v3.1-terminus": {"reasoning":true,"toggle":true,"input":["text"],"context":163840},+ "deepseek/deepseek-v3.2": {"reasoning":true,"toggle":true,"input":["text"],"context":163840},+ "deepseek/deepseek-v3.2-exp": {"reasoning":true,"toggle":true,"input":["text"],"context":163840},+ "deepseek/deepseek-v4-flash": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek/deepseek-v4-flash-0731": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"],"context":1310720},+ "deepseek/deepseek-v4-flash-vision-exp": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1048576},+ "deepseek/deepseek-v4-pro": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek/deepseek-v4-pro-0813": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek/deepseek-v4.1-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1048576},+ "dots-studio/dots-3-note-preview:free": {"reasoning":true,"toggle":true,"input":["text","image"],"context":512000},+ "google/gemini-2.5-flash": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"],"context":1048576},+ "google/gemini-2.5-flash-image": {"input":["text","image"],"context":32768},+ "google/gemini-2.5-flash-lite": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"],"context":1048576},+ "google/gemini-2.5-pro": {"reasoning":true,"input":["text","image","audio","video","pdf"],"context":1048576},+ "google/gemini-2.5-pro-preview": {"reasoning":true,"input":["pdf","image","text","audio"],"context":1048576},+ "google/gemini-3-flash-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3-pro-image": {"reasoning":true,"input":["text","image"],"context":131072},+ "google/gemini-3-pro-image-preview": {"reasoning":true,"input":["text","image"],"context":65536},+ "google/gemini-3.1-flash-image": {"reasoning":true,"efforts":["minimal","high"],"toggle":true,"input":["image","text"],"context":131072},+ "google/gemini-3.1-flash-image-preview": {"reasoning":true,"efforts":["minimal","high"],"toggle":true,"input":["image","text"],"context":65536},+ "google/gemini-3.1-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.1-flash-lite-image": {"reasoning":true,"efforts":["minimal","high"],"toggle":true,"input":["text","image"],"context":65536},+ "google/gemini-3.1-flash-lite-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"toggle":true,"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.1-pro-preview": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.1-pro-preview-customtools": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.5-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.5-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.6-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemini-3.8-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "google/gemma-2-27b-it": {"input":["text"],"context":8192},+ "google/gemma-3-12b-it": {"input":["text","image"],"context":131072},+ "google/gemma-3-27b-it": {"input":["text","image"],"context":131072},+ "google/gemma-3-4b-it": {"input":["text","image"],"context":131072},+ "google/gemma-4-26b-a4b-it": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":262144},+ "google/gemma-4-26b-a4b-it:free": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":262144},+ "google/gemma-4-31b-it": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":262144},+ "google/gemma-4-31b-it:free": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":262144},+ "google/lyria-3-clip-preview": {"input":["text","image"],"context":1048576},+ "google/lyria-3-pro-preview": {"input":["text","image"],"context":1048576},+ "gryphe/mythomax-l2-13b": {"input":["text"],"context":8192},+ "ibm-granite/granite-4.0-h-micro": {"input":["text"],"context":131000},+ "ibm-granite/granite-4.2-8b": {"reasoning":true,"efforts":["none","low","high"],"input":["text"],"context":131072},+ "inception/mercury-2": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text"],"context":128000},+ "inception/mercury-2.5": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text"],"context":260000},+ "inclusionai/ling-3.0-flash": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "inclusionai/ling-3.0-flash-fin": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "inclusionai/ling-3.0-flash-fin:free": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "inclusionai/ling-3.0-flash-sante:free": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "inclusionai/ling-3.0-flash-vl": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":131072},+ "inclusionai/ling-3.0-flash-vl:free": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "inference-net/schematron-v2-small": {"input":["text"],"context":128000},+ "inference-net/schematron-v2-turbo": {"input":["text"],"context":128000},+ "kwaipilot/kat-coder-pro-v2": {"input":["text"],"context":262144},+ "kwaipilot/kat-coder-pro-v2.5": {"input":["text"],"context":262144},+ "liquid/lfm-2.5-2.6b:free": {"reasoning":true,"input":["text"],"context":65536},+ "mancer/weaver": {"input":["text"],"context":8000},+ "meituan/longcat-2.0": {"reasoning":true,"toggle":true,"input":["text"],"context":1048756},+ "meta-llama/llama-3.1-70b-instruct": {"input":["text"],"context":131072},+ "meta-llama/llama-3.1-8b-instruct": {"input":["text"],"context":131072},+ "meta-llama/llama-3.2-1b-instruct": {"input":["text"],"context":60000},+ "meta-llama/llama-3.2-3b-instruct": {"input":["text"],"context":131072},+ "meta-llama/llama-3.3-70b-instruct": {"input":["text"],"context":131072},+ "meta-llama/llama-4-maverick": {"input":["text","image"],"context":1048576},+ "meta-llama/llama-4-scout": {"input":["text","image"],"context":1310720},+ "meta-llama/llama-guard-4-12b": {"input":["image","text"],"context":163840},+ "meta/muse-glimmer-30b": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image"],"context":131072},+ "meta/muse-spark-1.1": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video","pdf","audio"],"context":1048576},+ "meta/muse-spark-1.2": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video","pdf","audio"],"context":1048576},+ "meta/muse-spark-1.2-contributor": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video","pdf","audio"],"context":1048576},+ "meta/muse-spark-1.3": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh","max"],"input":["text","image","video","pdf","audio"],"context":1048576},+ "meta/muse-spark-1.3-contributor": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh","max"],"input":["text","image","video","pdf","audio"],"context":1048576},+ "microsoft/phi-4": {"input":["text"],"context":16384},+ "microsoft/wizardlm-2-8x22b": {"input":["text"],"context":65535},+ "minimax/minimax-01": {"input":["text","image"],"context":1000192},+ "minimax/minimax-m1": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "minimax/minimax-m2": {"reasoning":true,"input":["text"],"context":204800},+ "minimax/minimax-m2-her": {"input":["text"],"context":65536},+ "minimax/minimax-m2.1": {"reasoning":true,"input":["text"],"context":204800},+ "minimax/minimax-m2.5": {"reasoning":true,"input":["text"],"context":204800},+ "minimax/minimax-m2.7": {"reasoning":true,"input":["text"],"context":204800},+ "minimax/minimax-m3": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1048576},+ "mistralai/codestral-2508": {"input":["text","pdf"],"context":256000},+ "mistralai/devstral-2512": {"input":["text","pdf"],"context":262144},+ "mistralai/ministral-14b-2512": {"input":["text","image"],"context":262144},+ "mistralai/ministral-3b-2512": {"input":["text","image"],"context":131072},+ "mistralai/ministral-8b-2512": {"input":["text","image"],"context":262144},+ "mistralai/mistral-large": {"input":["text","pdf"],"context":128000},+ "mistralai/mistral-large-2407": {"input":["text","pdf"],"context":131072},+ "mistralai/mistral-large-2512": {"input":["text","image","pdf"],"context":262144},+ "mistralai/mistral-medium-3": {"input":["text","image","pdf"],"context":131072},+ "mistralai/mistral-medium-3-5": {"reasoning":true,"efforts":["none","high"],"input":["text","image","pdf"],"context":262144},+ "mistralai/mistral-medium-3.1": {"input":["text","image","pdf"],"context":131072},+ "mistralai/mistral-nemo": {"input":["text"],"context":131072},+ "mistralai/mistral-saba": {"input":["text","pdf"],"context":32768},+ "mistralai/mistral-small-24b-instruct-2501": {"input":["text"],"context":32768},+ "mistralai/mistral-small-2603": {"reasoning":true,"efforts":["none","high"],"input":["text","image"],"context":262144},+ "mistralai/mistral-small-3.1-24b-instruct": {"input":["text","image"],"context":128000},+ "mistralai/mistral-small-3.2-24b-instruct": {"input":["image","text"],"context":256000},+ "mistralai/mixtral-8x22b-instruct": {"input":["text","pdf"],"context":65536},+ "mistralai/voxtral-small-24b-2507": {"input":["text","audio","pdf"],"context":32768},+ "moonshotai/kimi-k2": {"input":["text"],"context":131072},+ "moonshotai/kimi-k2-0905": {"input":["text"],"context":262144},+ "moonshotai/kimi-k2-thinking": {"reasoning":true,"input":["text"],"context":262144},+ "moonshotai/kimi-k2.5": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "moonshotai/kimi-k2.6": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "moonshotai/kimi-k2.7-code": {"reasoning":true,"input":["text","image"],"context":262144},+ "moonshotai/kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image","video"],"context":1048576},+ "morph/morph-v3-fast": {"input":["text"],"context":81920},+ "morph/morph-v3-large": {"input":["text"],"context":262144},+ "nex-agi/nex-n2.5-mini:free": {"reasoning":true,"efforts":["none","medium","high"],"input":["text","image"],"context":262144},+ "nex-agi/nex-n2.5-pro:free": {"reasoning":true,"efforts":["none","medium","high"],"input":["text","image"],"context":262144},+ "nousresearch/hermes-3-llama-3.1-405b": {"input":["text"],"context":131072},+ "nousresearch/hermes-3-llama-3.1-70b": {"input":["text"],"context":131072},+ "nousresearch/hermes-4-405b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "nvidia/nemotron-3-nano-30b-a3b": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":256000},+ "nvidia/nemotron-3-super-120b-a12b": {"reasoning":true,"efforts":["low","medium"],"toggle":true,"input":["text"],"context":262144},+ "nvidia/nemotron-3-super-120b-a12b:free": {"reasoning":true,"efforts":["low","medium"],"toggle":true,"input":["text"],"context":262144},+ "nvidia/nemotron-3-ultra-550b-a55b": {"reasoning":true,"efforts":["medium","high"],"toggle":true,"input":["text"],"context":262144},+ "nvidia/nemotron-3-ultra-550b-a55b:free": {"reasoning":true,"efforts":["medium","high"],"toggle":true,"input":["text"],"context":1000000},+ "nvidia/nemotron-3.5-content-safety": {"reasoning":true,"toggle":true,"input":["text","image"],"context":131072},+ "nvidia/nemotron-3.5-content-safety:free": {"reasoning":true,"toggle":true,"input":["text","image"],"context":128000},+ "nvidia/nemotron-3.5-lightning": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "nvidia/nemotron-3.5-lightning:free": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "openai/gpt-3.5-turbo": {"input":["text"],"context":16385},+ "openai/gpt-3.5-turbo-0613": {"input":["text"],"context":4095},+ "openai/gpt-3.5-turbo-16k": {"input":["text"],"context":16385},+ "openai/gpt-3.5-turbo-instruct": {"input":["text"],"context":4095},+ "openai/gpt-4": {"input":["text"],"context":8191},+ "openai/gpt-4-turbo": {"input":["text","image"],"context":128000},+ "openai/gpt-4.1": {"input":["text","image","pdf"],"context":1047576},+ "openai/gpt-4.1-mini": {"input":["text","image","pdf"],"context":1047576},+ "openai/gpt-4.1-nano": {"input":["image","text","pdf"],"context":1047576},+ "openai/gpt-4o": {"input":["text","image","pdf"],"context":128000},+ "openai/gpt-4o-2024-05-13": {"input":["text","image","pdf"],"context":128000},+ "openai/gpt-4o-2024-08-06": {"input":["text","image","pdf"],"context":128000},+ "openai/gpt-4o-2024-11-20": {"input":["text","image","pdf"],"context":128000},+ "openai/gpt-4o-mini": {"input":["text","image","pdf"],"context":128000},+ "openai/gpt-4o-mini-2024-07-18": {"input":["text","image","pdf"],"context":128000},+ "openai/gpt-5": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","pdf"],"context":400000},+ "openai/gpt-5-image": {"reasoning":true,"input":["image","text","pdf"],"context":400000},+ "openai/gpt-5-image-mini": {"reasoning":true,"input":["pdf","image","text"],"context":400000},+ "openai/gpt-5-mini": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","pdf"],"context":400000},+ "openai/gpt-5-nano": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","pdf"],"context":400000},+ "openai/gpt-5-pro": {"reasoning":true,"efforts":["high"],"input":["image","text","pdf"],"context":400000},+ "openai/gpt-5.1": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["image","text","pdf"],"context":400000},+ "openai/gpt-5.1-codex": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"],"context":400000},+ "openai/gpt-5.1-codex-max": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image"],"context":400000},+ "openai/gpt-5.1-codex-mini": {"reasoning":true,"efforts":["low","medium","high"],"toggle":true,"input":["text","image"],"context":400000},+ "openai/gpt-5.2": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"],"context":400000},+ "openai/gpt-5.2-chat": {"input":["pdf","image","text"],"context":128000},+ "openai/gpt-5.2-codex": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image"],"context":400000},+ "openai/gpt-5.2-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["image","text","pdf"],"context":400000},+ "openai/gpt-5.3-codex": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":400000},+ "openai/gpt-5.4": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.4-image-2": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["image","text","pdf"],"context":272000},+ "openai/gpt-5.4-mini": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"],"context":400000},+ "openai/gpt-5.4-nano": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["pdf","image","text"],"context":400000},+ "openai/gpt-5.4-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.5": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.5-pro": {"reasoning":true,"efforts":["medium","high","xhigh"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.6-luna": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.6-luna-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.6-sol": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.6-sol-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.6-terra": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-5.6-terra-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-6-astra": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["text","image","pdf"],"context":1050000},+ "openai/gpt-6-astra-pro": {"reasoning":true,"efforts":["low","medium","high","xhigh","max"],"input":["pdf","image","text"],"context":1050000},+ "openai/gpt-audio": {"input":["text","audio"],"context":128000},+ "openai/gpt-audio-mini": {"input":["text","audio"],"context":128000},+ "openai/gpt-chat-latest": {"input":["text","image","pdf"],"context":400000},+ "openai/gpt-oss-120b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "openai/gpt-oss-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "openai/gpt-oss-safeguard-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "openai/o1": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "openai/o1-pro": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "openai/o3": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":200000},+ "openai/o3-mini": {"reasoning":true,"toggle":true,"input":["text","pdf"],"context":200000},+ "openai/o3-mini-high": {"reasoning":true,"efforts":["high"],"input":["text","pdf"],"context":200000},+ "openai/o3-pro": {"reasoning":true,"toggle":true,"input":["text","pdf","image"],"context":200000},+ "openai/o4-mini": {"reasoning":true,"toggle":true,"input":["image","text","pdf"],"context":200000},+ "openai/o4-mini-high": {"reasoning":true,"efforts":["high"],"input":["image","text","pdf"],"context":200000},+ "openrouter/auto": {"reasoning":true,"input":["text","image","audio","pdf","video"],"context":2000000},+ "openrouter/bodybuilder": {"input":["text"],"context":128000},+ "openrouter/free": {"reasoning":true,"input":["text","image"],"context":200000},+ "openrouter/fusion": {"input":["text"],"context":1000000},+ "openrouter/pareto-code": {"input":["text"],"context":2000000},+ "perceptron/perceptron-mk1": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":32768},+ "perplexity/sonar": {"input":["text","image"],"context":127072},+ "perplexity/sonar-deep-research": {"reasoning":true,"toggle":true,"input":["text"],"context":128000},+ "perplexity/sonar-pro": {"input":["text","image"],"context":200000},+ "perplexity/sonar-pro-search": {"reasoning":true,"input":["text","image"],"context":200000},+ "perplexity/sonar-reasoning-pro": {"reasoning":true,"toggle":true,"input":["text","image"],"context":128000},+ "poolside/laguna-s-2.1": {"reasoning":true,"toggle":true,"input":["text"],"context":1048576},+ "poolside/laguna-s-2.1:free": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "poolside/laguna-xs-2.1": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "poolside/laguna-xs-2.1:free": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "qwen/qwen-2.5-72b-instruct": {"input":["text"],"context":32768},+ "qwen/qwen-2.5-7b-instruct": {"input":["text"],"context":32768},+ "qwen/qwen-2.5-coder-32b-instruct": {"input":["text"],"context":32768},+ "qwen/qwen-plus": {"input":["text"],"context":1000000},+ "qwen/qwen-plus-2025-07-28": {"input":["text"],"context":1000000},+ "qwen/qwen2.5-vl-72b-instruct": {"input":["text","image"],"context":128000},+ "qwen/qwen3-14b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen/qwen3-235b-a22b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen/qwen3-235b-a22b-2507": {"input":["text"],"context":262144},+ "qwen/qwen3-235b-a22b-thinking-2507": {"reasoning":true,"input":["text"],"context":131072},+ "qwen/qwen3-30b-a3b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen/qwen3-30b-a3b-instruct-2507": {"input":["text"],"context":262144},+ "qwen/qwen3-30b-a3b-thinking-2507": {"reasoning":true,"input":["text"],"context":81920},+ "qwen/qwen3-32b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen/qwen3-8b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen/qwen3-coder": {"input":["text"],"context":262144},+ "qwen/qwen3-coder-30b-a3b-instruct": {"input":["text"],"context":262144},+ "qwen/qwen3-coder-flash": {"input":["text"],"context":1000000},+ "qwen/qwen3-coder-next": {"input":["text"],"context":262144},+ "qwen/qwen3-coder-plus": {"input":["text"],"context":1000000},+ "qwen/qwen3-max": {"input":["text"],"context":262144},+ "qwen/qwen3-max-thinking": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "qwen/qwen3-next-80b-a3b-instruct": {"input":["text"],"context":262144},+ "qwen/qwen3-next-80b-a3b-thinking": {"reasoning":true,"input":["text"],"context":262144},+ "qwen/qwen3-vl-235b-a22b-instruct": {"input":["text","image"],"context":262144},+ "qwen/qwen3-vl-235b-a22b-thinking": {"reasoning":true,"input":["text","image"],"context":131072},+ "qwen/qwen3-vl-30b-a3b-instruct": {"input":["text","image"],"context":262144},+ "qwen/qwen3-vl-30b-a3b-thinking": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3-vl-32b-instruct": {"input":["text","image"],"context":131072},+ "qwen/qwen3-vl-8b-instruct": {"input":["image","text"],"context":262144},+ "qwen/qwen3-vl-8b-thinking": {"reasoning":true,"input":["image","text"],"context":131072},+ "qwen/qwen3.5-122b-a10b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.5-27b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.5-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.5-397b-a17b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.5-9b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.5-flash-02-23": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.5-plus-02-15": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.5-plus-20260420": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.6-27b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.6-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "qwen/qwen3.6-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.6-max-preview": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "qwen/qwen3.6-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.7-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.7-max": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "qwen/qwen3.7-plus": {"reasoning":true,"toggle":true,"input":["text","image"],"context":1000000},+ "qwen/qwen3.8-2.4t-a95b": {"reasoning":true,"efforts":["low","medium","xhigh"],"input":["text"],"context":1048576},+ "qwen/qwen3.8-27b": {"reasoning":true,"efforts":["low","medium","xhigh"],"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.8-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen/qwen3.8-max-0902": {"reasoning":true,"efforts":["minimal","low","medium","high","xhigh"],"input":["text","image","video"],"context":1000000},+ "rekaai/reka-edge": {"input":["image","text","video"],"context":16384},+ "rekaai/reka-flash-3": {"reasoning":true,"input":["text"],"context":65536},+ "relace/relace-apply-3": {"input":["text"],"context":256000},+ "relace/relace-search": {"input":["text"],"context":256000},+ "sakana/fugu-max": {"reasoning":true,"efforts":["high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "sakana/fugu-ultra": {"reasoning":true,"efforts":["high","xhigh","max"],"input":["text","image"],"context":1000000},+ "sakana/fugu-ultra-v2": {"reasoning":true,"efforts":["high","xhigh","max"],"input":["text","image","pdf"],"context":1000000},+ "sakana/sakana-namazu": {"reasoning":true,"efforts":["none","high"],"input":["text","image","pdf"],"context":262144},+ "sao10k/l3-lunaris-8b": {"input":["text"],"context":8192},+ "sao10k/l3.1-euryale-70b": {"input":["text"],"context":131072},+ "sao10k/l3.3-euryale-70b": {"input":["text"],"context":131072},+ "stealth/union-alpha": {"input":["text","image"],"context":262144},+ "stepfun/step-3.5-flash": {"reasoning":true,"input":["text"],"context":262144},+ "stepfun/step-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video"],"context":262144},+ "tencent/hunyuan-a13b-instruct": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "tencent/hy-mt2-1.8b": {"input":["text"],"context":8192},+ "tencent/hy-mt2-30b-a3b": {"input":["text"],"context":8192},+ "tencent/hy-mt2-7b": {"input":["text"],"context":8192},+ "tencent/hy3": {"reasoning":true,"efforts":["none","low","high"],"input":["text"],"context":262144},+ "tencent/hy3-preview": {"reasoning":true,"efforts":["none","low","high"],"input":["text"],"context":262144},+ "tencent/hy4-preview": {"reasoning":true,"efforts":["none","low","high"],"input":["text"],"context":1048576},+ "thedrummer/cydonia-24b-v4.1": {"input":["text"],"context":131072},+ "thedrummer/skyfall-36b-v2": {"input":["text"],"context":32768},+ "thedrummer/unslopnemo-12b": {"input":["text"],"context":1024000},+ "thinkingmachines/inkling": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"],"context":1048576},+ "thinkingmachines/inkling-small": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"],"context":1048576},+ "thinkingmachines/inkling-small:free": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"],"context":1048576},+ "thinkingmachines/inkling:free": {"reasoning":true,"efforts":["none","minimal","low","medium","high","max"],"input":["text","image","audio"],"context":1048576},+ "undi95/remm-slerp-l2-13b": {"input":["text"],"context":6144},+ "upstage/solar-pro-3": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "upstage/solar-pro4": {"reasoning":true,"toggle":true,"input":["text"],"context":524288},+ "writer/palmyra-x5": {"input":["text"],"context":1040000},+ "x-ai/grok-4.20": {"reasoning":true,"toggle":true,"input":["text","image","pdf"],"context":2000000},+ "x-ai/grok-4.20-multi-agent": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image","pdf"],"context":2000000},+ "x-ai/grok-4.3": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text","image","pdf"],"context":1000000},+ "x-ai/grok-4.5": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","pdf"],"context":500000},+ "x-ai/grok-4.6": {"reasoning":true,"efforts":["low","medium","high","xhigh"],"input":["text","image","pdf"],"context":500000},+ "x-ai/grok-build-0.1": {"reasoning":true,"input":["text","image","pdf"],"context":256000},+ "xiaomi/mimo-v2.5": {"reasoning":true,"toggle":true,"input":["text","image","audio","video"],"context":1050000},+ "xiaomi/mimo-v2.5-pro": {"reasoning":true,"toggle":true,"input":["text"],"context":1050000},+ "z-ai/glm-4.5": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "z-ai/glm-4.5-air": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "z-ai/glm-4.5v": {"reasoning":true,"toggle":true,"input":["text","image"],"context":65536},+ "z-ai/glm-4.6": {"reasoning":true,"toggle":true,"input":["text"],"context":204800},+ "z-ai/glm-4.6v": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":131072},+ "z-ai/glm-4.7": {"reasoning":true,"toggle":true,"input":["text"],"context":204800},+ "z-ai/glm-4.7-flash": {"reasoning":true,"toggle":true,"input":["text"],"context":200000},+ "z-ai/glm-5": {"reasoning":true,"toggle":true,"input":["text"],"context":204800},+ "z-ai/glm-5-turbo": {"reasoning":true,"toggle":true,"input":["text"],"context":202752},+ "z-ai/glm-5.1": {"reasoning":true,"toggle":true,"input":["text"],"context":204800},+ "z-ai/glm-5.2": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"],"context":1048576},+ "z-ai/glm-5.2:free": {"reasoning":true,"efforts":["high","xhigh"],"toggle":true,"input":["text"],"context":32768},+ "z-ai/glm-5.3": {"reasoning":true,"efforts":["low","high","max"],"input":["text"],"context":1310720},+ "z-ai/glm-5.3-flash": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image","video"],"context":1310720},+ "z-ai/glm-5v-turbo": {"reasoning":true,"toggle":true,"input":["image","text","video"],"context":202752},},"gemini": {- "deep-research-max-preview-04-2026": {"reasoning":true,"input":["text","image","video","audio","pdf"]},- "deep-research-preview-04-2026": {"reasoning":true,"input":["text","image","video","audio","pdf"]},- "gemini-2.5-computer-use-preview-10-2025": {"reasoning":true,"input":["text","image"]},- "gemini-2.5-flash": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"]},- "gemini-2.5-flash-image": {"reasoning":true,"input":["text","image"]},- "gemini-2.5-flash-lite": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"]},- "gemini-2.5-flash-preview-tts": {"input":["text"]},- "gemini-2.5-pro": {"reasoning":true,"input":["text","image","audio","video","pdf"]},- "gemini-2.5-pro-preview-tts": {"input":["text"]},- "gemini-3-flash-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3-pro-image": {"reasoning":true,"efforts":["low","high"],"input":["text","image"]},- "gemini-3-pro-image-preview": {"reasoning":true,"input":["text","image"]},- "gemini-3.1-flash-image": {"reasoning":true,"efforts":["minimal","high"],"input":["text","image","video","pdf"]},- "gemini-3.1-flash-image-preview": {"reasoning":true,"efforts":["minimal","high"],"input":["text","image","pdf"]},- "gemini-3.1-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.1-flash-lite-image": {"reasoning":true,"efforts":["minimal","high"],"input":["text","image"]},- "gemini-3.1-flash-lite-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.1-flash-live-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio"]},- "gemini-3.1-flash-tts-preview": {"reasoning":true,"input":["text"]},- "gemini-3.1-pro-preview": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.1-pro-preview-customtools": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.5-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.5-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.5-live-translate-preview": {"input":["audio"]},- "gemini-3.6-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-3.8-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-embedding-001": {"input":["text"]},- "gemini-embedding-2": {"input":["text","image","audio","video","pdf"]},- "gemini-flash-latest": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-flash-lite-latest": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"]},- "gemini-omni-flash-preview": {"reasoning":true,"input":["text","image","video"]},- "gemma-4-26b-a4b-it": {"reasoning":true,"toggle":true,"input":["text","image"]},- "gemma-4-31b-it": {"reasoning":true,"toggle":true,"input":["text","image"]},- "lyria-3-clip-preview": {"input":["text","image"]},- "lyria-3-pro-preview": {"input":["text","image"]},- "veo-3.1-fast-generate-preview": {"input":["text","image","video"]},- "veo-3.1-generate-preview": {"input":["text","image"]},- "veo-3.1-lite-generate-preview": {"input":["text","image"]},+ "deep-research-max-preview-04-2026": {"reasoning":true,"input":["text","image","video","audio","pdf"],"context":131072},+ "deep-research-preview-04-2026": {"reasoning":true,"input":["text","image","video","audio","pdf"],"context":131072},+ "gemini-2.5-computer-use-preview-10-2025": {"reasoning":true,"input":["text","image"],"context":131072},+ "gemini-2.5-flash": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"],"context":1048576},+ "gemini-2.5-flash-image": {"reasoning":true,"input":["text","image"],"context":32768},+ "gemini-2.5-flash-lite": {"reasoning":true,"toggle":true,"input":["text","image","audio","video","pdf"],"context":1048576},+ "gemini-2.5-flash-preview-tts": {"input":["text"],"context":8192},+ "gemini-2.5-pro": {"reasoning":true,"input":["text","image","audio","video","pdf"],"context":1048576},+ "gemini-2.5-pro-preview-tts": {"input":["text"],"context":8192},+ "gemini-3-flash-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3-pro-image": {"reasoning":true,"efforts":["low","high"],"input":["text","image"],"context":131072},+ "gemini-3-pro-image-preview": {"reasoning":true,"input":["text","image"],"context":131072},+ "gemini-3.1-flash-image": {"reasoning":true,"efforts":["minimal","high"],"input":["text","image","video","pdf"],"context":65536},+ "gemini-3.1-flash-image-preview": {"reasoning":true,"efforts":["minimal","high"],"input":["text","image","pdf"],"context":65536},+ "gemini-3.1-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.1-flash-lite-image": {"reasoning":true,"efforts":["minimal","high"],"input":["text","image"],"context":65536},+ "gemini-3.1-flash-lite-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.1-flash-live-preview": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio"],"context":131072},+ "gemini-3.1-flash-tts-preview": {"reasoning":true,"input":["text"],"context":8192},+ "gemini-3.1-pro-preview": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.1-pro-preview-customtools": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.5-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.5-flash-lite": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.5-live-translate-preview": {"input":["audio"],"context":16384},+ "gemini-3.6-flash": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-3.8-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-embedding-001": {"input":["text"],"context":2048},+ "gemini-embedding-2": {"input":["text","image","audio","video","pdf"],"context":8192},+ "gemini-flash-latest": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-flash-lite-latest": {"reasoning":true,"efforts":["minimal","low","medium","high"],"input":["text","image","video","audio","pdf"],"context":1048576},+ "gemini-omni-flash-preview": {"reasoning":true,"input":["text","image","video"],"context":131072},+ "gemma-4-26b-a4b-it": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "gemma-4-31b-it": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "lyria-3-clip-preview": {"input":["text","image"],"context":1048576},+ "lyria-3-pro-preview": {"input":["text","image"],"context":1048576},+ "veo-3.1-fast-generate-preview": {"input":["text","image","video"],"context":480},+ "veo-3.1-generate-preview": {"input":["text","image"],"context":480},+ "veo-3.1-lite-generate-preview": {"input":["text","image"],"context":480},},"mistral": {- "codestral-latest": {"input":["text"]},- "devstral-2512": {"input":["text"]},- "devstral-latest": {"input":["text"]},- "devstral-medium-2507": {"input":["text"]},- "devstral-medium-latest": {"input":["text"]},- "devstral-small-2505": {"input":["text"]},- "devstral-small-2507": {"input":["text"]},- "labs-devstral-small-2512": {"input":["text","image"]},- "magistral-medium-latest": {"reasoning":true,"input":["text"]},- "magistral-small": {"reasoning":true,"input":["text"]},- "ministral-3b-latest": {"input":["text"]},- "ministral-8b-latest": {"input":["text"]},- "mistral-embed": {"input":["text"]},- "mistral-large-2411": {"input":["text"]},- "mistral-large-2512": {"input":["text","image"]},- "mistral-large-latest": {"input":["text","image"]},- "mistral-medium-2505": {"input":["text","image"]},- "mistral-medium-2508": {"input":["text","image"]},- "mistral-medium-2604": {"reasoning":true,"efforts":["none","high"],"input":["text","image"]},- "mistral-medium-latest": {"reasoning":true,"efforts":["none","high"],"input":["text","image"]},- "mistral-nemo": {"input":["text"]},- "mistral-small-2506": {"input":["text","image"]},- "mistral-small-2603": {"reasoning":true,"efforts":["none","high"],"input":["text","image"]},- "mistral-small-latest": {"reasoning":true,"efforts":["none","high"],"input":["text","image"]},- "open-mistral-7b": {"input":["text"]},- "open-mistral-nemo": {"input":["text"]},- "open-mixtral-8x22b": {"input":["text"]},- "open-mixtral-8x7b": {"input":["text"]},- "pixtral-12b": {"input":["text","image"]},- "pixtral-large-latest": {"input":["text","image"]},+ "codestral-latest": {"input":["text"],"context":256000},+ "devstral-2512": {"input":["text"],"context":262144},+ "devstral-latest": {"input":["text"],"context":262144},+ "devstral-medium-2507": {"input":["text"],"context":128000},+ "devstral-medium-latest": {"input":["text"],"context":262144},+ "devstral-small-2505": {"input":["text"],"context":128000},+ "devstral-small-2507": {"input":["text"],"context":128000},+ "labs-devstral-small-2512": {"input":["text","image"],"context":256000},+ "magistral-medium-latest": {"reasoning":true,"input":["text"],"context":128000},+ "magistral-small": {"reasoning":true,"input":["text"],"context":128000},+ "ministral-3b-latest": {"input":["text"],"context":128000},+ "ministral-8b-latest": {"input":["text"],"context":128000},+ "mistral-embed": {"input":["text"],"context":8000},+ "mistral-large-2411": {"input":["text"],"context":131072},+ "mistral-large-2512": {"input":["text","image"],"context":262144},+ "mistral-large-latest": {"input":["text","image"],"context":262144},+ "mistral-medium-2505": {"input":["text","image"],"context":131072},+ "mistral-medium-2508": {"input":["text","image"],"context":262144},+ "mistral-medium-2604": {"reasoning":true,"efforts":["none","high"],"input":["text","image"],"context":262144},+ "mistral-medium-latest": {"reasoning":true,"efforts":["none","high"],"input":["text","image"],"context":262144},+ "mistral-nemo": {"input":["text"],"context":128000},+ "mistral-small-2506": {"input":["text","image"],"context":128000},+ "mistral-small-2603": {"reasoning":true,"efforts":["none","high"],"input":["text","image"],"context":256000},+ "mistral-small-latest": {"reasoning":true,"efforts":["none","high"],"input":["text","image"],"context":256000},+ "open-mistral-7b": {"input":["text"],"context":8000},+ "open-mistral-nemo": {"input":["text"],"context":128000},+ "open-mixtral-8x22b": {"input":["text"],"context":64000},+ "open-mixtral-8x7b": {"input":["text"],"context":32000},+ "pixtral-12b": {"input":["text","image"],"context":128000},+ "pixtral-large-latest": {"input":["text","image"],"context":128000},"voxtral-mini-latest": {"input":["audio"]},"voxtral-mini-tts-latest": {"input":["text"]},- "voxtral-small-latest": {"input":["text","audio"]},- "zai-glm-5-2": {"reasoning":true,"efforts":["high","max"],"input":["text"]},+ "voxtral-small-latest": {"input":["text","audio"],"context":32000},+ "zai-glm-5-2": {"reasoning":true,"efforts":["high","max"],"input":["text"],"context":1000000},},"deepseek": {- "deepseek-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "deepseek-v4-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "deepseek-v4-flash-vision-exp": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "deepseek-v4-pro": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"]},+ "deepseek-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1000000},+ "deepseek-v4-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1000000},+ "deepseek-v4-flash-vision-exp": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1000000},+ "deepseek-v4-pro": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"],"context":1000000},},"kimi": {- "kimi-k2.6": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "kimi-k2.7-code": {"reasoning":true,"input":["text","image","video"]},- "kimi-k2.7-code-highspeed": {"reasoning":true,"input":["text","image","video"]},- "kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image","video"]},+ "kimi-k2.6": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":262144},+ "kimi-k2.7-code": {"reasoning":true,"input":["text","image","video"],"context":262144},+ "kimi-k2.7-code-highspeed": {"reasoning":true,"input":["text","image","video"],"context":262144},+ "kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image","video"],"context":1048576},},"cohere": {- "c4ai-aya-expanse-32b": {"input":["text"]},- "c4ai-aya-expanse-8b": {"input":["text"]},- "c4ai-aya-vision-32b": {"input":["text","image"]},- "c4ai-aya-vision-8b": {"input":["text","image"]},- "command-a-03-2025": {"input":["text"]},- "command-a-plus-05-2026": {"reasoning":true,"toggle":true,"input":["text","image"]},- "command-a-reasoning-08-2025": {"reasoning":true,"toggle":true,"input":["text"]},- "command-a-translate-08-2025": {"input":["text"]},- "command-a-vision-07-2025": {"input":["text","image"]},- "command-r-08-2024": {"input":["text"]},- "command-r-plus-08-2024": {"input":["text"]},- "command-r7b-12-2024": {"input":["text"]},- "command-r7b-arabic-02-2025": {"input":["text"]},- "north-mini-code-1-0": {"reasoning":true,"efforts":["none","high"],"input":["text"]},+ "c4ai-aya-expanse-32b": {"input":["text"],"context":128000},+ "c4ai-aya-expanse-8b": {"input":["text"],"context":8000},+ "c4ai-aya-vision-32b": {"input":["text","image"],"context":16000},+ "c4ai-aya-vision-8b": {"input":["text","image"],"context":16000},+ "command-a-03-2025": {"input":["text"],"context":256000},+ "command-a-plus-05-2026": {"reasoning":true,"toggle":true,"input":["text","image"],"context":128000},+ "command-a-reasoning-08-2025": {"reasoning":true,"toggle":true,"input":["text"],"context":256000},+ "command-a-translate-08-2025": {"input":["text"],"context":8000},+ "command-a-vision-07-2025": {"input":["text","image"],"context":128000},+ "command-r-08-2024": {"input":["text"],"context":128000},+ "command-r-plus-08-2024": {"input":["text"],"context":128000},+ "command-r7b-12-2024": {"input":["text"],"context":128000},+ "command-r7b-arabic-02-2025": {"input":["text"],"context":128000},+ "north-mini-code-1-0": {"reasoning":true,"efforts":["none","high"],"input":["text"],"context":256000},},"huggingface": {- "deepseek-ai/deepseek-r1": {"reasoning":true,"input":["text"]},- "deepseek-ai/deepseek-r1-0528": {"reasoning":true,"input":["text"]},- "deepseek-ai/deepseek-v3": {"input":["text"]},- "deepseek-ai/deepseek-v3-0324": {"input":["text"]},- "deepseek-ai/deepseek-v3.1": {"reasoning":true,"input":["text"]},- "deepseek-ai/deepseek-v3.2": {"reasoning":true,"input":["text"]},- "deepseek-ai/deepseek-v4-flash": {"reasoning":true,"input":["text"]},- "deepseek-ai/deepseek-v4-flash-0731": {"reasoning":true,"efforts":["high","max"],"input":["text"]},- "deepseek-ai/deepseek-v4-flash-vision-exp": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"]},- "deepseek-ai/deepseek-v4-pro": {"reasoning":true,"efforts":["high"],"input":["text"]},- "deepseek-ai/deepseek-v4-pro-0813": {"reasoning":true,"efforts":["low","high","max"],"input":["text"]},- "deepseek-ai/deepseek-v4.1-flash": {"reasoning":true,"efforts":["none","low","high","xhigh","max"],"input":["text","image"]},- "google/gemma-3-12b-it": {"input":["text","image"]},- "google/gemma-3-27b-it": {"input":["text","image"]},- "google/gemma-3-4b-it": {"input":["text","image"]},- "google/gemma-4-26b-a4b-it": {"reasoning":true,"input":["text","image"]},- "google/gemma-4-31b-it": {"reasoning":true,"input":["text","image"]},- "meta-llama/llama-3.1-8b-instruct": {"input":["text"]},- "meta-llama/llama-3.3-70b-instruct": {"input":["text"]},- "minimaxai/minimax-m2": {"reasoning":true,"input":["text"]},- "minimaxai/minimax-m2.1": {"reasoning":true,"input":["text"]},- "minimaxai/minimax-m2.5": {"reasoning":true,"input":["text"]},- "minimaxai/minimax-m2.7": {"reasoning":true,"input":["text"]},- "minimaxai/minimax-m3": {"reasoning":true,"input":["text","image"]},- "moonshotai/kimi-k2-instruct": {"input":["text"]},- "moonshotai/kimi-k2-instruct-0905": {"input":["text"]},- "moonshotai/kimi-k2-thinking": {"reasoning":true,"input":["text"]},- "moonshotai/kimi-k2.5": {"reasoning":true,"input":["text","image","video"]},- "moonshotai/kimi-k2.6": {"reasoning":true,"input":["text","image","video"]},- "moonshotai/kimi-k2.7-code": {"reasoning":true,"input":["text","image"]},- "moonshotai/kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"]},- "openai/gpt-oss-120b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "openai/gpt-oss-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "qwen/qwen2.5-coder-32b-instruct": {"input":["text"]},- "qwen/qwen3-235b-a22b": {"reasoning":true,"input":["text"]},- "qwen/qwen3-235b-a22b-instruct-2507": {"input":["text"]},- "qwen/qwen3-235b-a22b-thinking-2507": {"reasoning":true,"input":["text"]},- "qwen/qwen3-30b-a3b": {"reasoning":true,"input":["text"]},- "qwen/qwen3-32b": {"reasoning":true,"input":["text"]},- "qwen/qwen3-coder-30b-a3b-instruct": {"input":["text"]},- "qwen/qwen3-coder-480b-a35b-instruct": {"input":["text"]},- "qwen/qwen3-coder-next": {"input":["text"]},- "qwen/qwen3-embedding-4b": {"input":["text"]},- "qwen/qwen3-embedding-8b": {"input":["text"]},- "qwen/qwen3-next-80b-a3b-instruct": {"input":["text"]},- "qwen/qwen3-next-80b-a3b-thinking": {"input":["text"]},- "qwen/qwen3-vl-235b-a22b-instruct": {"input":["text","image"]},- "qwen/qwen3-vl-235b-a22b-thinking": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"]},- "qwen/qwen3.5-122b-a10b": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3.5-27b": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3.5-35b-a3b": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3.5-397b-a17b": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text","image"]},- "qwen/qwen3.5-9b": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3.6-27b": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3.6-35b-a3b": {"reasoning":true,"input":["text","image"]},- "qwen/qwen3.8-2.4t-a95b": {"reasoning":true,"efforts":["low","medium","xhigh"],"input":["text"]},- "qwen/qwen3.8-27b": {"reasoning":true,"efforts":["low","medium","xhigh"],"input":["text","image"]},- "stepfun-ai/step-3.5-flash": {"reasoning":true,"input":["text"]},- "stepfun-ai/step-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video"]},- "tencent/hy3": {"reasoning":true,"efforts":["none","low","high"],"input":["text"]},- "thinkingmachines/inkling": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"]},- "thinkingmachines/inkling-small": {"reasoning":true,"input":["text","image"]},- "xiaomimimo/mimo-v2-flash": {"reasoning":true,"input":["text"]},- "xiaomimimo/mimo-v2.5": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"toggle":true,"input":["text"]},- "xiaomimimo/mimo-v2.5-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"toggle":true,"input":["text"]},- "zai-org/glm-4.5": {"reasoning":true,"input":["text"]},- "zai-org/glm-4.5-air": {"reasoning":true,"input":["text"]},- "zai-org/glm-4.5v": {"reasoning":true,"input":["text","image"]},- "zai-org/glm-4.6": {"reasoning":true,"input":["text"]},- "zai-org/glm-4.6v-flash": {"reasoning":true,"toggle":true,"input":["text","image"]},- "zai-org/glm-4.7": {"reasoning":true,"input":["text"]},- "zai-org/glm-4.7-flash": {"reasoning":true,"input":["text"]},- "zai-org/glm-5": {"reasoning":true,"input":["text"]},- "zai-org/glm-5.1": {"reasoning":true,"input":["text"]},- "zai-org/glm-5.2": {"reasoning":true,"input":["text"]},- "zai-org/glm-5.3": {"reasoning":true,"efforts":["low","high","max"],"input":["text"]},- "zai-org/glm-5.3-flash": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"]},+ "deepseek-ai/deepseek-r1": {"reasoning":true,"input":["text"],"context":64000},+ "deepseek-ai/deepseek-r1-0528": {"reasoning":true,"input":["text"],"context":163840},+ "deepseek-ai/deepseek-v3": {"input":["text"],"context":64000},+ "deepseek-ai/deepseek-v3-0324": {"input":["text"],"context":163840},+ "deepseek-ai/deepseek-v3.1": {"reasoning":true,"input":["text"],"context":131072},+ "deepseek-ai/deepseek-v3.2": {"reasoning":true,"input":["text"],"context":163840},+ "deepseek-ai/deepseek-v4-flash": {"reasoning":true,"input":["text"],"context":1048576},+ "deepseek-ai/deepseek-v4-flash-0731": {"reasoning":true,"efforts":["high","max"],"input":["text"],"context":1048576},+ "deepseek-ai/deepseek-v4-flash-vision-exp": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"],"context":1048576},+ "deepseek-ai/deepseek-v4-pro": {"reasoning":true,"efforts":["high"],"input":["text"],"context":1048576},+ "deepseek-ai/deepseek-v4-pro-0813": {"reasoning":true,"efforts":["low","high","max"],"input":["text"],"context":1000000},+ "deepseek-ai/deepseek-v4.1-flash": {"reasoning":true,"efforts":["none","low","high","xhigh","max"],"input":["text","image"],"context":1048576},+ "google/gemma-3-12b-it": {"input":["text","image"],"context":131072},+ "google/gemma-3-27b-it": {"input":["text","image"],"context":131072},+ "google/gemma-3-4b-it": {"input":["text","image"],"context":131072},+ "google/gemma-4-26b-a4b-it": {"reasoning":true,"input":["text","image"],"context":262144},+ "google/gemma-4-31b-it": {"reasoning":true,"input":["text","image"],"context":262144},+ "meta-llama/llama-3.1-8b-instruct": {"input":["text"],"context":131072},+ "meta-llama/llama-3.3-70b-instruct": {"input":["text"],"context":131072},+ "minimaxai/minimax-m2": {"reasoning":true,"input":["text"],"context":204800},+ "minimaxai/minimax-m2.1": {"reasoning":true,"input":["text"],"context":204800},+ "minimaxai/minimax-m2.5": {"reasoning":true,"input":["text"],"context":204800},+ "minimaxai/minimax-m2.7": {"reasoning":true,"input":["text"],"context":204800},+ "minimaxai/minimax-m3": {"reasoning":true,"input":["text","image"],"context":524288},+ "moonshotai/kimi-k2-instruct": {"input":["text"],"context":131072},+ "moonshotai/kimi-k2-instruct-0905": {"input":["text"],"context":262144},+ "moonshotai/kimi-k2-thinking": {"reasoning":true,"input":["text"],"context":262144},+ "moonshotai/kimi-k2.5": {"reasoning":true,"input":["text","image","video"],"context":262144},+ "moonshotai/kimi-k2.6": {"reasoning":true,"input":["text","image","video"],"context":262144},+ "moonshotai/kimi-k2.7-code": {"reasoning":true,"input":["text","image"],"context":262144},+ "moonshotai/kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"],"context":1000000},+ "openai/gpt-oss-120b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "openai/gpt-oss-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "qwen/qwen2.5-coder-32b-instruct": {"input":["text"],"context":131072},+ "qwen/qwen3-235b-a22b": {"reasoning":true,"input":["text"],"context":40960},+ "qwen/qwen3-235b-a22b-instruct-2507": {"input":["text"],"context":262144},+ "qwen/qwen3-235b-a22b-thinking-2507": {"reasoning":true,"input":["text"],"context":262144},+ "qwen/qwen3-30b-a3b": {"reasoning":true,"input":["text"],"context":40960},+ "qwen/qwen3-32b": {"reasoning":true,"input":["text"],"context":131072},+ "qwen/qwen3-coder-30b-a3b-instruct": {"input":["text"],"context":262144},+ "qwen/qwen3-coder-480b-a35b-instruct": {"input":["text"],"context":262144},+ "qwen/qwen3-coder-next": {"input":["text"],"context":262144},+ "qwen/qwen3-embedding-4b": {"input":["text"],"context":32000},+ "qwen/qwen3-embedding-8b": {"input":["text"],"context":32000},+ "qwen/qwen3-next-80b-a3b-instruct": {"input":["text"],"context":262144},+ "qwen/qwen3-next-80b-a3b-thinking": {"input":["text"],"context":262144},+ "qwen/qwen3-vl-235b-a22b-instruct": {"input":["text","image"],"context":131072},+ "qwen/qwen3-vl-235b-a22b-thinking": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"],"context":131072},+ "qwen/qwen3.5-122b-a10b": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3.5-27b": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3.5-35b-a3b": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3.5-397b-a17b": {"reasoning":true,"efforts":["none","low","medium","high"],"input":["text","image"],"context":262144},+ "qwen/qwen3.5-9b": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3.6-27b": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3.6-35b-a3b": {"reasoning":true,"input":["text","image"],"context":262144},+ "qwen/qwen3.8-2.4t-a95b": {"reasoning":true,"efforts":["low","medium","xhigh"],"input":["text"],"context":262144},+ "qwen/qwen3.8-27b": {"reasoning":true,"efforts":["low","medium","xhigh"],"input":["text","image"],"context":262144},+ "stepfun-ai/step-3.5-flash": {"reasoning":true,"input":["text"],"context":262144},+ "stepfun-ai/step-3.7-flash": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image","video"],"context":262144},+ "tencent/hy3": {"reasoning":true,"efforts":["none","low","high"],"input":["text"],"context":262144},+ "thinkingmachines/inkling": {"reasoning":true,"efforts":["low","medium","high"],"input":["text","image"],"context":1048576},+ "thinkingmachines/inkling-small": {"reasoning":true,"input":["text","image"],"context":524288},+ "xiaomimimo/mimo-v2-flash": {"reasoning":true,"input":["text"],"context":262144},+ "xiaomimimo/mimo-v2.5": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"toggle":true,"input":["text"],"context":262144},+ "xiaomimimo/mimo-v2.5-pro": {"reasoning":true,"efforts":["none","low","medium","high","xhigh"],"toggle":true,"input":["text"],"context":1048576},+ "zai-org/glm-4.5": {"reasoning":true,"input":["text"],"context":131072},+ "zai-org/glm-4.5-air": {"reasoning":true,"input":["text"],"context":131072},+ "zai-org/glm-4.5v": {"reasoning":true,"input":["text","image"],"context":65536},+ "zai-org/glm-4.6": {"reasoning":true,"input":["text"],"context":204800},+ "zai-org/glm-4.6v-flash": {"reasoning":true,"toggle":true,"input":["text","image"],"context":131072},+ "zai-org/glm-4.7": {"reasoning":true,"input":["text"],"context":204800},+ "zai-org/glm-4.7-flash": {"reasoning":true,"input":["text"],"context":200000},+ "zai-org/glm-5": {"reasoning":true,"input":["text"],"context":202752},+ "zai-org/glm-5.1": {"reasoning":true,"input":["text"],"context":202752},+ "zai-org/glm-5.2": {"reasoning":true,"input":["text"],"context":262144},+ "zai-org/glm-5.3": {"reasoning":true,"efforts":["low","high","max"],"input":["text"],"context":1048576},+ "zai-org/glm-5.3-flash": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"],"context":1048576},},"qwen": {- "deepseek-v4-flash-0731": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"]},- "glm-5.2": {"reasoning":true,"efforts":["none","minimal","low","medium","high","xhigh","max"],"input":["text"]},- "qvq-max": {"reasoning":true,"input":["text","image"]},- "qwen-flash": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen-max": {"input":["text"]},- "qwen-mt-plus": {"input":["text"]},- "qwen-mt-turbo": {"input":["text"]},- "qwen-omni-turbo": {"input":["text","image","audio","video"]},- "qwen-omni-turbo-realtime": {"input":["text","image","audio"]},- "qwen-plus": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen-plus-character-ja": {"input":["text"]},- "qwen-turbo": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen-vl-max": {"input":["text","image"]},- "qwen-vl-ocr": {"input":["text","image"]},- "qwen-vl-plus": {"input":["text","image"]},- "qwen2-5-14b-instruct": {"input":["text"]},- "qwen2-5-32b-instruct": {"input":["text"]},- "qwen2-5-72b-instruct": {"input":["text"]},- "qwen2-5-7b-instruct": {"input":["text"]},- "qwen2-5-omni-7b": {"input":["text","image","audio","video"]},- "qwen2-5-vl-72b-instruct": {"input":["text","image"]},- "qwen2-5-vl-7b-instruct": {"input":["text","image"]},- "qwen3-14b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3-235b-a22b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3-32b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3-8b": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3-asr-flash": {"input":["audio"]},- "qwen3-coder-30b-a3b-instruct": {"input":["text"]},- "qwen3-coder-480b-a35b-instruct": {"input":["text"]},- "qwen3-coder-flash": {"input":["text"]},- "qwen3-coder-plus": {"input":["text"]},- "qwen3-livetranslate-flash-realtime": {"input":["text","image","audio","video"]},- "qwen3-max": {"input":["text"]},- "qwen3-next-80b-a3b-instruct": {"input":["text"]},- "qwen3-next-80b-a3b-thinking": {"reasoning":true,"input":["text"]},- "qwen3-omni-flash": {"reasoning":true,"toggle":true,"input":["text","image","audio","video"]},- "qwen3-omni-flash-realtime": {"input":["text","image","audio","video"]},- "qwen3-vl-235b-a22b": {"reasoning":true,"input":["text","image"]},- "qwen3-vl-30b-a3b": {"reasoning":true,"input":["text","image"]},- "qwen3-vl-plus": {"reasoning":true,"toggle":true,"input":["text","image"]},- "qwen3.5-122b-a10b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "qwen3.5-27b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "qwen3.5-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "qwen3.5-397b-a17b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "qwen3.5-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen3.6-27b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "qwen3.6-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"]},- "qwen3.6-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen3.6-max-preview": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3.6-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen3.7-max": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3.7-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"]},- "qwen3.8-flash": {"reasoning":true,"efforts":["low","medium","xhigh"],"toggle":true,"input":["text","image","video"]},- "qwen3.8-max": {"reasoning":true,"efforts":["low","medium","xhigh"],"toggle":true,"input":["text","image","video","pdf"]},- "qwq-plus": {"reasoning":true,"input":["text"]},+ "deepseek-v4-flash-0731": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"],"context":1000000},+ "glm-5.2": {"reasoning":true,"efforts":["none","minimal","low","medium","high","xhigh","max"],"input":["text"],"context":1000000},+ "kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image"],"context":1048576},+ "qvq-max": {"reasoning":true,"input":["text","image"],"context":131072},+ "qwen-flash": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "qwen-max": {"input":["text"],"context":32768},+ "qwen-mt-plus": {"input":["text"],"context":16384},+ "qwen-mt-turbo": {"input":["text"],"context":16384},+ "qwen-omni-turbo": {"input":["text","image","audio","video"],"context":32768},+ "qwen-omni-turbo-realtime": {"input":["text","image","audio"],"context":32768},+ "qwen-plus": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "qwen-plus-character-ja": {"input":["text"],"context":8192},+ "qwen-turbo": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "qwen-vl-max": {"input":["text","image"],"context":131072},+ "qwen-vl-ocr": {"input":["text","image"],"context":34096},+ "qwen-vl-plus": {"input":["text","image"],"context":131072},+ "qwen2-5-14b-instruct": {"input":["text"],"context":131072},+ "qwen2-5-32b-instruct": {"input":["text"],"context":131072},+ "qwen2-5-72b-instruct": {"input":["text"],"context":131072},+ "qwen2-5-7b-instruct": {"input":["text"],"context":131072},+ "qwen2-5-omni-7b": {"input":["text","image","audio","video"],"context":32768},+ "qwen2-5-vl-72b-instruct": {"input":["text","image"],"context":131072},+ "qwen2-5-vl-7b-instruct": {"input":["text","image"],"context":131072},+ "qwen3-14b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen3-235b-a22b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen3-32b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen3-8b": {"reasoning":true,"toggle":true,"input":["text"],"context":131072},+ "qwen3-asr-flash": {"input":["audio"],"context":53248},+ "qwen3-coder-30b-a3b-instruct": {"input":["text"],"context":262144},+ "qwen3-coder-480b-a35b-instruct": {"input":["text"],"context":262144},+ "qwen3-coder-flash": {"input":["text"],"context":1000000},+ "qwen3-coder-plus": {"input":["text"],"context":1048576},+ "qwen3-livetranslate-flash-realtime": {"input":["text","image","audio","video"],"context":53248},+ "qwen3-max": {"input":["text"],"context":262144},+ "qwen3-next-80b-a3b-instruct": {"input":["text"],"context":131072},+ "qwen3-next-80b-a3b-thinking": {"reasoning":true,"input":["text"],"context":131072},+ "qwen3-omni-flash": {"reasoning":true,"toggle":true,"input":["text","image","audio","video"],"context":65536},+ "qwen3-omni-flash-realtime": {"input":["text","image","audio","video"],"context":65536},+ "qwen3-vl-235b-a22b": {"reasoning":true,"input":["text","image"],"context":131072},+ "qwen3-vl-30b-a3b": {"reasoning":true,"input":["text","image"],"context":131072},+ "qwen3-vl-plus": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "qwen3.5-122b-a10b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":262144},+ "qwen3.5-27b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":262144},+ "qwen3.5-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":262144},+ "qwen3.5-397b-a17b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":262144},+ "qwen3.5-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen3.6-27b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":262144},+ "qwen3.6-35b-a3b": {"reasoning":true,"toggle":true,"input":["text","image","video","audio"],"context":262144},+ "qwen3.6-flash": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen3.6-max-preview": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "qwen3.6-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen3.7-max": {"reasoning":true,"toggle":true,"input":["text"],"context":1000000},+ "qwen3.7-plus": {"reasoning":true,"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen3.8-flash": {"reasoning":true,"efforts":["low","medium","xhigh"],"toggle":true,"input":["text","image","video"],"context":1000000},+ "qwen3.8-max": {"reasoning":true,"efforts":["low","medium","xhigh"],"toggle":true,"input":["text","image","video","pdf"],"context":1000000},+ "qwq-plus": {"reasoning":true,"input":["text"],"context":131072},},"ollama": {- "deepseek-v4-flash": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"]},- "deepseek-v4-flash:0731": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"]},- "deepseek-v4-pro": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"]},- "deepseek-v4-pro:0813": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"]},- "deepseek-v4.1-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "gemma4:31b": {"reasoning":true,"toggle":true,"input":["text","image"]},- "glm-5.1": {"reasoning":true,"toggle":true,"input":["text"]},- "glm-5.2": {"reasoning":true,"efforts":["high","max"],"input":["text"]},- "glm-5.3": {"reasoning":true,"efforts":["low","high","max"],"input":["text"]},- "glm-5.3-flash": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image","video","pdf"]},- "gpt-oss:120b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "gpt-oss:20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "kimi-k2.5": {"reasoning":true,"toggle":true,"input":["text","image"]},- "kimi-k2.6": {"reasoning":true,"toggle":true,"input":["text","image"]},- "kimi-k2.7-code": {"reasoning":true,"toggle":true,"input":["text","image"]},- "kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"]},- "minimax-m2.5": {"reasoning":true,"input":["text"]},- "minimax-m2.7": {"reasoning":true,"toggle":true,"input":["text"]},- "minimax-m3": {"reasoning":true,"efforts":["low","medium","high","max"],"toggle":true,"input":["text","image","video"]},- "mistral-large-3:675b": {"input":["text","image"]},- "nemotron-3-nano:30b": {"reasoning":true,"toggle":true,"input":["text"]},- "nemotron-3-super": {"reasoning":true,"toggle":true,"input":["text"]},- "nemotron-3-ultra": {"reasoning":true,"toggle":true,"input":["text"]},- "qwen3.5:397b": {"reasoning":true,"toggle":true,"input":["text","image"]},+ "deepseek-v4-flash": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek-v4-flash:0731": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek-v4-pro": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek-v4-pro:0813": {"reasoning":true,"efforts":["high","max"],"toggle":true,"input":["text"],"context":1048576},+ "deepseek-v4.1-flash": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1048576},+ "gemma4:31b": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "glm-5.1": {"reasoning":true,"toggle":true,"input":["text"],"context":202752},+ "glm-5.2": {"reasoning":true,"efforts":["high","max"],"input":["text"],"context":976000},+ "glm-5.3": {"reasoning":true,"efforts":["low","high","max"],"input":["text"],"context":1048576},+ "glm-5.3-flash": {"reasoning":true,"efforts":["low","high","max"],"input":["text","image","video","pdf"],"context":1000000},+ "gpt-oss:120b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "gpt-oss:20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "kimi-k2.5": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "kimi-k2.6": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "kimi-k2.7-code": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},+ "kimi-k3": {"reasoning":true,"efforts":["low","high","max"],"toggle":true,"input":["text","image"],"context":1048576},+ "minimax-m2.5": {"reasoning":true,"input":["text"],"context":204800},+ "minimax-m2.7": {"reasoning":true,"toggle":true,"input":["text"],"context":196608},+ "minimax-m3": {"reasoning":true,"efforts":["low","medium","high","max"],"toggle":true,"input":["text","image","video"],"context":512000},+ "mistral-large-3:675b": {"input":["text","image"],"context":262144},+ "nemotron-3-nano:30b": {"reasoning":true,"toggle":true,"input":["text"],"context":1048576},+ "nemotron-3-super": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "nemotron-3-ultra": {"reasoning":true,"toggle":true,"input":["text"],"context":262144},+ "qwen3.5:397b": {"reasoning":true,"toggle":true,"input":["text","image"],"context":262144},},"lmstudio": {- "openai/gpt-oss-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"]},- "qwen/qwen3-30b-a3b-2507": {"input":["text"]},- "qwen/qwen3-coder-30b": {"input":["text"]},+ "openai/gpt-oss-20b": {"reasoning":true,"efforts":["low","medium","high"],"input":["text"],"context":131072},+ "qwen/qwen3-30b-a3b-2507": {"input":["text"],"context":262144},+ "qwen/qwen3-coder-30b": {"input":["text"],"context":262144},},};diff --git a/studio/frontend/src/features/chat/model-catalog.ts b/studio/frontend/src/features/chat/model-catalog.tsindex 9fae61b5791..53468936027 100644--- a/studio/frontend/src/features/chat/model-catalog.ts+++ b/studio/frontend/src/features/chat/model-catalog.ts@@ -35,6 +35,8 @@ export interface ModelCatalogEntry {defaultEffort: ReasoningEffortLevel | null;inputModalities: readonly string[] | null;maxOutputTokens: number | null;+ /** Total context window the provider publishes, or null when it publishes none. */+ contextLength: number | null;}interface LiveCatalogRecord {@@ -170,9 +172,21 @@ export function modelsDevCatalogFetchedAt(): number | null {// Merged namespaces, rebuilt whenever a served catalog lands.let mergedNamespaces: Map<string, Readonly<Record<string, ModelCatalogSnapshotEntry>>> | null = null;+/** Provider types with no catalogue namespace of their own. A Codex subscription serves OpenAI's+ * models under OpenAI's ids, and getExternalReasoningCapabilities already aliases it the same+ * way; without this every Codex lookup resolved to null and read as "not published". */+const CATALOG_NAMESPACE_ALIASES: Record<string, string> = {+ openai_codex: "openai",+};++function catalogNamespace(providerType: string): string {+ return CATALOG_NAMESPACE_ALIASES[providerType] ?? providerType;+}+function snapshotNamespace(providerType: string,): Readonly<Record<string, ModelCatalogSnapshotEntry>> | undefined {+ providerType = catalogNamespace(providerType);hydrateModelsDev();const served = modelsDev?.providers[providerType];const bundled = MODEL_CATALOG_SNAPSHOT[providerType];@@ -183,7 +197,14 @@ function snapshotNamespace(if (!mergedNamespaces) mergedNamespaces = new Map();const cached = mergedNamespaces.get(providerType);if (cached) return cached;- const merged = { ...bundled, ...served };+ const merged: Record<string, ModelCatalogSnapshotEntry> = { ...bundled };+ for (const [id, entry] of Object.entries(served)) {+ // A served entry replaces the bundled one, except that it cannot take away a context window+ // it has no field for: a backend older than that field, or its cached payload inside the+ // day-long TTL, would otherwise report every model it covers as not publishing one.+ const context = entry.context ?? bundled[id]?.context;+ merged[id] = context == null ? entry : { ...entry, context };+ }mergedNamespaces.set(providerType, merged);return merged;}@@ -203,6 +224,8 @@ function fromLiveModel(model: ProviderModelCapabilityInfo): ModelCatalogEntry {typeof model.max_output_tokens === "number" && model.max_output_tokens > 0? model.max_output_tokens: null,+ // The live response carries no context window; resolveModelCatalogEntry backfills it.+ contextLength: null,};}@@ -217,6 +240,7 @@ function fromSnapshotEntry(entry: ModelCatalogSnapshotEntry): ModelCatalogEntrydefaultEffort: null,inputModalities: entry.input ?? null,maxOutputTokens: null,+ contextLength: entry.context ?? null,};}@@ -285,14 +309,21 @@ export function resolveModelCatalogEntry(const candidates = lookupCandidates(normalizedProvider, modelId);if (candidates.length === 0) return null;hydrateLiveCatalog();+ const snapshot = snapshotNamespace(normalizedProvider);const live = LIVE_CATALOG.get(normalizedProvider)?.models;if (live) {for (const candidate of candidates) {const entry = live[candidate];- if (entry) return entry;+ if (!entry) continue;+ // A live entry wins on what it states, but states no context window, so that one field+ // falls through to the snapshot instead of reading as unpublished.+ if (entry.contextLength != null || !snapshot) return entry;+ const fallback = candidates+ .map((id) => snapshot[id]?.context)+ .find((context) => typeof context === "number" && context > 0);+ return fallback == null ? entry : { ...entry, contextLength: fallback };}}- const snapshot = snapshotNamespace(normalizedProvider);if (!snapshot) return null;for (const candidate of candidates) {const entry = snapshot[candidate];diff --git a/studio/frontend/src/features/chat/provider-capabilities.ts b/studio/frontend/src/features/chat/provider-capabilities.tsindex ae04c225c61..2dec9527046 100644--- a/studio/frontend/src/features/chat/provider-capabilities.ts+++ b/studio/frontend/src/features/chat/provider-capabilities.ts@@ -93,6 +93,67 @@ export function clampReasoningEffortToLevels(return effortLevels[0] ?? "low";}+/** Whether a level reaches the provider at all. The external request path sends reasoning_effort+ * for that style alone; every other style carries a bare thinking on/off, so a level chosen for+ * one of those is never sent. The default ladder is present either way, so the style is the only+ * thing that can say so. */+export function externalReasoningTakesEffort(+ caps: ExternalReasoningCapabilities,+): boolean {+ return caps.supportsReasoning && caps.reasoningStyle === "reasoning_effort";+}++/** The effort an external model should run at, pin first.+ *+ * One resolver, because there are three callers and they must not disagree: a model switch, the+ * normalization that reruns on reload and on every provider resync, and the picker's own+ * per-model editor. The pin used to be read by the switch alone, so a reload or a resync put the+ * provider default back over it.+ *+ * Pass `pinned: null` to resolve as if nothing were pinned, which is what clearing a pin needs. */+export function resolveExternalReasoningEffort(opts: {+ caps: ExternalReasoningCapabilities;+ providerType: string | null | undefined;+ /** The chat's level now: the clamp target, and what a model that cannot think keeps. */+ current: ReasoningEffortLevel;+ /** The level pinned on this model's picker row. Ignored when the model no longer offers it. */+ pinned?: string | null;+ /** Restore an existing preference without choosing a new model default. */+ restore?: boolean;+}): ReasoningEffortLevel {+ const { caps, providerType, current, pinned } = opts;+ const levels = caps.reasoningEffortLevels;+ // A style that sends no level has nothing to resolve, and moving the chat's level for it would+ // change what every other model runs at on the strength of a setting this one never sends.+ if (!externalReasoningTakesEffort(caps)) return current;+ // Set deliberately, for this model, so it outranks every default below.+ if (pinned && levels.includes(pinned as ReasoningEffortLevel)) {+ return pinned as ReasoningEffortLevel;+ }+ if (opts.restore) return clampReasoningEffortToLevels(current, levels);+ if (caps.defaultEffort && levels.includes(caps.defaultEffort)) {+ return caps.defaultEffort;+ }+ const clamped = clampReasoningEffortToLevels(current, levels);+ // Anthropic gets the highest level, since Claude's adaptive thinking adjusts cost per turn;+ // OpenAI gets "high"; everyone else "medium". Overridable via Think.+ if (providerType === "anthropic") {+ return levels.includes("xhigh")+ ? "xhigh"+ : levels.includes("high")+ ? "high"+ : clamped;+ }+ if (providerType === "openai") {+ return levels.includes("high")+ ? "high"+ : levels.includes("medium")+ ? "medium"+ : clamped;+ }+ return levels.includes("medium") ? "medium" : clamped;+}+/** Fallback cap for a model with no documented limit and no connection override. */export const EXTERNAL_MAX_OUTPUT_TOKENS = 32768;diff --git a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts b/studio/frontend/src/features/chat/stores/chat-runtime-store.tsindex f3a3368b487..0d5c877fa07 100644--- a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts+++ b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts@@ -6,6 +6,11 @@ import {mirrorHfTokenInto,useHfTokenStore,} from "@/features/hub/stores/hf-token-store";+// eslint-disable-next-line no-restricted-imports -- Leaf module; the model-picker index pulls in chat.+import {+ pinnedReasoningEffort,+ useModelReasoningEffortStore,+} from "@/features/model-picker/components/model-selector/model-reasoning-effort";import { loadedContextFields } from "@/features/model-picker/model-config/per-model-config";import {cachedPinnableGpuIndexKind,@@ -41,7 +46,12 @@ import {normalizeProjectAttachmentTarget,type ProjectAttachmentTarget,} from "../utils/project-attachment-target";-import { getExternalMaxOutputTokens } from "../provider-capabilities";+import {+ type ExternalReasoningCapabilities,+ externalReasoningTakesEffort,+ getExternalMaxOutputTokens,+ resolveExternalReasoningEffort,+} from "../provider-capabilities";import {PERSISTED_INFERENCE_PARAM_KEYS,REMEMBERED_INFERENCE_PARAM_KEYS,@@ -866,8 +876,11 @@ function readThreadScopedSettings(export function threadScopedOverride<K extends ThreadScopedSettingKey>(key: K,): ThreadScopedSettings[K] | undefined {- // activeThreadScopedSettings only refreshes on the debounce, so for 400ms it holds pre-edit- // values a load would revert and persist; prefer the store. A pending pin answers first.+ // Effort is captured before a model pin can overwrite the live value.+ if (key === "reasoningEffort" && activeThreadScopedSettings?.reasoningEffort !== undefined) {+ return activeThreadScopedSettings.reasoningEffort as ThreadScopedSettings[K];+ }+ // Other pending edits still live in the store until the debounce.if (threadSettingsWriteThreadId !== null &&threadSettingsWriteThreadId === threadScopedSettingsThreadId@@ -917,6 +930,29 @@ function keepsStoredValueUnderConstraint();}+/** Whether a per-model pin currently owns the live `reasoningEffort`. The pin is written into the+ * store so the composer shows it, but it belongs to the model, not to the chat. */+function pinOwnsLiveReasoningEffort(state: ChatRuntimeStore): boolean {+ return (+ externalReasoningTakesEffort(state) &&+ pinnedReasoningEffort(+ state.params.checkpoint,+ state.reasoningEffortLevels,+ ) !== null+ );+}++/** The chat's own effort while a pin hides it: what the chat is on record as running with, so a+ * snapshot taken under a pin stores the chat's level and not the model's. */+function reasoningEffortOnRecord(): ReasoningEffort | undefined {+ return (+ activeThreadScopedSettings?.reasoningEffort ??+ globalThreadScopedDefaults?.reasoningEffort ??+ effortDisplacedByPin ??+ undefined+ );+}+// The pills chat-page clamps to the selected model's capabilities.const CLAMPED_PILL_KEYS = ["toolsEnabled",@@ -1082,6 +1118,11 @@ function buildThreadScopedSnapshot() {settings.reasoningEnabled = false;}+ // The thread record already includes explicit edits waiting on the debounce.+ if (threadId === threadScopedSettingsThreadId && pinHoldsLiveEffort()) {+ const onRecord = reasoningEffortOnRecord();+ if (onRecord !== undefined) settings.reasoningEffort = onRecord;+ }// Same for every pill the model-selection pass clamps off without touching the snapshot:// each pill's own capability rule is exactly when the user could not have done it.if (threadId === threadScopedSettingsThreadId) {@@ -1634,17 +1675,19 @@ function restoreDefaultsOverCommittedEdits(/** What the user actually touched, read off the store, which still holds their edits. */function heldThreadScopedChanges(- held: { field: string }[],+ held: { field: string; value?: unknown }[],): ThreadScopedSettings {const edited: Record<string, unknown> = {};const live = useChatRuntimeStore.getState();// Same reader the snapshot path uses: sampling keys sit under `params`, so a direct field// read returns undefined and the sanitizer drops them.for (const edit of held) {- edited[edit.field] = readThreadScopedValue(- live,- edit.field as ThreadScopedSettingKey,- );+ edited[edit.field] = edit.field === "reasoningEffort" && edit.value !== undefined+ ? edit.value+ : readThreadScopedValue(+ live,+ edit.field as ThreadScopedSettingKey,+ );}return sanitizeThreadScopedSettings(edited);}@@ -1714,6 +1757,12 @@ function captureThreadScopedEdit(if (threadId === null) return false;// Both ids: between a switch and its snapshot arriving the store still holds the old values.if (threadId === threadScopedSettingsThreadId) {+ if (field === "reasoningEffort" && value !== undefined) {+ activeThreadScopedSettings = {+ ...activeThreadScopedSettings,+ reasoningEffort: value as ReasoningEffort,+ };+ }explicitlyEditedThreadFields.add(field);// Set by the user now, so the chat stores this rather than what it had before a constraint moved the same field.constraintSuppressedThreadFields.delete(field);@@ -2527,6 +2576,12 @@ type ChatRuntimeStore = {enabled: boolean,options?: { persist?: boolean },) => void;+ /** Write one model's remembered params directly, live or not. For the picker's per-model+ * editor; elsewhere an edit belongs to the loaded model and setParams covers it. */+ setRememberedParamsForModel: (+ modelId: string,+ patch: PersistedInferenceParams,+ ) => void;setLastOpenRouterChosenModel: (chosen: string | null) => void;setReasoningStyle: (style: ReasoningStyle) => void;setReasoningEffort: (effort: ReasoningEffort) => void;@@ -2734,6 +2789,11 @@ const SCALAR_SETTING_KEYS = [// Ids this browser holds a local answer for. Hydration keeps these and merges the rest, so a// pre-hydration edit cannot drop other models.const locallyRememberedModels = new Set<string>();+// Per-model edits made before the settings response landed, held as PATCHES rather than rows.+// The set above is overlaid wholesale, which is right for a row built from a hydrated entry but+// not for one typed before there was an entry: that row names only the keys the user touched, so+// replacing with it would drop the temperature, top-p or seed the response is about to bring.+const modelParamEditsBeforeHydration = new Map<string, PersistedInferenceParams>();/** Deferred, not module scope: per-model-params is in the @/features/chat import cycle, so* naming PERSISTED_INFERENCE_PARAM_KEYS here reads a const in its TDZ and throws at import* time (as watchedStorageKeys() avoids). Memoized, or the `+= 1` bumps stop accumulating. */@@ -3228,6 +3288,12 @@ function getHydratedSettingsState(hydrated[modelId] = local;}}+ for (const [modelId, patch] of modelParamEditsBeforeHydration) {+ hydrated[modelId] = { ...hydrated[modelId], ...patch };+ // A complete row from here, so a later response takes the wholesale fence above.+ locallyRememberedModels.add(modelId);+ }+ modelParamEditsBeforeHydration.clear();// The entry arriving for this model predates the fenced edit, so lay the edit over it or the// next defaults update replays the stale one.if (checkpoint) {@@ -3389,10 +3455,16 @@ function setScalarSettingVersion<K extends ScalarSettingKey>(return;}const writeGlobal = () => {+ if (key === "reasoningEffort" && globalThreadScopedDefaults !== null) {+ globalThreadScopedDefaults = {+ ...globalThreadScopedDefaults,+ reasoningEffort: value as ReasoningEffort,+ };+ }scalarSettingMutationVersions[key] += 1;saveSettingsPatch({ [key]: value });};- if (captureThreadScopedEdit(key, writeGlobal)) return;+ if (captureThreadScopedEdit(key, writeGlobal, value)) return;writeGlobal();}@@ -3412,6 +3484,77 @@ function localQwenMigrationSettings(};}+// The chat's own effort, kept when a per-model pin took its place in the live store so that+// clearing the pin can put it back. A pin is applied with a plain setState and persists nothing,+// and the thread snapshot is read off the live store, so nothing else records what it displaced.+// Session only: after a reload the live level already IS the pin's and nothing preceded it here,+// so clearing then resolves without it.+let effortDisplacedByPin: ReasoningEffort | null = null;++/** Called before a per-model pin overwrites the live effort. The first displacement wins, so+ * pinning twice and then clearing returns to the chat's own level, not to the earlier pin. */+export function noteEffortDisplacedByPin(current: ReasoningEffort): void {+ // Nothing before hydration: the level on screen is still this store's own default, not the+ // chat's, and hydration replaces it because a pin advances no mutation version. The pin sites+ // rerun once it lands, and the first record is the one that sticks.+ if (!useChatRuntimeStore.getState().settingsHydrated) return;+ effortDisplacedByPin ??= current;+}++/** Whether the live effort is a pin's rather than the chat's own. A pin in force owns it outright:+ * every path that applies one writes it, the snapshot apply holds the chat's level back behind it,+ * and stating a level in the composer clears the pin, so the two cannot disagree. The record+ * covers the pin that has since gone, whether cleared or withdrawn by a catalogue refresh, while+ * the level in the store is still it. */+export function pinHoldsLiveEffort(): boolean {+ return (+ pinOwnsLiveReasoningEffort(useChatRuntimeStore.getState()) ||+ effortDisplacedByPin !== null+ );+}++/** The level to resolve from when a pin is cleared, or null when neither source has one. The+ * chat's own level first: the snapshot keeps it because buildThreadScopedSnapshot holds the pin+ * back, so it survives a reload and a thread switch, which the in-memory record does not. */+export function takeEffortDisplacedByPin(): ReasoningEffort | null {+ const displaced = effortDisplacedByPin;+ effortDisplacedByPin = null;+ return (+ activeThreadScopedSettings?.reasoningEffort ??+ globalThreadScopedDefaults?.reasoningEffort ??+ displaced+ );+}++/** Apply a model pin without persisting it as the chat's preference. */+export function reconcilePinnedReasoningEffort(opts: {+ checkpoint: string;+ caps: ExternalReasoningCapabilities;+ providerType: string | null | undefined;+}): void {+ const state = useChatRuntimeStore.getState();+ if (state.params.checkpoint !== opts.checkpoint) return;+ const pinned = externalReasoningTakesEffort(opts.caps)+ ? pinnedReasoningEffort(opts.checkpoint, opts.caps.reasoningEffortLevels)+ : null;+ if (!pinned && !pinHoldsLiveEffort()) return;+ const next = resolveExternalReasoningEffort({+ caps: opts.caps,+ providerType: opts.providerType,+ current: pinned+ ? state.reasoningEffort+ : (takeEffortDisplacedByPin() ?? state.reasoningEffort),+ pinned,+ restore: pinned === null,+ });+ if (pinned) noteEffortDisplacedByPin(state.reasoningEffort);+ if (next === state.reasoningEffort) return;+ useChatRuntimeStore.setState((live) => ({+ reasoningEffort: next,+ queuedSettingsEpoch: live.queuedSettingsEpoch + 1,+ }));+}+function installationReasoningEnabled(state: ChatRuntimeStore): boolean {return threadScopedOverride("reasoningEnabled") !== undefined? (globalThreadScopedDefaults?.reasoningEnabled ?? state.reasoningEnabled)@@ -4713,8 +4856,14 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({// Edits made while this chat's snapshot was in flight: keep them and store them on the chat,// or the read would silently undo a click the user already saw.const heldFields = new Set<string>();+ let heldEffort: ReasoningEffort | undefined;if (threadId !== null && threadId === pendingPairingThreadId) {- for (const edit of heldThreadScopedEdits) heldFields.add(edit.field);+ for (const edit of heldThreadScopedEdits) {+ heldFields.add(edit.field);+ if (edit.field === "reasoningEffort" && edit.value !== undefined) {+ heldEffort = edit.value as ReasoningEffort;+ }+ }heldThreadScopedEdits = [];pendingPairingThreadId = null;// The window is over, so the next visit samples afresh rather than reusing this round's.@@ -4761,6 +4910,14 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({}hydratedDefaultsByHeldField.delete(field);}+ // Same reason as the snapshot: a pin applied before the first chat opened is in the live+ // effort, and capturing it here would make one model's level the default every+ // snapshot-less chat follows.+ if (pinOwnsLiveReasoningEffort(state) && !heldFields.has("reasoningEffort")) {+ const onRecord = reasoningEffortOnRecord();+ if (onRecord === undefined) delete captured.reasoningEffort;+ else captured.reasoningEffort = onRecord;+ }globalThreadScopedDefaults = captured as ThreadScopedSettings;}threadScopedSettingsThreadId = threadId;@@ -4779,7 +4936,14 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({for (const key of THREAD_SCOPED_SETTING_KEYS) {// The user set this one while the read was in flight, so it wins over what came back.if (heldFields.has(key)) {- applied[key] = readThreadScopedValue(state, key);+ if (key === "reasoningEffort" && heldEffort !== undefined) {+ applied[key] = heldEffort;+ activeThreadScopedSettings = { ...activeThreadScopedSettings, reasoningEffort: heldEffort };+ if (pinOwnsLiveReasoningEffort(state)) effortDisplacedByPin = heldEffort;+ else nextState.reasoningEffort = heldEffort;+ } else {+ applied[key] = readThreadScopedValue(state, key);+ }continue;}// Full access was accepted through a warning dialog, so a switch must not drop it. The chat@@ -4808,6 +4972,17 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({);if (value === undefined) continue;applied[key] = value;+ // The pin outranks the chat for as long as its model is selected, so the incoming level+ // stays the chat's on record, recorded just above, but must not land in the store over+ // the pin. Same shape as the "full" case: recorded, not applied.+ if (key === "reasoningEffort" && pinOwnsLiveReasoningEffort(state)) {+ // This chat's own level, which the pin is now sitting on top of, so leaving the model+ // hands it back. Assigned rather than noted: it replaces the last chat's, and the pin+ // may have been in the store since before this one opened, displacing nothing then.+ // The value is one the enum sanitizer already passed.+ effortDisplacedByPin = value as ReasoningEffort;+ continue;+ }if (isSameThreadScopedValue(value, readThreadScopedValue(state, key))) {continue;}@@ -4870,6 +5045,9 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({// Mirror setCheckpoint's persistence: dropping the checkpoint must also clear any stored external selection.saveLastExternalCheckpoint(null);saveBool(CHAT_DEEP_RESEARCH_ENABLED_KEY, false);+ const restoredEffort = pinHoldsLiveEffort()+ ? takeEffortDisplacedByPin()+ : null;return set((state) => ({queuedSettingsEpoch: state.queuedSettingsEpoch + 1,// An unload leaves the model the same way a switch does, so record what it was running with.@@ -4897,6 +5075,7 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({reasoningAlwaysOn: false,reasoningEnabled: true,reasoningStyle: "enable_thinking",+ reasoningEffort: restoredEffort ?? state.reasoningEffort,supportsReasoningOff: false,reasoningEffortLevels: ["low", "medium", "high"],supportsPreserveThinking: false,@@ -5003,8 +5182,66 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({reasoningStyle,queuedSettingsEpoch: state.queuedSettingsEpoch + 1,})),- setReasoningEffort: (reasoningEffort) =>+ setRememberedParamsForModel: (modelId, patch) =>set((state) => {+ if (!modelId || !hasKeys(patch)) return state;+ const merged = { ...state.paramsByModel[modelId], ...patch };+ const next = { ...state.paramsByModel, [modelId]: merged };+ // Only the moved keys: the server merges per key, so a full snapshot clobbers other tabs.+ // Not gated on hydration, unlike a defaults write: this is a typed edit for one model that+ // can only set the keys it names, and gating it dropped an edit made while the initial+ // /api/chat/settings request was out.+ saveSettingsPatch({ inferenceParamsByModel: { [modelId]: patch } });+ // trackParamsByModel files nothing before hydration, so without this the response in flight+ // rebuilds paramsByModel from the server and the edit is gone. Held as a patch: there is no+ // entry to have built a row from yet.+ if (!state.settingsHydrated) {+ modelParamEditsBeforeHydration.set(modelId, {+ ...modelParamEditsBeforeHydration.get(modelId),+ ...patch,+ });+ }+ // Editing the live model must land on the live params, not just on the next switch back.+ // Through the restore a switch uses, since systemPrompt is one of the chat's own keys: the+ // open chat outranks the model it is running, and writing past that would both send the+ // model's prompt for the rest of the chat and let the next snapshot store it as the chat's.+ // Live params only, as there: the row above keeps the model's own value.+ const live = state.params.checkpoint === modelId;+ const liveParams = live+ ? restoreThreadScopedParams({ ...state.params, ...patch })+ : null;+ // Nothing left to apply once the chat has taken its keys back.+ const liveChanged =+ liveParams !== null &&+ shouldAdvanceQueuedSettingsEpoch(state.params, liveParams);+ // And those keys are fenced the way a slider edit fences its own, or a response in flight+ // puts the global set back over them.+ if (liveChanged) getChangedInferenceParams(liveParams, state.params);+ return {+ paramsByModel: trackParamsByModel(state, next, modelId) ?? next,+ // The epoch as setParams advances it: a queued prompt or a paste still reading its file+ // captured the old prompt and cap, and this is what tells it they are no longer current.+ ...(liveChanged+ ? {+ params: liveParams,+ queuedSettingsEpoch: state.queuedSettingsEpoch + 1,+ }+ : {}),+ };+ }),+ setReasoningEffort: (reasoningEffort) => {+ // Choosing another level removes the current model's override.+ const checkpoint = useChatRuntimeStore.getState().params.checkpoint;+ const { effortByModel, setModelReasoningEffort } =+ useModelReasoningEffortStore.getState();+ const pinned = checkpoint ? effortByModel[checkpoint] : undefined;+ // Re-picking the pin's own level states nothing new, so it keeps the pin.+ if (checkpoint && pinned !== undefined && pinned !== reasoningEffort) {+ setModelReasoningEffort(checkpoint, null);+ }+ set((state) => {+ // A retained pin must keep the preference it displaced.+ if (pinned !== reasoningEffort) effortDisplacedByPin = null;setScalarSettingVersion("reasoningEffort",reasoningEffort,@@ -5014,7 +5251,8 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({reasoningEffort,queuedSettingsEpoch: state.queuedSettingsEpoch + 1,};- }),+ });+ },setPreserveThinking: (preserveThinking) =>set((state) => {setScalarSettingVersion(diff --git a/studio/frontend/src/features/model-picker/components/model-selector.tsx b/studio/frontend/src/features/model-picker/components/model-selector.tsxindex 66c039c3f33..17ea4cafc75 100644--- a/studio/frontend/src/features/model-picker/components/model-selector.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector.tsx@@ -12,6 +12,8 @@ import { TooltipProvider } from "@/components/ui/tooltip";import { ApiProviderLogo } from "@/features/chat/api-provider-logo";import type { HfTaskFilter } from "@/features/hub/hooks/use-hub-model-search";+// eslint-disable-next-line no-restricted-imports -- The settings barrel imports this feature back.+import { useSettingsDialogStore } from "@/features/settings/stores/settings-dialog-store";import { useT } from "@/i18n";import { ChevronDownStandardIcon } from "@/lib/chevron-icons";import { cn } from "@/lib/utils";@@ -320,6 +322,7 @@ function ModelSelectorContent({onEject,onFoldersChange,onBrowseHub,+ onConfigureConnection,onModelsChange,deleteDisabled,className,@@ -348,6 +351,7 @@ function ModelSelectorContent({onEject?: () => void;onFoldersChange?: () => void;onBrowseHub?: () => void;+ onConfigureConnection?: (providerId: string) => void;onModelsChange?: (deletedModel?: DeletedModelRef) => void;deleteDisabled?: boolean;className?: string;@@ -610,6 +614,7 @@ function ModelSelectorContent({resolveDownloadFootprint={resolveDownloadFootprint}onFoldersChange={onFoldersChange}onBrowseHub={onBrowseHub}+ onConfigureConnection={onConfigureConnection}onModelsChange={onModelsChange}onConfigure={openConfigPage}deleteDisabled={deleteDisabled}@@ -802,6 +807,13 @@ export function ModelSelector({void navigate({ to: "/hub", search: { tab: "discover" } });}+ // A Connected group's gear. What is configurable about a remote model lives on its connection,+ // so open that form rather than ModelConfigPage's local load settings.+ function handleConfigureConnection(providerId: string) {+ setOpen(false);+ useSettingsDialogStore.getState().openConnectionSettings(providerId);+ }+return (<Popover open={open} onOpenChange={setOpen}><ModelSelectorTrigger@@ -841,6 +853,7 @@ export function ModelSelector({onBrowseHub={task && communityModelPolicy === "none" ? undefined : handleBrowseHub}+ onConfigureConnection={handleConfigureConnection}onModelsChange={onModelsChange}deleteDisabled={deleteDisabled}className={contentClassName}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/connected-model-info-dialog.tsx b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-info-dialog.tsxnew file mode 100644index 00000000000..24306265d7c--- /dev/null+++ b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-info-dialog.tsx@@ -0,0 +1,167 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// What the app knows about one connected model. A local row answers "what is this" with its size,+// quant and path; a connected row has none of those, so everything comes from the provider+// registry and the connection's cached catalogue.+//+// Each figure is read through the same resolver the rest of the app uses for it, so this cannot+// disagree with the composer's own chips.+//+// What the model is, not what it is set to: the gear beside this opens the three settings it+// keeps of its own and shows what each holds, so printing them here was that dialog again.++import {+ Dialog,+ DialogContent,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import { modelCatalogVersion, subscribeModelCatalog } from "@/features/chat";+// eslint-disable-next-line no-restricted-imports -- Avoid the chat barrel's React exports.+import { resolveModelCatalogEntry } from "@/features/chat/model-catalog";+// eslint-disable-next-line no-restricted-imports -- Avoid the chat barrel's React exports.+import {+ externalReasoningTakesEffort,+ getExternalReasoningCapabilities,+ getPublishedExternalMaxOutputTokens,+} from "@/features/chat/provider-capabilities";+import { type ReactNode, useSyncExternalStore } from "react";+import { connectedModelMarks } from "./connected-model-meta";++const MODALITY_LABELS: Record<string, string> = {+ text: "Text",+ image: "Images",+ audio: "Audio",+ video: "Video",+ pdf: "PDF",+};++function tokens(count: number): string {+ return `${count.toLocaleString()} tokens`;+}++function Field({ label, children }: { label: string; children: ReactNode }) {+ return (+ <div className="flex items-baseline justify-between gap-6 py-2">+ <span className="shrink-0 text-xs text-muted-foreground">{label}</span>+ <span className="min-w-0 text-right text-xs text-foreground">+ {children}+ </span>+ </div>+ );+}++function Unset({ children }: { children: string }) {+ return <span className="text-muted-foreground">{children}</span>;+}++export function ConnectedModelInfoDialog({+ open,+ onOpenChange,+ modelId,+ displayName,+ providerName,+ providerType,+ baseUrl,+ isReasoningProvider,+}: {+ open: boolean;+ onOpenChange: (open: boolean) => void;+ /** The provider's own id, which is what every lookup here keys on. */+ modelId: string;+ displayName: string;+ providerName: string;+ providerType: string;+ baseUrl?: string | null;+ /** A vLLM connection flagged as serving a reasoning model: the only signal a self-host gives. */+ isReasoningProvider?: boolean;+}) {+ // Every figure below is read from the catalogue, which can land after this renders.+ useSyncExternalStore(subscribeModelCatalog, modelCatalogVersion);+ const entry = resolveModelCatalogEntry(providerType, modelId);+ const marks = connectedModelMarks({ providerType, modelId, baseUrl });+ // The resolver behind the composer's Thinking chip, not the catalogue alone.+ const reasoning = getExternalReasoningCapabilities(providerType, modelId, {+ isReasoningProvider,+ baseUrl,+ });+ // "none" is the off switch, not a rung. Only where a level is sent at all: the default ladder+ // is there even for a style that carries a bare thinking on/off, and listing it read as a+ // choice this model takes.+ const takesEffort = externalReasoningTakesEffort(reasoning);+ const effortLevels = takesEffort+ ? reasoning.reasoningEffortLevels.filter((level) => level !== "none")+ : [];+ const publishedMaxOutput =+ getPublishedExternalMaxOutputTokens(providerType, modelId) ??+ entry?.maxOutputTokens ??+ null;++ const inputs = entry?.inputModalities?.length+ ? entry.inputModalities+ .map((modality) => MODALITY_LABELS[modality] ?? modality)+ .join(" · ")+ : marks.vision+ ? "Text · Images"+ : "Text";+ const generates = [+ marks.capabilities.imageGen ? "Images" : null,+ marks.capabilities.videoGen ? "Video" : null,+ ].filter(Boolean);++ return (+ <Dialog open={open} onOpenChange={onOpenChange}>+ <DialogContent className="sm:max-w-xl">+ <DialogHeader>+ <DialogTitle>{displayName}</DialogTitle>+ </DialogHeader>++ <div className="-mt-2 divide-y divide-border/50">+ <Field label="Model ID">+ {/* break-all, not break-words: an id has no spaces to break at. */}+ <span className="break-all font-mono">{modelId}</span>+ </Field>+ <Field label="Connection">{providerName}</Field>+ {baseUrl ? (+ <Field label="Endpoint">+ <span className="break-all font-mono">{baseUrl}</span>+ </Field>+ ) : null}+ <Field label="Accepts">{inputs}</Field>+ {generates.length > 0 ? (+ <Field label="Generates">{generates.join(" · ")}</Field>+ ) : null}+ <Field label="Context window">+ {entry?.contextLength ? (+ <span className="tabular-nums">+ {tokens(entry.contextLength)}+ </span>+ ) : (+ <Unset>Not published</Unset>+ )}+ </Field>+ <Field label="Max output">+ {publishedMaxOutput ? (+ <span className="tabular-nums">{tokens(publishedMaxOutput)}</span>+ ) : (+ <Unset>Follows the connection</Unset>+ )}+ </Field>+ <Field label="Reasoning">+ {reasoning.supportsReasoning ? (+ <>+ {effortLevels.length > 0+ ? effortLevels.join(" · ")+ : "Supported"}+ {reasoning.reasoningAlwaysOn ? " (always on)" : null}+ </>+ ) : (+ <Unset>No</Unset>+ )}+ </Field>+ </div>+ </DialogContent>+ </Dialog>+ );+}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/connected-model-meta.ts b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-meta.tsnew file mode 100644index 00000000000..97bf4e9b602--- /dev/null+++ b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-meta.ts@@ -0,0 +1,53 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Every mark comes from what the request path already resolves (capability registry, provider+// gates), never from the model's name: a mark the request cannot honour is a promise the picker+// breaks. An On Device badge may guess, since it describes a repo you have not fetched yet.++// eslint-disable-next-line no-restricted-imports -- Avoid the chat barrel's React exports.+import { providerModelSupportsVision } from "@/features/chat/external-providers";+// eslint-disable-next-line no-restricted-imports -- Avoid the chat barrel's React exports.+import { providerSupportsBuiltinImageGeneration } from "@/features/chat/provider-capabilities";+import type { ModelCapabilities } from "./model-capabilities";++export interface ConnectedModelMarks {+ /** Capability glyphs (audio / generates images / generates video). */+ capabilities: ModelCapabilities;+ /** Reads images: drawn as the row's Vision badge rather than a glyph. */+ vision: boolean;+}++/** The badges one Connected row should draw.+ *+ * `modelId` is the provider's own id (`gemini-2.5-flash-image`), not the `external::` id the+ * picker selects by. `baseUrl` is the connection's and only image generation reads it. */+export function connectedModelMarks(opts: {+ providerType: string | null | undefined;+ modelId: string | null | undefined;+ baseUrl?: string | null;+}): ConnectedModelMarks {+ const { providerType, modelId, baseUrl } = opts;+ // null is unknown, drawn as no badge rather than as a promise.+ const vision = providerModelSupportsVision(providerType, modelId) === true;+ return {+ capabilities: {+ vision,+ // CAPABILITY_BADGES draws no reasoning glyph, so it is not worth a second catalogue lookup.+ reasoning: false,+ // The audio adapter resolves the active model out of `models`, which holds loaded local+ // models only, so `add` rejects every audio file under a connected selection.+ audio: false,+ // The helper alone, no name fallback: the same gate the adapter and the Images pill use.+ imageGen: providerSupportsBuiltinImageGeneration(+ providerType,+ modelId,+ baseUrl,+ ),+ // Nothing we connect to serves video generation through the chat route, so the name would+ // be the only evidence and a glyph resting on it promises what selecting the row cannot do.+ videoGen: false,+ },+ vision,+ };+}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsx b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsxnew file mode 100644index 00000000000..6bdea37e9ef--- /dev/null+++ b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsx@@ -0,0 +1,258 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// One connected model's own settings. The system prompt and output cap are not a new store: Chat+// has remembered both per model for as long as "Remember settings per model" has been on, under+// the same checkpoint id. This just makes that memory visible and editable from the row.+//+// Reasoning effort is the one new value here; the chat's own is a single global level.++import { Button } from "@/components/ui/button";+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import {+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";+import { Textarea } from "@/components/ui/textarea";+import {+ modelCatalogVersion,+ reconcilePinnedReasoningEffort,+ subscribeModelCatalog,+ useChatRuntimeStore,+} from "@/features/chat";+// eslint-disable-next-line no-restricted-imports -- Avoid the chat barrel's React exports.+import {+ externalReasoningTakesEffort,+ getExternalMaxOutputTokens,+ getExternalMinOutputTokens,+ getExternalReasoningCapabilities,+} from "@/features/chat/provider-capabilities";+import { useState, useSyncExternalStore } from "react";+import { useModelReasoningEffortStore } from "./model-reasoning-effort";++/** Follows the chat's own level. A Select cannot carry an empty value, so absence needs a name. */+const FOLLOW_CHAT = "__follow_chat__";++export function ConnectedModelSettingsDialog({+ open,+ onOpenChange,+ checkpointId,+ displayName,+ modelId,+ providerType,+ baseUrl,+ isReasoningProvider,+ connectionMaxOutputTokens,+}: {+ open: boolean;+ onOpenChange: (open: boolean) => void;+ /** The `external::` id, which is what both memories key on. */+ checkpointId: string;+ displayName: string;+ /** The provider's own id, for the catalogue lookup. */+ modelId: string;+ providerType: string;+ baseUrl?: string | null;+ /** A vLLM connection flagged as serving a reasoning model. */+ isReasoningProvider?: boolean;+ /** The connection's own output cap, which lowers the model's documented one. */+ connectionMaxOutputTokens?: number | null;+}) {+ const remembered = useChatRuntimeStore(+ (state) => state.paramsByModel[checkpointId],+ );+ const rememberParamsPerModel = useChatRuntimeStore(+ (state) => state.rememberParamsPerModel,+ );+ const setRememberedParamsForModel = useChatRuntimeStore(+ (state) => state.setRememberedParamsForModel,+ );+ // The chat's own cap, which is what a model with none of its own runs at.+ const chatMaxTokens = useChatRuntimeStore((state) => state.params.maxTokens);+ // Whether this is the model currently loaded, which decides whether an edit has to reach the+ // live settings as well as the memory.+ const isLiveModel = useChatRuntimeStore(+ (state) => state.params.checkpoint === checkpointId,+ );+ const pinnedEffort = useModelReasoningEffortStore(+ (state) => state.effortByModel[checkpointId],+ );+ const setModelReasoningEffort = useModelReasoningEffortStore(+ (state) => state.setModelReasoningEffort,+ );++ // The resolver behind the composer's own Thinking control, not the catalogue alone, so the+ // levels offered here are the ones the provider actually accepts. "none" is the off switch.+ const reasoning = getExternalReasoningCapabilities(providerType, modelId, {+ isReasoningProvider,+ baseUrl,+ });+ // Offered only where a level is actually sent: the default low/medium/high ladder is present+ // even for a model whose style carries a bare thinking on/off, so gating on supportsReasoning+ // alone let a pin be set on Kimi that no request could ever carry.+ const efforts = externalReasoningTakesEffort(reasoning)+ ? reasoning.reasoningEffortLevels.filter((level) => level !== "none")+ : [];++ // An OpenRouter cap comes from the live catalogue, which can land after this renders, and the+ // bounds below are read from it.+ useSyncExternalStore(subscribeModelCatalog, modelCatalogVersion);+ // The bounds the chat's own Max Tokens control uses and the adapter clamps every request to, so+ // a value stored here cannot differ from the one the provider is actually sent.+ const minCap = getExternalMinOutputTokens(providerType);+ const maxCap = getExternalMaxOutputTokens(+ providerType,+ modelId,+ connectionMaxOutputTokens,+ );+ const clampCap = (value: number) =>+ Math.min(Math.max(value, minCap), maxCap);++ // null is untouched, so an untouched field keeps reading the store and Save writes nothing for+ // it. The dialog can open before chat settings hydrate, and a useState seeded from the empty+ // store then held that emptiness after the response landed, so Save put it back over the prompt+ // the server had. A pin another tab changes while this is open reads the same way.+ const [promptDraft, setPromptDraft] = useState<string | null>(null);+ const [capDraft, setCapDraft] = useState<string | null>(null);+ const [effortDraft, setEffortDraft] = useState<string | null>(null);+ const systemPrompt = promptDraft ?? remembered?.systemPrompt ?? "";+ // Against the ladder as it stands now, since the catalogue subscription below can withdraw a+ // level while this is open. A draft the model no longer offers reverts to what is stored and+ // Save leaves the pin alone, rather than writing a level every resolver then refuses. A stored+ // pin the ladder dropped reads as Follow chat for the same reason: that is what it now does.+ const offered = (level: string): boolean =>+ (efforts as readonly string[]).includes(level);+ const liveEffortDraft =+ effortDraft !== null && (effortDraft === FOLLOW_CHAT || offered(effortDraft))+ ? effortDraft+ : null;+ const effort =+ liveEffortDraft ??+ (pinnedEffort && offered(pinnedEffort) ? pinnedEffort : FOLLOW_CHAT);+ // Always a real number. A blank would have to mean "forget the cap", and nothing can express+ // that: paramsByModel merges per key here and the settings row deep-merges on the server, so an+ // omitted key keeps the old value and the clear would be dropped without saying so.+ const maxTokens =+ capDraft ?? String(clampCap(remembered?.maxTokens ?? chatMaxTokens));++ function save() {+ // Number, not parseInt: a number field accepts scientific notation, and parseInt stops at the+ // "e", so 1e5 read as 1 and was saved clamped to the provider minimum. Rounded because the+ // cap is a token count and the field admits a decimal.+ const typedCap = Math.round(Number(maxTokens.trim()));+ // Only what the user actually touched: this is a patch, and writing an untouched field would+ // put whatever the dialog happened to be showing over the stored value.+ setRememberedParamsForModel(checkpointId, {+ ...(promptDraft !== null ? { systemPrompt: promptDraft } : {}),+ // A blank or junk field leaves the cap alone rather than sending a zero as the limit.+ ...(capDraft !== null && Number.isFinite(typedCap) && typedCap > 0+ ? { maxTokens: clampCap(typedCap) }+ : {}),+ });+ // Untouched writes nothing at all: another tab can change this pin while the dialog is open,+ // and a save of an unrelated field would otherwise put the value this select opened with back+ // over it. It would also reset the composer's own Think level for no reason.+ if (liveEffortDraft !== null) {+ const pinned = liveEffortDraft === FOLLOW_CHAT ? null : liveEffortDraft;+ setModelReasoningEffort(checkpointId, pinned);+ if (isLiveModel) {+ reconcilePinnedReasoningEffort({+ checkpoint: checkpointId,+ caps: reasoning,+ providerType,+ });+ }+ }+ onOpenChange(false);+ }++ return (+ <Dialog open={open} onOpenChange={onOpenChange}>+ <DialogContent className="sm:max-w-lg">+ <DialogHeader>+ <DialogTitle>{displayName} settings</DialogTitle>+ <DialogDescription>+ Model defaults. Chats with their own system prompt keep it.+ </DialogDescription>+ </DialogHeader>++ {rememberParamsPerModel ? null : (+ <p className="rounded-md border border-border/70 bg-muted/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground">+ "Remember settings per model" is off in Settings → Chat, so the+ prompt and output cap below are stored but never restored. Reasoning+ effort is kept separately and still applies.+ </p>+ )}++ <div className="flex flex-col gap-4">+ <div className="flex flex-col gap-1.5">+ <Label htmlFor="connected-model-system-prompt">System prompt</Label>+ <Textarea+ id="connected-model-system-prompt"+ value={systemPrompt}+ onChange={(event) => setPromptDraft(event.target.value)}+ rows={5}+ />+ </div>++ <div className="flex items-center justify-between gap-4">+ <Label htmlFor="connected-model-max-tokens">+ Max output tokens+ <span className="ml-1 font-normal text-muted-foreground">+ ({minCap.toLocaleString()} to {maxCap.toLocaleString()})+ </span>+ </Label>+ <Input+ id="connected-model-max-tokens"+ type="number"+ min={minCap}+ max={maxCap}+ inputMode="numeric"+ value={maxTokens}+ onChange={(event) => setCapDraft(event.target.value)}+ className="w-28"+ />+ </div>++ {efforts.length > 0 ? (+ <div className="flex items-center justify-between gap-4">+ <Label htmlFor="connected-model-effort">Reasoning effort</Label>+ <Select value={effort} onValueChange={setEffortDraft}>+ <SelectTrigger id="connected-model-effort" className="w-40">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value={FOLLOW_CHAT}>Follow chat</SelectItem>+ {efforts.map((level) => (+ <SelectItem key={level} value={level}>+ {level}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </div>+ ) : null}+ </div>++ <DialogFooter>+ <Button variant="outline" onClick={() => onOpenChange(false)}>+ Cancel+ </Button>+ <Button onClick={save}>Save</Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>+ );+}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx b/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsxindex 9cd02a756d9..991d2920107 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx@@ -14,10 +14,13 @@ export function ModelLoadSettingsAction({ariaLabel,onConfigure,className,+ tooltip = "Configure run settings before loading model",}: {ariaLabel: string;onConfigure: () => void;className?: string;+ /** Hover copy. The default describes a local load, so Connected rows override it. */+ tooltip?: string;}) {return (<Tooltip delayDuration={0}>@@ -45,7 +48,7 @@ export function ModelLoadSettingsAction({</button></TooltipTrigger><TooltipContent side="top" className="tooltip-compact">- Configure run settings before loading model+ {tooltip}</TooltipContent></Tooltip>);diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-reasoning-effort.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-reasoning-effort.tsnew file mode 100644index 00000000000..5b9f38f7769--- /dev/null+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-reasoning-effort.ts@@ -0,0 +1,101 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import { create } from "zustand";++const KEY = "unsloth_model_reasoning_effort";+const MODEL_KEY_PREFIX = `${KEY}::`;+type EffortStorage = Pick<Storage, "getItem" | "setItem" | "key" | "length">;++function browserStorage(): EffortStorage | null {+ try {+ return typeof localStorage === "undefined" ? null : localStorage;+ } catch {+ return null;+ }+}++function readEfforts(storage: EffortStorage | null): Record<string, string> {+ const efforts: Record<string, string> = {};+ if (!storage) return efforts;+ try {+ const legacy: unknown = JSON.parse(storage.getItem(KEY) ?? "{}");+ if (legacy && typeof legacy === "object" && !Array.isArray(legacy)) {+ Object.assign(+ efforts,+ Object.fromEntries(+ Object.entries(legacy).filter(+ ([, value]) => typeof value === "string" && value.length > 0,+ ),+ ),+ );+ }+ } catch {+ // A broken legacy map must not hide newer entries.+ }+ try {+ for (let index = 0; index < storage.length; index += 1) {+ const key = storage.key(index);+ if (!key?.startsWith(MODEL_KEY_PREFIX)) continue;+ const modelId = key.slice(MODEL_KEY_PREFIX.length);+ const effort = storage.getItem(key);+ if (!modelId || effort === null) continue;+ if (effort) Object.assign(efforts, { [modelId]: effort });+ else delete efforts[modelId];+ }+ } catch {+ // Keep entries already read when storage becomes unavailable.+ }+ return efforts;+}++interface ModelReasoningEffortState {+ effortByModel: Record<string, string>;+ setModelReasoningEffort: (modelId: string, effort: string | null) => void;+ syncFromStorage: () => void;+}++export function createModelReasoningEffortStore(storage: EffortStorage | null) {+ return create<ModelReasoningEffortState>((set) => ({+ effortByModel: readEfforts(storage),+ setModelReasoningEffort: (modelId, effort) =>+ set((state) => {+ if (!modelId) return state;+ const next = { ...state.effortByModel };+ if (effort) Object.assign(next, { [modelId]: effort });+ else delete next[modelId];+ try {+ // Independent writes cannot erase another model's pin.+ // Empty entries prevent a cleared legacy pin from returning.+ storage?.setItem(`${MODEL_KEY_PREFIX}${modelId}`, effort ?? "");+ } catch {+ // Keep the choice for this session.+ }+ return { effortByModel: next };+ }),+ syncFromStorage: () => set({ effortByModel: readEfforts(storage) }),+ }));+}++const storage = browserStorage();+export const useModelReasoningEffortStore = createModelReasoningEffortStore(storage);++/** Return only a pin offered by the current model. */+export function pinnedReasoningEffort(+ modelId: string | null | undefined,+ allowed: readonly string[] | null | undefined,+): string | null {+ if (!modelId) return null;+ const effort = useModelReasoningEffortStore.getState().effortByModel[modelId];+ if (!effort || (allowed && !allowed.includes(effort))) return null;+ return effort;+}++if (typeof window !== "undefined") {+ window.addEventListener("storage", (event) => {+ if (event.storageArea && event.storageArea !== storage) return;+ if (event.key === KEY || event.key === null || event.key.startsWith(MODEL_KEY_PREFIX)) {+ useModelReasoningEffortStore.getState().syncFromStorage();+ }+ });+}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx b/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsxindex c72a1d33d64..a822aadb6f2 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx@@ -40,6 +40,15 @@ import {useState,} from "react";+/** A caller-supplied entry. Rendered under the pin and above cache/update, so delete stays last. */+export interface ModelRowMenuItem {+ key: string;+ label: string;+ icon: ReactNode;+ onSelect: () => void;+ disabled?: boolean;+}+interface ModelRowMenuPin {pinned: boolean;/** Menu item labels, e.g. "Pin quant to the top" / "Unpin quant". */@@ -83,6 +92,7 @@ export function ModelRowMenu({iconClassName,cachePath,pin,+ items,update,del,}: {@@ -92,6 +102,8 @@ export function ModelRowMenu({/** Enables "Reveal in Finder" for cached repos. */cachePath?: ModelRowMenuCachePath;pin?: ModelRowMenuPin;+ /** Extra entries for actions this menu has no shape of its own for. */+ items?: readonly ModelRowMenuItem[];update?: ModelRowMenuUpdate;del?: ModelRowMenuDelete;}) {@@ -171,7 +183,7 @@ export function ModelRowMenu({});}, [cachePathRepoId, cachePathVariant]);- if (!pin && !update && !del && !cachePath) return null;+ if (!pin && !update && !del && !cachePath && !items?.length) return null;return (<>@@ -215,6 +227,19 @@ export function ModelRowMenu({<span>{pin.pinned ? pin.unpinLabel : pin.pinLabel}</span></DropdownMenuItem>)}+ {items?.map((item) => (+ <DropdownMenuItem+ key={item.key}+ disabled={item.disabled}+ onSelect={(e) => {+ e.stopPropagation();+ item.onSelect();+ }}+ >+ {item.icon}+ <span>{item.label}</span>+ </DropdownMenuItem>+ ))}{cachePath && (<DropdownMenuItemonSelect={(e) => {@@ -244,7 +269,9 @@ export function ModelRowMenu({)}{del && (<>- {(cachePath || pin || update) && <DropdownMenuSeparator />}+ {(cachePath || pin || update || items?.length) && (+ <DropdownMenuSeparator />+ )}<DropdownMenuItemvariant="destructive"disabled={del.disabled}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsxindex 060d9395749..b2e1fd04686 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx@@ -26,7 +26,11 @@ import {import {chatModelLoaded,isExternalModelId,+ modelCatalogVersion,+ parseExternalModelId,+ subscribeModelCatalog,useChatRuntimeStore,+ useExternalProvidersStore,} from "@/features/chat";import type {CachedGgufRepo,@@ -77,6 +81,7 @@ import {useModelMemory,} from "@/hooks/use-model-memory";import { useVramBudgetFraction } from "@/hooks/use-vram-budget-fraction";+import { copyToClipboard } from "@/lib/copy-to-clipboard";import { diffusionRouteSearch } from "@/lib/diffusion-route-search";import { type GgufFitClass, requiredGgufMemoryGb } from "@/lib/gguf-fit";import { extractParamLabel } from "@/lib/model-size";@@ -89,6 +94,7 @@ import {ArrowUpDownIcon,AudioWave01Icon,Cancel01Icon,+ Copy01Icon,DashboardCircleIcon,Flag01Icon,FlimSlateIcon,@@ -99,6 +105,7 @@ import {PinIcon,RemoveCircleIcon,Search01Icon,+ Settings02Icon,ViewIcon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -117,6 +124,7 @@ import {useMemo,useRef,useState,+ useSyncExternalStore,} from "react";import { useChatPickerInventory } from "../../inventory/use-chat-picker-inventory";import {@@ -137,6 +145,11 @@ import {taskForMediaPick,taskPickerRowMatches,} from "./audio-picker-policy";+import { ConnectedModelInfoDialog } from "./connected-model-info-dialog";+import {+ connectedModelMarks,+} from "./connected-model-meta";+import { ConnectedModelSettingsDialog } from "./connected-model-settings-dialog";import { FolderBrowser } from "./folder-browser";import {type ModelCapabilities,@@ -166,6 +179,7 @@ import {loadedAt,useModelLoadTimes,} from "./model-usage";+import { usePinnedConnectedModelsStore } from "./pinned-connected-models";import {makePinRank,pinKey,@@ -941,6 +955,85 @@ const ROW_ACTIONS_CLASS =// affordance, and hiding it reads as the stalled download having no controls.const ROW_ACTIONS_PINNED_CLASS = cn(ROW_ACTIONS_CLASS, "opacity-100");+// Same box and glyph size as ModelLoadSettingsAction, so a heading's buttons sit in the same+// column and hover the same size as the ones on the rows under it.+const HEADING_ACTION_CLASS =+ "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition hover:bg-black/5 hover:text-foreground dark:hover:bg-white/10";++/** A Connected group label. Wider than the On Device section labels, since nothing divides these+ * groups but the gap, and foldable the same way. */+function ConnectedGroupHeading({+ icon,+ label,+ collapsed,+ onToggle,+ onConfigure,+ configureLabel,+}: {+ icon: ReactNode;+ label: string;+ collapsed: boolean;+ onToggle: () => void;+ /** Open this group's connection. A connection belongs to the whole group, not to one row. */+ onConfigure?: () => void;+ configureLabel?: string;+}) {+ return (+ // pt-3 and gap-1.5, the values ListLabel uses for the On Device sections, so the first+ // heading sits at the same height on both tabs and its label at the same offset from its+ // icon. pt-5 started this list 8px lower than that one.+ <div className="group/heading flex items-center justify-between gap-1 px-2.5 pb-1 pt-3">+ <span className="flex min-w-0 items-center gap-1.5 text-ui-10 font-semibold uppercase tracking-wider text-muted-foreground">+ {icon}+ <span className="min-w-0 truncate">{label}</span>+ </span>+ {/* -mr-2 takes the heading's own px-2.5 down to the rows' mr-0.5, and the buttons carry the+ row gutter's box and overlap, so the chevron lands in the column each row's dots menu+ does rather than 8px inside it. */}+ <div className="-mr-2 flex shrink-0 items-center -space-x-0.5">+ {onConfigure ? (+ <Tooltip delayDuration={0}>+ <TooltipTrigger asChild={true}>+ <button+ type="button"+ onClick={onConfigure}+ aria-label={configureLabel ?? "Connection settings"}+ // Hidden until the heading is hovered, like a row's own gear. The chevron beside+ // it stays: folding is what the heading is for.+ className={cn(+ HEADING_ACTION_CLASS,+ "opacity-0 group-hover/heading:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100",+ )}+ >+ <HugeiconsIcon+ icon={Settings02Icon}+ strokeWidth={1.75}+ className="size-3"+ />+ </button>+ </TooltipTrigger>+ <TooltipContent side="bottom" className="tooltip-compact">+ {configureLabel ?? "Connection settings"}+ </TooltipContent>+ </Tooltip>+ ) : null}+ <button+ type="button"+ onClick={onToggle}+ aria-label={collapsed ? "Expand section" : "Collapse section"}+ className={HEADING_ACTION_CLASS}+ >+ {collapsed ? (+ <ChevronRightIcon className="size-3" />+ ) : (+ <ChevronDownIcon className="size-3" />+ )}+ </button>+ </div>+ </div>+ );+}+function ModelRow({label,meta,@@ -1055,6 +1148,7 @@ function ModelRow({label: parsed.formats.map((f) => f.label).join(" · "),}: null;+ const leading = formatDot ? <FormatTag {...formatDot} /> : null;// Only the selected row charts itself: a meter under every row turns a list you scan into a wall of charts.const memorySegments = useModelMemory(selected ? memory : undefined, gpuGb);@@ -1094,18 +1188,16 @@ function ModelRow({><span className="flex min-w-0 flex-1 items-baseline">{/* Fixed slot, so names start on one line with or without a dot. */}- {aligned ? (+ {/* Aligned lists hold the slot open either way, so names start on one line; an+ unaligned row only takes the space when it has something for it. */}+ {aligned || leading ? (<spanclassName={cn("mr-1 flex shrink-0 items-center self-center",META_COLUMN.format,)}>- {formatDot ? <FormatTag {...formatDot} /> : null}- </span>- ) : formatDot ? (- <span className="mr-1 flex shrink-0 items-center self-center">- <FormatTag {...formatDot} />+ {leading}</span>) : null}{showOwner ? (@@ -1294,9 +1386,13 @@ function ModelRow({return (<Tooltip delayDuration={700}><TooltipTrigger asChild={true}>{content}</TooltipTrigger>+ {/* Right, not left: this panel is docked to the model button at the window's left edge,+ so a row's own left edge is ~30px in and a tooltip opening that way ran off screen.+ Narrower with it, and breaking on words rather than anywhere: max-w-xs let a long+ connection name stretch the box to 320px, most of it slack beside the model id. */}<TooltipContent- side="left"- className="tooltip-compact max-w-xs break-all"+ side="right"+ className="tooltip-compact max-w-[15rem] break-words">{tooltipBody}</TooltipContent>@@ -2467,6 +2563,32 @@ const FORMAT_FILTER_OPTIONS: HubOption<FormatFilter>[] = (};});+// Connected has no size, download date or load history, so it sorts by what a hosted catalogue+// does offer: the connection, or the name.+type ConnectedSortKey = "provider" | "name";++const CONNECTED_SORT_OPTIONS: HubOption<ConnectedSortKey>[] = [+ { value: "provider", label: "Connection" },+ { value: "name", label: "Name" },+];++// Modality filter for Connected, mirroring the On Device format filter. The keys are the marks a+// connected row can draw, so a filter cannot ask for a badge the list has no way to show.+// No Audio: connectedModelMarks never marks a connected model as taking audio, since the+// attachment adapter refuses it under an external selection, so the option could only ever+// return an empty list.+type ConnectedModalityFilter = "all" | "vision" | "imageGen";++const CONNECTED_MODALITY_LABELS: Record<ConnectedModalityFilter, string> = {+ all: "All",+ vision: "Vision",+ imageGen: "Image gen",+};++const CONNECTED_MODALITY_OPTIONS: HubOption<ConnectedModalityFilter>[] = (+ Object.keys(CONNECTED_MODALITY_LABELS) as ConnectedModalityFilter[]+).map((value) => ({ value, label: CONNECTED_MODALITY_LABELS[value] }));+/** Sort cached repos: by last-loaded, download date, size desc, or name. */function sortCachedRepos<T extends { repo_id: string; size_bytes: number; last_modified?: number },@@ -2592,6 +2714,7 @@ export function HubModelPicker({resolveDownloadFootprint,onFoldersChange,onBrowseHub,+ onConfigureConnection,onModelsChange,onConfigure,deleteDisabled = false,@@ -2616,6 +2739,9 @@ export function HubModelPicker({resolveDownloadFootprint?: ModelDownloadFootprintResolver;onFoldersChange?: () => void;onBrowseHub?: () => void;+ /** Open one connection's own settings, for the gear on a Connected row: a model reached over+ * the wire has no local run settings, so what is configurable lives on its connection. */+ onConfigureConnection?: (providerId: string) => void;onModelsChange?: (deletedModel?: DeletedModelRef) => void;onConfigure?: (id: string, meta: ModelSelectorChangeMeta) => void;deleteDisabled?: boolean;@@ -4229,6 +4355,111 @@ export function HubModelPicker({const unpinRepo = usePinnedModelsStore((s) => s.unpinRepo);const pinnedSet = useMemo(() => new Set(pinnedIds), [pinnedIds]);+ // Connected pins keep their own list: an `external::` id carries the "::" the On Device store+ // reads as its repo/quant separator, so a pin filed there returns as a phantom quant row.+ const pinnedConnectedIds = usePinnedConnectedModelsStore((s) => s.pinned);+ const togglePinnedConnected = usePinnedConnectedModelsStore(+ (s) => s.togglePinnedConnected,+ );+ const movePinnedConnected = usePinnedConnectedModelsStore(+ (s) => s.movePinnedConnected,+ );+ const beginPinnedConnectedDrag = usePinnedConnectedModelsStore(+ (s) => s.beginPinnedConnectedDrag,+ );+ const endPinnedConnectedDrag = usePinnedConnectedModelsStore(+ (s) => s.endPinnedConnectedDrag,+ );+ // The id under the cursor mid-drag. A ref, not state: dragenter fires on every row crossed.+ const draggingPinnedConnectedRef = useRef<string | null>(null);+ const [draggingPinnedConnectedId, setDraggingPinnedConnectedId] = useState<+ string | null+ >(null);+ const pinnedConnectedSet = useMemo(+ () => new Set(pinnedConnectedIds),+ [pinnedConnectedIds],+ );+ // Connections behind those models, read for the base URL a capability check needs: a Gemini+ // connection pointed at an OpenAI-compatible proxy returns no inline images.+ const externalProviders = useExternalProvidersStore((s) => s.providers);+ const externalBaseUrlById = useMemo(+ () =>+ new Map(+ externalProviders.map((provider) => [provider.id, provider.baseUrl]),+ ),+ [externalProviders],+ );+ // A connection's own output cap, which lowers the model's documented one. The bounds the+ // per-model editor offers have to be the ones every request is clamped to.+ const externalMaxOutputById = useMemo(+ () =>+ new Map(+ externalProviders.map((provider) => [+ provider.id,+ provider.maxOutputTokens ?? null,+ ]),+ ),+ [externalProviders],+ );+ // A self-hosted OpenAI-compatible endpoint publishes no reasoning signal, so a vLLM connection+ // carries the answer itself. It is the only place that answer lives.+ const externalReasoningFlagById = useMemo(+ () =>+ new Map(+ externalProviders.map((provider) => [+ provider.id,+ provider.isReasoningModel === true,+ ]),+ ),+ [externalProviders],+ );+ // A provider catalogue arrives after first paint and decides most of the marks, so re-read it.+ const catalogVersion = useSyncExternalStore(+ subscribeModelCatalog,+ modelCatalogVersion,+ );+ const [connectedSort, setConnectedSort] =+ useState<ConnectedSortKey>("provider");+ const [connectedModality, setConnectedModality] =+ useState<ConnectedModalityFilter>("all");+ // Provider ids the user folded away, and whether the Pinned group is folded.+ const [collapsedConnectedGroups, setCollapsedConnectedGroups] = useState<+ ReadonlySet<string>+ >(() => new Set());+ const [pinnedConnectedCollapsed, setPinnedConnectedCollapsed] =+ useState(false);+ const toggleConnectedGroup = useCallback((providerId: string) => {+ setCollapsedConnectedGroups((prev) => {+ const next = new Set(prev);+ if (!next.delete(providerId)) next.add(providerId);+ return next;+ });+ }, []);+ // The row whose Model info is open.+ const [infoModel, setInfoModel] = useState<{+ model: ExternalModelOption;+ providerModelId: string;+ baseUrl: string | null;+ isReasoningProvider: boolean;+ } | null>(null);+ const [settingsModel, setSettingsModel] = useState<{+ model: ExternalModelOption;+ providerModelId: string;+ baseUrl: string | null;+ isReasoningProvider: boolean;+ connectionMaxOutputTokens: number | null;+ } | null>(null);++ // The shared helper, not navigator.clipboard: that is undefined in the desktop shell and over+ // plain HTTP on a LAN address, where reading .writeText off it throws before any catch runs.+ const copyConnectedModelId = useCallback(async (providerModelId: string) => {+ if (await copyToClipboard(providerModelId)) {+ toast.success(`Copied ${providerModelId}`);+ } else {+ toast.error("Could not copy the model ID");+ }+ }, []);+// Candidate pins whose repo still exists in the cache; per-quant validation below is needed// because deleting one variant can leave a sibling cached.const pinnedQuantCandidates = useMemo(() => {@@ -4545,9 +4776,116 @@ export function HubModelPicker({[hfIds, communitySearchIds],);+ // Query- and modality-matching connected models, pinned ones kept separate. A pin moves a row+ // into the Pinned group rather than copying it, as the On Device sections do.+ const connectedMatches = useMemo(() => {+ const needle = normalizeForSearch(debouncedQuery.trim());+ return externalModels.filter((model) => {+ if (+ needle &&+ !normalizeForSearch(+ `${model.name} ${model.providerName} ${model.id}`,+ ).includes(needle)+ ) {+ return false;+ }+ if (connectedModality === "all") return true;+ const marks = connectedModelMarks({+ providerType: model.providerType,+ modelId: parseExternalModelId(model.id)?.modelId ?? model.name,+ baseUrl: externalBaseUrlById.get(model.providerId) ?? null,+ });+ return connectedModality === "vision"+ ? marks.vision+ : marks.capabilities[connectedModality];+ });+ // The marks read module state a provider sync writes after first paint, so the version is+ // the only dep that can report the memo stale. exhaustive-deps cannot see through+ // connectedModelMarks to that read, so it calls the dep unnecessary.+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [+ externalModels,+ debouncedQuery,+ connectedModality,+ externalBaseUrlById,+ catalogVersion,+ ]);++ // Pin order, always: the sort below orders the catalogue, and a hand-arranged list is not it.+ const pinnedConnectedRows = useMemo(() => {+ const rank = makePinRank(pinnedConnectedIds);+ return connectedMatches+ .filter((model) => pinnedConnectedSet.has(model.id))+ .sort((a, b) => rank(a.id) - rank(b.id));+ }, [connectedMatches, pinnedConnectedIds, pinnedConnectedSet]);++ const connectedGroups = useMemo(() => {+ const byProvider = new Map<+ string,+ {+ providerId: string;+ providerName: string;+ providerType: string;+ models: ExternalModelOption[];+ }+ >();+ for (const model of connectedMatches) {+ if (pinnedConnectedSet.has(model.id)) continue;+ const prev = byProvider.get(model.providerId);+ if (prev) {+ prev.models.push(model);+ } else {+ byProvider.set(model.providerId, {+ providerId: model.providerId,+ providerName: model.providerName,+ providerType: model.providerType,+ models: [model],+ });+ }+ }+ const groups = [...byProvider.values()]+ .map((group) => ({+ ...group,+ models: group.models.sort((a, b) => a.name.localeCompare(b.name)),+ }))+ .sort((a, b) => a.providerName.localeCompare(b.providerName));+ if (connectedSort !== "name") return groups;+ // Sorting by name across connections is a different list, not a reordered one: the headings+ // would each hold a row or two and stop meaning anything. So one unlabelled group.+ return [+ {+ providerId: "__all__",+ providerName: "",+ providerType: "",+ models: groups+ .flatMap((group) => group.models)+ .sort((a, b) => a.name.localeCompare(b.name)),+ },+ ];+ }, [connectedMatches, pinnedConnectedSet, connectedSort]);const hubOptionKeys = useMemo(() => {const keys: string[] = [];+ // The tab lists nothing else, so these are the whole roving order, in drawn order.+ if (section === "connected") {+ if (!pinnedConnectedCollapsed) {+ keys.push(+ ...pinnedConnectedRows.map((model) =>+ makeModelOptionKey("connected", model.id),+ ),+ );+ }+ for (const group of connectedGroups) {+ if (collapsedConnectedGroups.has(group.providerId)) continue;+ keys.push(+ ...group.models.map((model) =>+ makeModelOptionKey("connected", model.id),+ ),+ );+ }+ return keys;+ }+// Pinned rows sit above the Unsloth heading on the On Device tab.if (section === "downloaded" &&@@ -4671,6 +5009,10 @@ export function HubModelPicker({chatOnly,sortedCustomFolderModels,customFoldersCollapsed,+ connectedGroups,+ pinnedConnectedRows,+ pinnedConnectedCollapsed,+ collapsedConnectedGroups,pinnedRows,pinnedCollapsed,downloadedCollapsed,@@ -5008,41 +5350,6 @@ export function HubModelPicker({/>);- const connectedGroups = useMemo(() => {- const needle = normalizeForSearch(debouncedQuery.trim());- const byProvider = new Map<- string,- {- providerId: string;- providerName: string;- providerType: string;- models: ExternalModelOption[];- }- >();- for (const model of externalModels) {- const text = normalizeForSearch(- `${model.name} ${model.providerName} ${model.id}`,- );- if (needle && !text.includes(needle)) continue;- const prev = byProvider.get(model.providerId);- if (prev) {- prev.models.push(model);- } else {- byProvider.set(model.providerId, {- providerId: model.providerId,- providerName: model.providerName,- providerType: model.providerType,- models: [model],- });- }- }- return [...byProvider.values()]- .map((group) => ({- ...group,- models: group.models.sort((a, b) => a.name.localeCompare(b.name)),- }))- .sort((a, b) => a.providerName.localeCompare(b.providerName));- }, [externalModels, debouncedQuery]);const showConnected = section === "connected";// The Connected layout uses a wider box, so it drops the search inset to keep Search Hub on the last dropdown's edge.const hasConnected = externalModels.length > 0;@@ -5067,6 +5374,187 @@ export function HubModelPicker({selected && "bg-[#ececec] dark:bg-[var(--sidebar-accent)]",);+ // One connected model, through ModelRow like every On Device row, so the badges and the hover+ // gutter are the same components rather than a second set that drifts.+ const renderConnectedModelRow = (+ model: ExternalModelOption,+ // Only pinned rows drag: the groups below are sorted, so a drop there could not be honoured.+ draggable = false,+ // No heading above this row to name its connection: the pinned group, and the flat list the+ // name sort produces. Two connections can serve one model id, so the row has to say.+ headless = false,+ ) => {+ const optionKey = makeModelOptionKey("connected", model.id);+ const isSelected = value === model.id;+ const isPinned = pinnedConnectedSet.has(model.id);+ // What the provider calls the model: `model.name` is a display label OpenRouter rewrites and+ // `model.id` is the picker's `external::` address, and no capability lookup keys on either.+ const providerModelId =+ parseExternalModelId(model.id)?.modelId ?? model.name;+ const baseUrl = externalBaseUrlById.get(model.providerId) ?? null;+ const marks = connectedModelMarks({+ providerType: model.providerType,+ modelId: providerModelId,+ baseUrl,+ });+ return (+ <div+ key={model.id}+ // ml-4 plus the pl-3.5 below is 30px, where a heading's label starts: px-2.5 + a+ // size-3.5 icon + gap-1.5. The split between them is the pill's own inset, so widening+ // it takes the pill's left edge leftward rather than moving the name off that label.+ // The reserved leading slot used to put 23.5px of empty pill in front of every name.+ className={cn(downloadedRowShellClassName(isSelected), "ml-4")}+ style={+ draggingPinnedConnectedId === model.id ? { opacity: 0.4 } : undefined+ }+ draggable={draggable}+ onDragStart={+ draggable+ ? (event) => {+ event.dataTransfer.effectAllowed = "move";+ // Firefox will not start a drag without data.+ event.dataTransfer.setData("text/plain", model.id);+ draggingPinnedConnectedRef.current = model.id;+ setDraggingPinnedConnectedId(model.id);+ // Reordering is live on dragenter; this is what a cancelled drag rolls back to.+ beginPinnedConnectedDrag();+ }+ : undefined+ }+ onDragEnd={+ draggable+ ? () => {+ draggingPinnedConnectedRef.current = null;+ setDraggingPinnedConnectedId(null);+ // Escape, or a release off-row, reaches dragend without a drop. After a drop the+ // session is already committed and cleared, so this is a no-op.+ endPinnedConnectedDrag(false);+ }+ : undefined+ }+ onDragOver={+ draggable+ ? (event) => {+ if (draggingPinnedConnectedRef.current) event.preventDefault();+ }+ : undefined+ }+ onDragEnter={+ draggable+ ? () => {+ const dragId = draggingPinnedConnectedRef.current;+ if (dragId && dragId !== model.id) {+ movePinnedConnected(dragId, model.id);+ }+ }+ : undefined+ }+ onDrop={+ draggable+ ? (event) => {+ event.preventDefault();+ draggingPinnedConnectedRef.current = null;+ setDraggingPinnedConnectedId(null);+ endPinnedConnectedDrag(true);+ }+ : undefined+ }+ >+ <div className="min-w-0 flex-1">+ <ModelRow+ label={model.name}+ // The provider's own id, the way a local row hovers its path: a label can be+ // rewritten, and one connection can offer two models that shorten to the same words.+ // With no heading above, the connection's name goes here too.+ tooltipText={+ headless ? (+ <>+ {providerModelId}+ <span className="block text-ui-10 mt-1">+ {model.providerName}+ </span>+ </>+ ) : (+ providerModelId+ )+ }+ capabilities={marks.capabilities}+ showVision={marks.vision}+ selected={isSelected}+ optionProps={hubModelList.getOptionProps(optionKey, isSelected)}+ onClick={() =>+ onSelect(model.id, { source: "external", isLora: false })+ }+ vramStatus={null}+ // The name's own inset, since nothing precedes it in the row now: the leading slot a+ // local row gives its format dot is gone with the logo that briefly filled it.+ className={cn(downloadedRowButtonClassName, "pl-3.5")}+ />+ </div>+ <span className={ROW_ACTIONS_CLASS}>+ <ModelLoadSettingsAction+ ariaLabel={`Settings for ${model.name}`}+ tooltip="Model settings"+ onConfigure={() =>+ setSettingsModel({+ model,+ providerModelId,+ baseUrl,+ isReasoningProvider:+ externalReasoningFlagById.get(model.providerId) === true,+ connectionMaxOutputTokens:+ externalMaxOutputById.get(model.providerId) ?? null,+ })+ }+ />+ <ModelRowMenu+ ariaLabel={`More options for ${model.name}`}+ pin={{+ pinned: isPinned,+ pinLabel: "Pin to top",+ unpinLabel: "Unpin",+ onToggle: () => togglePinnedConnected(model.id),+ }}+ items={[+ {+ key: "info",+ label: "Model info",+ icon: (+ <HugeiconsIcon+ icon={InformationCircleIcon}+ strokeWidth={1.75}+ className="size-icon"+ />+ ),+ onSelect: () =>+ setInfoModel({+ model,+ providerModelId,+ baseUrl,+ isReasoningProvider:+ externalReasoningFlagById.get(model.providerId) === true,+ }),+ },+ {+ key: "copy",+ label: "Copy model ID",+ icon: (+ <HugeiconsIcon+ icon={Copy01Icon}+ strokeWidth={1.75}+ className="size-icon"+ />+ ),+ onSelect: () => void copyConnectedModelId(providerModelId),+ },+ ]}+ />+ </span>+ </div>+ );+ };+// A pinned quant: repo name with the quant as a grey chip, loaded in one click.const renderPinnedQuantRow = (entry: { repoId: string; quant: string }) => {const optionKey = makeModelOptionKey(@@ -5661,7 +6149,33 @@ export function HubModelPicker({)}>{sectionToggle}- {showConnected ? null : (+ {showConnected ? (+ <div className="flex max-w-full min-w-0 flex-wrap items-center gap-2">+ <HubOptionMenu+ value={connectedModality}+ options={CONNECTED_MODALITY_OPTIONS}+ onValueChange={setConnectedModality}+ ariaLabel="Filter by modality"+ align="end"+ className={sortTriggerClassName}+ contentClassName={sortMenuContentClassName}+ />+ <HubOptionMenu+ value={connectedSort}+ options={CONNECTED_SORT_OPTIONS}+ onValueChange={setConnectedSort}+ ariaLabel="Sort connected models"+ align="end"+ className={sortTriggerClassName}+ contentClassName={sortMenuContentClassName}+ triggerContent={sortTriggerContent(+ CONNECTED_SORT_OPTIONS.find(+ (option) => option.value === connectedSort,+ )?.label ?? connectedSort,+ )}+ />+ </div>+ ) : (<div className="flex max-w-full min-w-0 flex-wrap items-center gap-2"><HubOptionMenuvalue={formatFilter}@@ -5700,47 +6214,73 @@ export function HubModelPicker({)}>{showConnected ? (- connectedGroups.length === 0 ? (+ connectedMatches.length === 0 ? (<div className="px-2.5 py-2 text-xs leading-relaxed text-muted-foreground">{externalModels.length === 0? "No models from your connections. Set up in Settings then Connections.": "No models match your search."}</div>) : (- connectedGroups.map((group) => (- <div key={group.providerId}>- {/* Wider than the On Device section labels: nothing divides these groups but the gap. */}- <div className="flex items-center gap-2 px-2.5 pb-1 pt-5 text-ui-10 font-semibold uppercase tracking-wider text-muted-foreground">- <ApiProviderLogo- providerType={group.providerType}- className="size-3.5"- title={group.providerName}+ <>+ {/* Above the first provider, on the same heading with a pin for the logo. */}+ {pinnedConnectedRows.length > 0 ? (+ <div>+ <ConnectedGroupHeading+ icon={+ <HugeiconsIcon icon={PinIcon} className="size-3.5" />+ }+ label="Pinned"+ collapsed={pinnedConnectedCollapsed}+ onToggle={() =>+ setPinnedConnectedCollapsed((value) => !value)+ }/>- <span className="min-w-0 truncate">- {group.providerName}- </span>+ {pinnedConnectedCollapsed+ ? null+ : pinnedConnectedRows.map((model) =>+ renderConnectedModelRow(model, true, true),+ )}</div>- {group.models.map((model) => (- <button- key={model.id}- type="button"- onClick={() =>- onSelect(model.id, {- source: "external",- isLora: false,- })- }- className={cn(- "flex w-full items-center rounded-md px-2.5 py-1.5 text-left text-sm transition-colors hover:bg-[#ececec] dark:hover:bg-[var(--sidebar-accent)]",- value === model.id &&- "bg-[#ececec] dark:bg-[var(--sidebar-accent)]",- )}- >- <span className="min-w-0 truncate">{model.name}</span>- </button>- ))}- </div>- ))+ ) : null}+ {connectedGroups.map((group) => {+ // The name sort collapses every connection into one unlabelled group, which+ // has no heading to fold.+ const headed = group.providerName.length > 0;+ const collapsed =+ headed && collapsedConnectedGroups.has(group.providerId);+ return (+ <div key={group.providerId}>+ {headed ? (+ <ConnectedGroupHeading+ icon={+ <ApiProviderLogo+ providerType={group.providerType}+ className="size-3.5"+ title={group.providerName}+ />+ }+ label={group.providerName}+ collapsed={collapsed}+ onToggle={() =>+ toggleConnectedGroup(group.providerId)+ }+ onConfigure={+ onConfigureConnection+ ? () => onConfigureConnection(group.providerId)+ : undefined+ }+ configureLabel={`${group.providerName} connection settings`}+ />+ ) : null}+ {collapsed+ ? null+ : group.models.map((model) =>+ renderConnectedModelRow(model, false, !headed),+ )}+ </div>+ );+ })}+ </>)) : (<>@@ -6980,6 +7520,35 @@ export function HubModelPicker({onKeepTransport={resumeUpdateConflict}onSwitchTransport={restartUpdateConflict}/>+ {settingsModel ? (+ <ConnectedModelSettingsDialog+ open={true}+ onOpenChange={(next) => {+ if (!next) setSettingsModel(null);+ }}+ checkpointId={settingsModel.model.id}+ displayName={settingsModel.model.name}+ modelId={settingsModel.providerModelId}+ providerType={settingsModel.model.providerType}+ baseUrl={settingsModel.baseUrl}+ isReasoningProvider={settingsModel.isReasoningProvider}+ connectionMaxOutputTokens={settingsModel.connectionMaxOutputTokens}+ />+ ) : null}+ {infoModel ? (+ <ConnectedModelInfoDialog+ open={true}+ onOpenChange={(next) => {+ if (!next) setInfoModel(null);+ }}+ modelId={infoModel.providerModelId}+ displayName={infoModel.model.name}+ providerName={infoModel.model.providerName}+ providerType={infoModel.model.providerType}+ baseUrl={infoModel.baseUrl}+ isReasoningProvider={infoModel.isReasoningProvider}+ />+ ) : null}</CapabilityScope.Provider>);}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/pinned-connected-models.ts b/studio/frontend/src/features/model-picker/components/model-selector/pinned-connected-models.tsnew file mode 100644index 00000000000..a83b753db09--- /dev/null+++ b/studio/frontend/src/features/model-picker/components/model-selector/pinned-connected-models.ts@@ -0,0 +1,154 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Pinned `external::<connectionId>::<modelId>` ids for the Connected list, in localStorage.+// NOT the On Device store in pinned-models.ts: an external id contains "::", which that store+// reads as its repoId/quant separator and surfaces as a phantom pinned quant on the On Device tab.++import { create } from "zustand";++const KEY = "unsloth_pinned_connected_models";++function readPinned(): string[] {+ try {+ const raw = JSON.parse(localStorage.getItem(KEY) ?? "[]");+ return Array.isArray(raw)+ ? raw.filter((v): v is string => typeof v === "string")+ : [];+ } catch {+ return [];+ }+}++/** The stored list, or null for "nothing to read". Distinct from []: a toggle falling back to []+ * would drop this window's own pins where every write has failed. */+function storedPinned(): string[] | null {+ try {+ const raw = localStorage.getItem(KEY);+ if (raw === null) return null;+ const parsed = JSON.parse(raw);+ return Array.isArray(parsed)+ ? parsed.filter((v): v is string => typeof v === "string")+ : null;+ } catch {+ return null;+ }+}++function writePinned(pinned: string[]): void {+ try {+ localStorage.setItem(KEY, JSON.stringify(pinned));+ } catch {+ // Ignore unavailable storage; pins stay session-only.+ }+}++// movePinnedConnected runs on every dragenter: writing each would make a cancelled drag permanent.+// Snapshot, move in memory, commit on drop. Mirrors pinned-models.ts.+let dragSnapshot: string[] | null = null;++// Keep remote updates for cancellation without replacing the drag's live order.+let dragExternalOrder: string[] | null = null;++function sameOrder(a: readonly string[], b: readonly string[]): boolean {+ return a.length === b.length && a.every((key, index) => key === b[index]);+}++/** A dragged order over the stored membership: this window owns row ORDER, the record owns which+ * ids are pinned, since another window's storage event may still be in flight at the drop.+ * Its additions arrive at the front; null storage leaves the order alone. */+function rebaseOnStored(order: readonly string[]): string[] {+ const stored = storedPinned();+ if (stored === null) return [...order];+ const kept = order.filter((id) => stored.includes(id));+ const added = stored.filter((id) => !order.includes(id));+ return [...added, ...kept];+}++interface PinnedConnectedModelsState {+ pinned: string[];+ /** Pin or unpin one external model id. */+ togglePinnedConnected: (modelId: string) => void;+ /**+ * Move `fromId` into `toId`'s slot. Both must already be pinned; anything else is a no-op.+ * Outside a drag session the new order persists immediately, inside one it is held until+ * `endPinnedConnectedDrag`.+ */+ movePinnedConnected: (fromId: string, toId: string) => void;+ /** Snapshot the current order so a cancelled drag can be undone. */+ beginPinnedConnectedDrag: () => void;+ /** End a drag session. `commit` persists the reordered list; otherwise the snapshot is+ * restored. Idempotent, because drop is followed by dragend and only the first may decide. */+ endPinnedConnectedDrag: (commit: boolean) => void;+}++export const usePinnedConnectedModelsStore = create<PinnedConnectedModelsState>(+ (set) => ({+ pinned: readPinned(),+ togglePinnedConnected: (modelId) =>+ set((state) => {+ // Applied to the stored list, not to this window's copy of it, since a write replaces the+ // whole list: another window's pin can be newer than the storage event this one has+ // processed, and rewriting our own array would drop it for good.+ const base = storedPinned() ?? state.pinned;+ // Newest pin first, as On Device does, so "Pin to top" literally lands on top of the+ // pinned group rather than under earlier pins.+ const next = base.includes(modelId)+ ? base.filter((id) => id !== modelId)+ : [modelId, ...base];+ writePinned(next);+ return { pinned: next };+ }),+ movePinnedConnected: (fromId, toId) =>+ set((state) => {+ const from = state.pinned.indexOf(fromId);+ const to = state.pinned.indexOf(toId);+ if (from < 0 || to < 0 || from === to) return state;+ const next = [...state.pinned];+ next.splice(to, 0, ...next.splice(from, 1));+ if (dragSnapshot === null) writePinned(next);+ return { pinned: next };+ }),+ beginPinnedConnectedDrag: () =>+ set((state) => {+ dragSnapshot = [...state.pinned];+ dragExternalOrder = null;+ return state;+ }),+ endPinnedConnectedDrag: (commit) =>+ set((state) => {+ const snapshot = dragSnapshot;+ const external = dragExternalOrder;+ dragSnapshot = null;+ dragExternalOrder = null;+ if (snapshot === null) return state;+ // Read storage too, since its event may still be pending.+ const base = storedPinned() ?? external ?? snapshot;+ if (commit && !sameOrder(snapshot, state.pinned)) {+ if (sameOrder(base, state.pinned)) return state;+ // The write replaces the whole list and nothing echoes it back to this window, so a+ // plain write of the dragged order would erase a pin another window added mid-drag+ // with no event left to restore it.+ const next = rebaseOnStored(state.pinned);+ writePinned(next);+ return sameOrder(next, state.pinned) ? state : { pinned: next };+ }+ // Cancellation and unchanged drags use the latest persisted order.+ if (sameOrder(base, state.pinned)) return state;+ return { pinned: base };+ }),+ }),+);++if (typeof window !== "undefined") {+ window.addEventListener("storage", (event) => {+ if (event.key === KEY || event.key === null) {+ const next = readPinned();+ if (dragSnapshot !== null) {+ dragExternalOrder = next;+ return;+ }+ usePinnedConnectedModelsStore.setState({ pinned: next });+ }+ });+}diff --git a/studio/frontend/src/features/model-picker/index.ts b/studio/frontend/src/features/model-picker/index.tsindex 92b2e9de242..5a4e2306c85 100644--- a/studio/frontend/src/features/model-picker/index.ts+++ b/studio/frontend/src/features/model-picker/index.ts@@ -10,6 +10,10 @@ export {pinKey,usePinnedModelsStore,} from "./components/model-selector/pinned-models";+export {+ pinnedReasoningEffort,+ useModelReasoningEffortStore,+} from "./components/model-selector/model-reasoning-effort";export {hfModelFitsDevice,loadScopedGpu,diff --git a/studio/frontend/src/features/settings/stores/settings-dialog-store.ts b/studio/frontend/src/features/settings/stores/settings-dialog-store.tsindex 539eaeec83f..46bcdf51b4b 100644--- a/studio/frontend/src/features/settings/stores/settings-dialog-store.ts+++ b/studio/frontend/src/features/settings/stores/settings-dialog-store.ts@@ -54,10 +54,16 @@ interface SettingsDialogState {// toast). DataTab uses it as its initial subpage, then clears it. See requestsFor// for how long it lives unconsumed.archivedRequested: ArchivedShelf | null;+ // Set when something asks for one connection's settings (the picker's Connected group gear).+ // ConnectionsTab hands it to the form, then clears it. Same lifetime as archivedRequested.+ connectionRequested: string | null;openDialog: (tab?: SettingsTab, options?: OpenDialogOptions) => void;openArchivedChats: () => void;openArchivedMedia: (shelf: Exclude<ArchivedShelf, "chats">) => void;+ /** Open Connections with `providerId`'s edit form already up. */+ openConnectionSettings: (providerId: string) => void;consumeArchivedChatsRequest: () => void;+ consumeConnectionRequest: () => void;consumeScrollTarget: (target: SettingsScrollTarget) => void;closeDialog: () => void;setActiveTab: (tab: SettingsTab) => void;@@ -130,6 +136,8 @@ function requestsFor(state: SettingsDialogState, tab: SettingsTab) {? state.scrollTarget: null,archivedRequested: tab === "data" ? state.archivedRequested : null,+ connectionRequested:+ tab === "connections" ? state.connectionRequested : null,};}@@ -140,6 +148,7 @@ export const useSettingsDialogStore = create<SettingsDialogState>((set) => ({opener: null,openerFallback: null,archivedRequested: null,+ connectionRequested: null,openDialog: (tab, options) =>set((state) => {const next = tab ?? state.activeTab;@@ -150,6 +159,7 @@ export const useSettingsDialogStore = create<SettingsDialogState>((set) => ({// A caller that names a target replaces whatever was still pending.scrollTarget: options?.scrollTarget ?? pending.scrollTarget,archivedRequested: pending.archivedRequested,+ connectionRequested: pending.connectionRequested,...focusForOpen(state, options?.focusFallback),};}),@@ -159,6 +169,7 @@ export const useSettingsDialogStore = create<SettingsDialogState>((set) => ({activeTab: "data",scrollTarget: null,archivedRequested: "chats",+ connectionRequested: null,...focusForOpen(state),})),openArchivedMedia: (shelf) =>@@ -167,9 +178,20 @@ export const useSettingsDialogStore = create<SettingsDialogState>((set) => ({activeTab: "data",scrollTarget: null,archivedRequested: shelf,+ connectionRequested: null,+ ...focusForOpen(state),+ })),+ openConnectionSettings: (providerId) =>+ set((state) => ({+ open: true,+ activeTab: "connections",+ scrollTarget: null,+ archivedRequested: null,+ connectionRequested: providerId,...focusForOpen(state),})),consumeArchivedChatsRequest: () => set({ archivedRequested: null }),+ consumeConnectionRequest: () => set({ connectionRequested: null }),consumeScrollTarget: (target) =>set((state) => ({scrollTarget: state.scrollTarget === target ? null : state.scrollTarget,@@ -178,7 +200,12 @@ export const useSettingsDialogStore = create<SettingsDialogState>((set) => ({// pass after `open: false` lands, so the opener must still be readable// from the store at that point. The next openDialog() overwrites it.closeDialog: () =>- set({ open: false, scrollTarget: null, archivedRequested: null }),+ set({+ open: false,+ scrollTarget: null,+ archivedRequested: null,+ connectionRequested: null,+ }),setActiveTab: (tab) => {try {window.localStorage.setItem(ACTIVE_TAB_KEY, tab);diff --git a/studio/frontend/src/features/settings/tabs/connections-tab.tsx b/studio/frontend/src/features/settings/tabs/connections-tab.tsxindex a8b8b598664..a056a0e109d 100644--- a/studio/frontend/src/features/settings/tabs/connections-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/connections-tab.tsx@@ -3,15 +3,25 @@import { ChatProvidersSettings } from "@/features/chat/chat-providers-dialog";import { useExternalProvidersStore } from "@/features/chat/stores/external-providers-store";+import { useSettingsDialogStore } from "../stores/settings-dialog-store";export function ConnectionsTab() {const providers = useExternalProvidersStore((s) => s.providers);const setProviders = useExternalProvidersStore((s) => s.setProviders);+ // Set when the picker's Connected group gear asked for one connection by name.+ const connectionRequested = useSettingsDialogStore(+ (s) => s.connectionRequested,+ );+ const consumeConnectionRequest = useSettingsDialogStore(+ (s) => s.consumeConnectionRequest,+ );return (<ChatProvidersSettingsproviders={providers}onProvidersChange={setProviders}+ openProviderId={connectionRequested}+ onOpenProviderConsumed={consumeConnectionRequest}/>);}diff --git a/studio/frontend/tests/connected-model-row-actions.test.ts b/studio/frontend/tests/connected-model-row-actions.test.tsnew file mode 100644index 00000000000..5764615f3dd--- /dev/null+++ b/studio/frontend/tests/connected-model-row-actions.test.ts@@ -0,0 +1,813 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Connected rows used to be a name and nothing else, while every On Device row carried modality+// badges, a pin and a gear. These pin the parts that closed that gap, and the one boundary it+// must not be closed across: the two pin lists stay apart.++import assert from "node:assert/strict";+import test from "node:test";++import { readSrc } from "./helpers/kit.ts";++const pickers = readSrc(+ "features/model-picker/components/model-selector/pickers.tsx",+);+const marks = readSrc(+ "features/model-picker/components/model-selector/connected-model-meta.ts",+);+const connectedPins = readSrc(+ "features/model-picker/components/model-selector/pinned-connected-models.ts",+);+const onDevicePins = readSrc(+ "features/model-picker/components/model-selector/pinned-models.ts",+);+const selector = readSrc("features/model-picker/components/model-selector.tsx");+const settingsStore = readSrc(+ "features/settings/stores/settings-dialog-store.ts",+);+const connectionsTab = readSrc("features/settings/tabs/connections-tab.tsx");+const providersDialog = readSrc("features/chat/chat-providers-dialog.tsx");++test("a connected row draws its badges through ModelRow", () => {+ // The same component the On Device rows use, so the glyph set cannot drift into a second one.+ assert.match(+ pickers,+ /const renderConnectedModelRow = \(\s*model: ExternalModelOption,/,+ );+ assert.match(+ pickers,+ /capabilities=\{marks\.capabilities\}\s*\n\s*showVision=\{marks\.vision\}/,+ );+ // No format-dot slot: nothing precedes a connected name, and an empty one left the hover pill+ // starting 23.5px in front of it. The row's own pl-3.5 is the name's inset instead.+ assert.doesNotMatch(pickers, /reserveLeadingSlot/);+ // The connection is named by the group heading, so it is not repeated on each of its rows.+ assert.doesNotMatch(pickers, /leadingBadge=\{\s*<ApiProviderLogo/);+ // Both groups render through it. Only the pinned one drags: the groups below are sorted, so a+ // drop there could not be honoured.+ assert.match(+ pickers,+ /pinnedConnectedRows\.map\(\(model\) =>\s*renderConnectedModelRow\(model, true, true\)/,+ );+ assert.match(+ pickers,+ /group\.models\.map\(\(model\) =>\s*renderConnectedModelRow\(model, false, !headed\)/,+ );+});++test("capabilities are keyed by the provider's own model id", () => {+ // `model.id` is the external:: address and `model.name` a label OpenRouter rewrites, so a+ // lookup on either misses every catalogue entry.+ assert.match(+ pickers,+ /parseExternalModelId\(model\.id\)\?\.modelId \?\? model\.name/,+ );+ assert.match(+ pickers,+ /connectedModelMarks\(\{\s*providerType: model\.providerType,\s*modelId: providerModelId,\s*baseUrl,/,+ );+ // A catalogue lands after first paint, so the marks have to be re-read when it does.+ assert.match(+ pickers,+ /useSyncExternalStore\(\s*subscribeModelCatalog,\s*modelCatalogVersion,?\s*\)/,+ );+});++test("modality comes from the resolvers the app already has", () => {+ assert.match(+ marks,+ /providerModelSupportsVision\(providerType, modelId\) === true/,+ );+ assert.match(marks, /providerSupportsBuiltinImageGeneration\(/);+ // Video generation is never claimed on a connected row: no provider publishes a capability for+ // it and nothing we connect to serves it through the chat route, so the name would be the only+ // evidence, and the glyph would promise a row something selecting it cannot do.+ assert.match(marks, /videoGen: false,/);+ // Nor is any other mark guessed from the name. Image generation is enabled in the adapter+ // through providerSupportsBuiltinImageGeneration alone, and the composer's Images pill with it,+ // so a name that reads like a diffusion model but resolves to false there can never be asked+ // for one.+ assert.doesNotMatch(marks, /byName/);+ assert.doesNotMatch(marks, /detectCapabilities/);+ assert.match(+ marks,+ /imageGen: providerSupportsBuiltinImageGeneration\(\s*providerType,\s*modelId,\s*baseUrl,\s*\),/,+ );+ // Audio is withheld even where a catalogue publishes it as an input modality: the attachment+ // adapter resolves the active model out of `models`, which carries loaded local models only, so+ // an external selection has no row there and `add` rejects every audio file it is given.+ assert.match(marks, /audio: false,/);+ assert.doesNotMatch(marks, /includes\("audio"\)/);+ const audioAdapter = readSrc("features/chat/audio-attachment-adapter.ts");+ assert.match(+ audioAdapter,+ /const activeModel = state\.models\.find\(\(m\) => m\.id === checkpoint\);/,+ );+ assert.match(audioAdapter, /\} else if \(!activeModel\?\.hasAudioInput\) \{/);+ // So the filter drops its Audio option rather than offering one that matches nothing.+ assert.match(+ pickers,+ /type ConnectedModalityFilter = "all" \| "vision" \| "imageGen";/,+ );+ // Unknown is not a promise: only an explicit true draws the eye.+ assert.doesNotMatch(+ marks,+ /vision: providerModelSupportsVision\([^)]*\) \?\?/,+ );+});++test("connected pins are a separate list from the On Device ones", () => {+ assert.match(connectedPins, /"unsloth_pinned_connected_models"/);+ assert.match(onDevicePins, /"unsloth_pinned_models"/);+ // An external id carries "::", which this reads as the repo/quant separator, so a pin filed in+ // the On Device store comes back out as a phantom pinned quant on that tab.+ assert.match(onDevicePins, /const sep = key\.indexOf\("::"\)/);+ assert.doesNotMatch(connectedPins, /"unsloth_pinned_models"/);+ // So a connected row reaches for its own toggle and never the On Device one.+ assert.doesNotMatch(pickers, /togglePinned\(model\.id\)/);+ assert.doesNotMatch(pickers, /pinKey\(model\.id\)/);+ assert.match(pickers, /onToggle: \(\) => togglePinnedConnected\(model\.id\)/);+ // A toggle applies its one change to the STORED list. The write replaces the whole list, so two+ // windows pinning different models before the storage event lands would otherwise keep only the+ // second pin. Null, not [], when there is nothing to read: a toggle on an install whose writes+ // all fail has to keep the session's own pins rather than drop them.+ assert.match(+ connectedPins,+ /const base = storedPinned\(\) \?\? state\.pinned;/,+ );+ assert.match(+ connectedPins,+ /const raw = localStorage\.getItem\(KEY\);\s*if \(raw === null\) return null;/,+ );+ // A drag commit rebases too, for the same reason and one more: nothing echoes this window's own+ // write back to it, so a pin another window added mid-drag would be erased with no event left+ // to restore it. The dragged order is this window's; which ids are pinned is the record's.+ assert.match(+ connectedPins,+ /const next = rebaseOnStored\(state\.pinned\);\s*writePinned\(next\);/,+ );+ assert.match(+ connectedPins,+ /const kept = order\.filter\(\(id\) => stored\.includes\(id\)\);\s*const added = stored\.filter\(\(id\) => !order\.includes\(id\)\);\s*return \[\.\.\.added, \.\.\.kept\];/,+ );+});++test("a pin moves the row out of its provider group", () => {+ // Copying it instead would list the model twice under one search.+ assert.match(+ pickers,+ /for \(const model of connectedMatches\) \{\s*if \(pinnedConnectedSet\.has\(model\.id\)\) continue;/,+ );+ assert.match(+ pickers,+ /connectedMatches\s*\.filter\(\(model\) => pinnedConnectedSet\.has\(model\.id\)\)/,+ );+});++test("connected rows join the keyboard order", () => {+ assert.match(+ pickers,+ /if \(section === "connected"\) \{\s*if \(!pinnedConnectedCollapsed\) \{\s*keys\.push\(\s*\.\.\.pinnedConnectedRows\.map/,+ );+ // A folded group's rows leave the order too, or the arrows walk through rows off screen.+ assert.match(+ pickers,+ /if \(collapsedConnectedGroups\.has\(group\.providerId\)\) continue;/,+ );+});++test("nothing on a connected row opens local run settings", () => {+ // ModelConfigPage holds KV cache dtype and GPU layers, which a remote model has none of.+ assert.doesNotMatch(+ pickers,+ /onConfigure\(model\.id, \{\s*source: "external"/,+ );+ assert.match(+ selector,+ /function handleConfigureConnection\(providerId: string\) \{\s*setOpen\(false\);\s*useSettingsDialogStore\.getState\(\)\.openConnectionSettings\(providerId\);/,+ );+});++test("the connection request is one-shot and tab-scoped", () => {+ assert.match(+ settingsStore,+ /connectionRequested:\s*\n?\s*tab === "connections" \? state\.connectionRequested : null/,+ );+ // Closing the dialog drops it, or it replays on the next visit.+ assert.match(+ settingsStore,+ /closeDialog: \(\) =>\s*set\(\{[^}]*connectionRequested: null,/,+ );+ assert.match(connectionsTab, /openProviderId=\{connectionRequested\}/);+ assert.match(+ connectionsTab,+ /onOpenProviderConsumed=\{consumeConnectionRequest\}/,+ );+});++test("the deep link waits for the provider and fires once", () => {+ // Cached providers must not seed the form before the first backend sync.+ assert.match(providersDialog, /\[providersReady, setProvidersReady\] = useState\(false\)/);+ assert.match(providersDialog, /onProvidersChange\(syncedProviders\);\s*setProvidersReady\(true\);/);+ assert.match(providersDialog, /if \(!providersReady\) return;/);+ // Ready either way: a failed sync leaves the hydrated list as all there is, and waiting on a+ // success the backend may never give would leave the gear opening nothing offline.+ assert.match(+ providersDialog,+ /toast\.error\(`Failed to load connections: \$\{message\}`\);\s*\}\s*(\/\/[^\n]*\n\s*)*if \(isMounted\) setProvidersReady\(true\);/,+ );+ assert.match(providersDialog, /\[openProviderId, providers, providersReady, onOpenProviderConsumed\]/);+ assert.match(providersDialog, /if \(!provider\) return;/);+ assert.match(+ providersDialog,+ /openedProviderRef\.current = openProviderId;\s*void editProvider\(provider\);\s*onOpenProviderConsumed\?\.\(\);/,+ );+ // The empty-list auto-open latch stays set, as tests/connections-empty-opens-form.test.ts asks.+ assert.doesNotMatch(+ providersDialog,+ /autoOpenedAddFormRef\.current = false;/,+ );+});++test("the row menu carries the connected actions", () => {+ for (const label of ["Model info", "Copy model ID"]) {+ assert.match(pickers, new RegExp(`label: "${label}"`));+ }+ // Through the shared helper, which handles the desktop shell and falls back to execCommand.+ // navigator.clipboard is undefined there and over plain HTTP on a LAN address, and reading+ // .writeText off it throws where no catch on the promise can report it.+ assert.match(+ pickers,+ /if \(await copyToClipboard\(providerModelId\)\) \{\s*toast\.success/,+ );+ assert.doesNotMatch(pickers, /navigator\.clipboard\s*\n?\s*\.?writeText/);+ // The picked model already carries into a new chat, so a default-for-new-chats pin said nothing.+ assert.doesNotMatch(pickers, /Use by default in new chats/);+ // Unticking a model belongs to the connection form, which owns that list.+ assert.doesNotMatch(pickers, /Hide from this list/);+ // The connection belongs to the heading's gear, not to a row's menu: the row menu is about the+ // model, and a second way in said nothing the gear above it did not.+ assert.doesNotMatch(pickers, /label: "Connection settings",/);+ assert.doesNotMatch(+ pickers,+ /onSelect: \(\) => onConfigureConnection\(model\.providerId\),/,+ );+});++test("the name sort flattens the list without dropping a model", () => {+ // Every heading goes, and a connection whose every model is pinned loses its group entirely,+ // so both paths have to list from the matches rather than from the groups.+ assert.match(pickers, /if \(connectedSort !== "name"\) return groups;/);+ assert.match(+ pickers,+ /for \(const model of connectedMatches\) \{\s*if \(pinnedConnectedSet\.has\(model\.id\)\) continue;/,+ );+ // Such a row says which connection it came from through its logo and tooltip, pinned above.+ // Its settings are the heading gear's, or Settings then Connections where no heading is left.+ assert.doesNotMatch(pickers, /headless && onConfigureConnection/);+});++test("the connection's own settings hang off the group heading", () => {+ // Beside the fold chevron, in the heading's own right-hand cluster.+ assert.match(+ pickers,+ /<div className="-mr-2 flex shrink-0 items-center -space-x-0\.5">\s*\{onConfigure \?/,+ );+ // Hover-only, as a row's gear is, while the chevron beside it stays on screen.+ assert.match(+ pickers,+ /HEADING_ACTION_CLASS,\s*"opacity-0 group-hover\/heading:opacity-100/,+ );+ assert.match(pickers, /className=\{HEADING_ACTION_CLASS\}\s*>\s*\{collapsed \?/);+ // The same box and glyph the row gutter's buttons use, so the columns line up.+ assert.match(+ pickers,+ /const HEADING_ACTION_CLASS =\s*"flex size-5 shrink-0 items-center justify-center rounded-md/,+ );+ assert.match(+ pickers,+ /aria-label=\{configureLabel \?\? "Connection settings"\}/,+ );+ assert.match(+ pickers,+ /onConfigure=\{\s*onConfigureConnection\s*\? \(\) => onConfigureConnection\(group\.providerId\)/,+ );+ // Named, since a picker can hold several connections.+ assert.match(+ pickers,+ /configureLabel=\{`\$\{group\.providerName\} connection settings`\}/,+ );+ // The Pinned group spans connections, so there is no single one for its heading to open.+ assert.match(+ pickers,+ /label="Pinned"\s*collapsed=\{pinnedConnectedCollapsed\}\s*onToggle=\{\(\) =>\s*setPinnedConnectedCollapsed/,+ );+});++test("the gear opens the model's own settings", () => {+ // Not a menu entry as well: the gutter already holds a settings button.+ assert.match(+ pickers,+ /tooltip="Model settings"\s*onConfigure=\{\(\) =>\s*setSettingsModel\(\{/,+ );+ assert.doesNotMatch(pickers, /label: "Model settings/);+});++test("the connected sort and modality filter drive the list", () => {+ assert.match(pickers, /CONNECTED_SORT_OPTIONS/);+ assert.match(pickers, /CONNECTED_MODALITY_OPTIONS/);+ // Sorting by name flattens the provider groups rather than leaving headings of one row each.+ assert.match(pickers, /if \(connectedSort !== "name"\) return groups;/);+});++test("per-model prompt and cap reuse the memory Chat already keeps", () => {+ const settingsDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-settings-dialog.tsx",+ );+ // Not a second store: the editor writes into paramsByModel, which rememberParamsPerModel has+ // been restoring per checkpoint all along.+ assert.match(settingsDialog, /setRememberedParamsForModel\(checkpointId, \{/);+ assert.doesNotMatch(settingsDialog, /localStorage/);+ // Only the fields the user touched: this is a patch, and an untouched one would put whatever+ // the dialog happened to be showing over the stored value. null is untouched, so an untouched+ // field keeps reading the store even when hydration lands while the dialog is open.+ assert.match(settingsDialog, /const systemPrompt = promptDraft \?\? remembered\?\.systemPrompt \?\? "";/);+ // And a touched one is checked against the ladder as it stands at Save, since the catalogue+ // subscription can withdraw a level while the dialog is open: a draft the model no longer+ // offers reverts to what is stored rather than being written as a pin every resolver refuses.+ assert.match(+ settingsDialog,+ /const liveEffortDraft =\s*effortDraft !== null && \(effortDraft === FOLLOW_CHAT \|\| offered\(effortDraft\)\)\s*\? effortDraft\s*: null;/,+ );+ assert.match(+ settingsDialog,+ /const effort =\s*liveEffortDraft \?\?\s*\(pinnedEffort && offered\(pinnedEffort\) \? pinnedEffort : FOLLOW_CHAT\);/,+ );+ // And the save is the only place a pin is read for display: the info box does not print one,+ // so a withdrawn level has nowhere left to be claimed as applying.+ assert.doesNotMatch(+ readSrc(+ "features/model-picker/components/model-selector/connected-model-info-dialog.tsx",+ ),+ /pinnedEffort/,+ );+ assert.match(+ settingsDialog,+ /\.\.\.\(promptDraft !== null \? \{ systemPrompt: promptDraft \} : \{\}\),/,+ );+ // An untouched effort writes nothing: another tab can change the pin while this is open, and a+ // save of an unrelated field would put the value the select opened with back over it, and reset+ // the composer's own Think level while it was at it.+ assert.match(+ settingsDialog,+ /if \(liveEffortDraft !== null\) \{\s*const pinned = liveEffortDraft === FOLLOW_CHAT \? null : liveEffortDraft;\s*setModelReasoningEffort\(checkpointId, pinned\);/,+ );+ // Which is the listener that makes that reachable.+ const effortStore = readSrc(+ "features/model-picker/components/model-selector/model-reasoning-effort.ts",+ );+ assert.match(+ effortStore,+ /window\.addEventListener\("storage", \(event\) => \{/,+ );+ // And the chat subscribes to the active model's pin for the same reason: the normalization+ // reads it through a getState helper, so a cross-tab change reached the dialog but not the+ // composer. Its own effect, since rerunning that whole block would reset the pills too.+ const chatPage = readSrc("features/chat/chat-page.tsx");+ assert.match(+ chatPage,+ /const activePinnedEffort = useModelReasoningEffortStore\(\s*\(state\) => state\.effortByModel\[inferenceParams\.checkpoint\],/,+ );+ assert.match(+ chatPage,+ /if \(appliedPinnedEffort\.current === activePinnedEffort\) return;/,+ );+ // One reconciler for every trigger that can dislodge the pin, the catalogue included: a refresh+ // decides which levels a stored pin is legal against, so it can make an ignored pin the valid+ // one, and the pin effect's own guard sees no change in the stored string.+ assert.match(+ chatPage,+ /reconcilePinnedReasoningEffort\(\{\s*checkpoint: inferenceParams\.checkpoint,\s*caps,\s*providerType: provider\?\.providerType,\s*\}\);\s*\}, \[activePinnedEffort,/,+ );+ assert.match(+ chatPage,+ /reasoningFieldsAfterCatalogRefresh\(useChatRuntimeStore\.getState\(\), caps\),\s*\);[\s\S]{0,220}?reconcilePinnedReasoningEffort\(\{/,+ );+ // Whether the level came from a pin is asked of the store, never inferred from the trigger:+ // absence is a clear for the pin effect but not for a refresh, and it is a clear the user can+ // also cause from the composer, where resolving afresh would undo the level just chosen.+ assert.match(readSrc("features/chat/stores/chat-runtime-store.ts"), /if \(!pinned && !pinHoldsLiveEffort\(\)\) return;/);+ // Switching to an unpinned model resolves from the chat's own level, not from the outgoing+ // model's pin, which is what the live value holds.+ assert.match(+ chatPage,+ /current:\s*!pinnedEffort && pinHoldsLiveEffort\(\)\s*\? \(takeEffortDisplacedByPin\(\) \?\? store\.reasoningEffort\)\s*: store\.reasoningEffort,/,+ );+ assert.match(+ chatPage,+ /current:\s*!pinnedEffort && pinHoldsLiveEffort\(\)\s*\? \(takeEffortDisplacedByPin\(\) \?\? state\.reasoningEffort\)\s*: state\.reasoningEffort,/,+ );+ // A pin in force owns the live level outright, whether or not it displaced anything when it+ // was applied: pinning the level already in the store recorded nothing, and the thread opened+ // next had its own level held back behind that pin with no record to hand back.+ assert.match(+ readSrc("features/chat/stores/chat-runtime-store.ts"),+ /export function pinHoldsLiveEffort\(\): boolean \{\s*return \(\s*pinOwnsLiveReasoningEffort\(useChatRuntimeStore\.getState\(\)\) \|\|\s*effortDisplacedByPin !== null\s*\);/,+ );+ // And the chat's own level is recorded as the snapshot is held back, so the pin can be handed+ // back the level of the chat that is open now rather than the one before it.+ assert.match(+ readSrc("features/chat/stores/chat-runtime-store.ts"),+ /if \(key === "reasoningEffort" && pinOwnsLiveReasoningEffort\(state\)\) \{[\s\S]{0,500}?effortDisplacedByPin = value as ReasoningEffort;/,+ );+ // Leaving a pinned model for a local one hands the chat's level to the clamp, which narrows it+ // to the local model's ladder and would otherwise carry the pin's level onto that model. Taken+ // where the model has actually become resident, never where one was picked: picking an uncached+ // model only queues a download, and the load can still abort at a lease, a confirmation or a+ // token prompt without the model ever changing.+ const localLoad = readSrc("features/chat/hooks/use-chat-model-runtime.ts");+ assert.match(+ localLoad,+ /const existingReasoningEffort =\s*\(pinHoldsLiveEffort\(\) \? takeEffortDisplacedByPin\(\) : null\) \?\?\s*useChatRuntimeStore\.getState\(\)\.reasoningEffort;/,+ );+ const statusApply = readSrc("features/chat/lib/apply-inference-status-to-store.ts");+ assert.match(+ statusApply,+ /const effortToClamp =\s*\(pinHoldsLiveEffort\(\) \? takeEffortDisplacedByPin\(\) : null\) \?\?\s*prevState\.reasoningEffort;/,+ );+ // Both clamps read the one value, so neither can keep clamping the pin's.+ assert.match(+ statusApply,+ /\? clampReasoningEffortToLevels\(effortToClamp, reasoningEffortLevels\)\s*: clampLocalReasoningEffort\(effortToClamp\);/,+ );+ // And the pick itself takes nothing, so an abort leaves the pin applied with nothing to undo.+ assert.doesNotMatch(chatPage, /takeEffortDisplacedByPin\(\) : null/);+ // A number field accepts scientific notation and parseInt stops at the "e", so 1e5 was read as+ // 1 and saved clamped to the provider minimum.+ assert.match(+ settingsDialog,+ /const typedCap = Math\.round\(Number\(maxTokens\.trim\(\)\)\);/,+ );+ assert.doesNotMatch(settingsDialog, /Number\.parseInt\(/);+ // The effort control is offered only where a level is actually sent. The default low/medium/high+ // ladder is there even for a style that carries a bare thinking on/off, so gating on+ // supportsReasoning alone let a pin be set on Kimi that no request could ever carry.+ assert.match(+ settingsDialog,+ /const efforts = externalReasoningTakesEffort\(reasoning\)\s*\? reasoning\.reasoningEffortLevels\.filter\(\(level\) => level !== "none"\)\s*: \[\];/,+ );+ const capabilities = readSrc("features/chat/provider-capabilities.ts");+ assert.match(+ capabilities,+ /export function externalReasoningTakesEffort\([\s\S]{0,120}?return caps\.supportsReasoning && caps\.reasoningStyle === "reasoning_effort";/,+ );+ // And nothing resolves a level for such a model, or selecting it would move the level every+ // other model runs at on the strength of a setting it never sends.+ assert.match(+ capabilities,+ /if \(!externalReasoningTakesEffort\(caps\)\) return current;/,+ );+ // The info box stops listing the ladder for them too: the levels are empty unless a level is+ // what the style sends, so a bare thinking switch reports "Supported" instead of a ladder of+ // rungs it never takes.+ const infoDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-info-dialog.tsx",+ );+ assert.match(+ infoDialog,+ /const takesEffort = externalReasoningTakesEffort\(reasoning\);/,+ );+ assert.match(+ infoDialog,+ /const effortLevels = takesEffort\s*\? reasoning\.reasoningEffortLevels\.filter\(\(level\) => level !== "none"\)\s*: \[\];/,+ );+ // Blank or junk is an absence, not a zero the request would then send as the cap.+ assert.match(+ settingsDialog,+ /capDraft !== null && Number\.isFinite\(typedCap\) && typedCap > 0\s*\? \{ maxTokens: clampCap\(typedCap\) \}\s*: \{\}/,+ );+ // And it says so when the setting that restores them is switched off.+ assert.match(settingsDialog, /"Remember settings per model" is off/);+ // No example prompt: a placeholder reads as a value that is already set.+ assert.doesNotMatch(settingsDialog, /placeholder=/);+ // The cap field always holds a number. A blank would have to mean "forget the cap", and+ // neither merge can express that: the patch merges per key and the server deep-merges the+ // settings row, so an omitted key keeps the old value and the clear goes nowhere.+ assert.match(+ settingsDialog,+ /capDraft \?\? String\(clampCap\(remembered\?\.maxTokens \?\? chatMaxTokens\)\)/,+ );+ assert.doesNotMatch(settingsDialog, /blank follows the connection/);+});++test("the cap offers the bounds every request is clamped to", () => {+ const settingsDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-settings-dialog.tsx",+ );+ const adapter = readSrc("features/chat/api/chat-adapter.ts");+ const sheet = readSrc("features/chat/chat-settings-sheet.tsx");+ // The same two helpers the chat's own Max Tokens control bounds itself with, and the adapter+ // clamps every outbound request to, so a stored cap cannot differ from the one actually sent.+ assert.match(sheet, /getExternalMaxOutputTokens\(/);+ assert.match(adapter, /getExternalMinOutputTokens\(externalProvider\?\.providerType\),/);+ assert.match(+ settingsDialog,+ /const minCap = getExternalMinOutputTokens\(providerType\);/,+ );+ assert.match(+ settingsDialog,+ /const maxCap = getExternalMaxOutputTokens\(\s*providerType,\s*modelId,\s*connectionMaxOutputTokens,\s*\)/,+ );+ // Clamped on save, not just hinted by the input's attributes.+ assert.match(+ settingsDialog,+ /const clampCap = \(value: number\) =>\s*Math\.min\(Math\.max\(value, minCap\), maxCap\);/,+ );+ // The connection's own cap lowers the model's documented one, so it has to reach the editor.+ assert.match(+ pickers,+ /provider\.maxOutputTokens \?\? null,/,+ );+ // And an OpenRouter cap arrives with the live catalogue, after this has rendered.+ assert.match(+ settingsDialog,+ /useSyncExternalStore\(subscribeModelCatalog, modelCatalogVersion\);/,+ );+});++test("live effort edits use the shared runtime action", () => {+ const dialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-settings-dialog.tsx",+ );+ assert.match(dialog, /reconcilePinnedReasoningEffort\(\{/);+ assert.doesNotMatch(dialog, /useChatRuntimeStore\.setState/);+ assert.doesNotMatch(dialog, /state\.setReasoningEffort/);+});++test("a row with no heading over it still names its connection", () => {+ // Pinned rows and the name-sorted flat list have no provider heading, and two connections can+ // serve one model id, so the tooltip carries the connection name those rows have nowhere else.+ assert.match(pickers, /renderConnectedModelRow\(model, true, true\)/);+ assert.match(pickers, /renderConnectedModelRow\(model, false, !headed\)/);+ assert.match(pickers, /<span className="block text-ui-10 mt-1">\s*\{model\.providerName\}/);+ // No logo in the leading slot: down the pinned group it read as a second glyph column, and a+ // row is there to carry its name. So nothing goes in the slot at all now.+ assert.doesNotMatch(pickers, /leadingSlot/);+ assert.match(+ pickers,+ /const leading = formatDot \? <FormatTag \{\.\.\.formatDot\} \/> : null;/,+ );+ // The tooltip opens to the right. This panel is docked at the window's left edge, so a row's+ // own left edge is ~30px in and a tooltip opening that way ran off screen.+ assert.match(+ pickers,+ /<TooltipContent\s*side="right"\s*className="tooltip-compact max-w-\[15rem\] break-words"/,+ );+});++test("the store write merges per key and reaches the live params", () => {+ const runtime = readSrc("features/chat/stores/chat-runtime-store.ts");+ assert.match(+ runtime,+ /saveSettingsPatch\(\{ inferenceParamsByModel: \{ \[modelId\]: patch \} \}\)/,+ );+ // Editing the model that is loaded has to land now, not on the next switch back.+ assert.match(runtime, /const live = state\.params\.checkpoint === modelId;/);+ // A save while the initial settings request is still out has to survive it, so the write is not+ // gated on hydration: the patch can only set the keys it names and the server merges per key.+ assert.match(+ runtime,+ /\/\/ \/api\/chat\/settings request was out\.\s*saveSettingsPatch\(/,+ );+ // Held as a patch, not a row. locallyRememberedModels is overlaid wholesale, which would+ // replace the server's entry with one naming only the keys the dialog touched and drop that+ // model's temperature, top-p and seed.+ assert.match(+ runtime,+ /if \(!state\.settingsHydrated\) \{\s*modelParamEditsBeforeHydration\.set\(modelId, \{/,+ );+ assert.match(+ runtime,+ /for \(const \[modelId, patch\] of modelParamEditsBeforeHydration\) \{\s*hydrated\[modelId\] = \{ \.\.\.hydrated\[modelId\], \.\.\.patch \};/,+ );+ // Complete once merged, so a later response takes the wholesale overlay.+ assert.match(+ runtime,+ /locallyRememberedModels\.add\(modelId\);\s*\}\s*modelParamEditsBeforeHydration\.clear\(\);/,+ );+ // And the live keys are fenced the way a slider edit fences its own, or the response in flight+ // puts the global set back over them.+ assert.match(+ runtime,+ /if \(liveChanged\) getChangedInferenceParams\(liveParams, state\.params\);/,+ );+ // systemPrompt is one of the chat's own keys, so the live overlay goes through the restore a+ // switch uses: the open chat outranks the model it is running, and writing past that would+ // send the model's prompt for the rest of the chat and store it as the chat's own next.+ assert.match(+ runtime,+ /const liveParams = live\s*\? restoreThreadScopedParams\(\{ \.\.\.state\.params, \.\.\.patch \}\)\s*: null;/,+ );+ // The epoch as setParams advances it: a queued prompt or a paste still reading its file+ // captured the old prompt and cap, and nothing else would tell it they had moved.+ assert.match(+ runtime,+ /const liveChanged =\s*liveParams !== null &&\s*shouldAdvanceQueuedSettingsEpoch\(state\.params, liveParams\);/,+ );+ assert.match(+ runtime,+ /liveChanged\s*\? \{\s*params: liveParams,\s*queuedSettingsEpoch: state\.queuedSettingsEpoch \+ 1,/,+ );+});++test("a pinned reasoning effort wins, unless the catalogue withdrew it", () => {+ const effort = readSrc(+ "features/model-picker/components/model-selector/model-reasoning-effort.ts",+ );+ // Asking for a level the provider rejects fails the request, so an unavailable pin falls back.+ assert.match(+ effort,+ /if \(!effort \|\| \(allowed && !allowed\.includes\(effort\)\)\) return null;/,+ );+ const caps = readSrc("features/chat/provider-capabilities.ts");+ // Ahead of the catalogue and the per-provider defaults: the user set this one deliberately.+ assert.match(+ caps,+ /if \(pinned && levels\.includes\(pinned as ReasoningEffortLevel\)\) \{\s*return pinned as ReasoningEffortLevel;/,+ );+ assert.match(+ caps,+ /if \(caps\.defaultEffort && levels\.includes\(caps\.defaultEffort\)\) \{/,+ );+ // One resolver for every caller, so a reload and a resync cannot answer differently from a+ // switch. The pin used to be read by the switch alone.+ const chatPage = readSrc("features/chat/chat-page.tsx");+ assert.match(+ chatPage,+ /externalReasoningTakesEffort\(reasoningCaps\)\s*\? pinnedReasoningEffort\(value, effortLevels\)/,+ );+ assert.match(+ chatPage,+ /externalReasoningTakesEffort\(reasoningCaps\)\s*\? pinnedReasoningEffort\(inferenceParams\.checkpoint, effortLevels\)/,+ );+ // Both record the level the pin takes the place of, so clearing it can put that back.+ assert.match(+ chatPage,+ /if \(pinnedEffort && nextReasoningEffort !== store\.reasoningEffort\) \{\s*noteEffortDisplacedByPin\(store\.reasoningEffort\);/,+ );+ assert.match(+ chatPage,+ /if \(pinnedEffort && nextReasoningEffort !== state\.reasoningEffort\) \{\s*noteEffortDisplacedByPin\(state\.reasoningEffort\);/,+ );+ // The normalization effect reruns on reload and on every provider resync, and it is the one+ // that used to put the provider default back over the pin.+ assert.match(+ chatPage,+ /\}, \[externalProvidersForChat, inferenceParams\.checkpoint, settingsHydrated\]\);/,+ );+ assert.doesNotMatch(chatPage, /const anthropicTopEffort =/);+});++test("the info box is a dialog, so it is wide enough and closable", () => {+ const infoDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-info-dialog.tsx",+ );+ // AlertDialog caps at max-w-md and asks a question; this reports, and needs Dialog's close X.+ assert.match(infoDialog, /<DialogContent className="sm:max-w-xl">/);+ assert.doesNotMatch(infoDialog, /AlertDialog/);+ // An id has no spaces to wrap at, so break-words would let it run past the edge.+ assert.match(infoDialog, /className="break-all font-mono"/);+ // It reports the model, not the settings. The gear beside it edits those three fields and shows+ // what they hold, so repeating them here was a second, read-only copy of that dialog.+ assert.doesNotMatch(infoDialog, /own settings/);+ assert.doesNotMatch(infoDialog, /paramsByModel/);+ assert.doesNotMatch(infoDialog, /model-reasoning-effort/);+ // So it needs no id to key those memories on either.+ assert.doesNotMatch(infoDialog, /checkpointId/);+ assert.doesNotMatch(pickers, /checkpointId=\{infoModel\.model\.id\}/);+});++test("a row's name starts where its heading's label does", () => {+ // ml-4 plus pl-3.5 is 30px, which is the heading's px-2.5 + a size-3.5 icon + gap-1.5: where+ // its label starts. The two have to keep summing to 30, since the second of them is the pill's+ // own inset: widening it moves the pill's left edge, not the name off that label. 14px of pill+ // now precedes the name, against the 23.5px the reserved leading slot used to leave empty.+ assert.match(+ pickers,+ /cn\(downloadedRowShellClassName\(isSelected\), "ml-4"\)/,+ );+ assert.match(+ pickers,+ /className=\{cn\(downloadedRowButtonClassName, "pl-3\.5"\)\}/,+ );+ // Nothing precedes the name in the row, so the slot itself goes: an empty one is what put the+ // pill's left edge that far from the name.+ assert.doesNotMatch(pickers, /reserveLeadingSlot=\{true\}/);+ // And the heading matches ListLabel, which is what the On Device sections use, so the first+ // one sits at the same height on both tabs with its label the same distance from its icon.+ assert.match(+ pickers,+ /group\/heading flex items-center justify-between gap-1 px-2\.5 pb-1 pt-3/,+ );+ assert.match(+ pickers,+ /<span className="flex min-w-0 items-center gap-1\.5 text-ui-10 font-semibold/,+ );+ const listLabel = /className=\{cn\(\s*"flex items-center justify-between gap-1 px-2\.5 pb-1",\s*divider \? "mt-3 border-t border-border\/50 pt-3" : "pt-3",/;+ assert.match(pickers, listLabel);+ assert.match(+ pickers,+ /<span className="flex items-center gap-1\.5 text-ui-10 font-semibold/,+ );+});++test("reasoning is read through the resolver the composer uses", () => {+ const infoDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-info-dialog.tsx",+ );+ const settingsDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-settings-dialog.tsx",+ );+ // Reading the catalogue directly reported every Codex model as unpublished while the composer+ // had it thinking: `openai_codex` is not a namespace models.dev publishes.+ for (const source of [infoDialog, settingsDialog]) {+ assert.match(+ source,+ /getExternalReasoningCapabilities\(providerType, modelId, \{\s*isReasoningProvider,\s*baseUrl,\s*\}\)/,+ );+ // "none" is the off switch, not a level on offer.+ assert.match(source, /\(level\) => level !== "none"/);+ }+ assert.doesNotMatch(settingsDialog, /entry\?\.reasoning \? entry\.efforts/);+ // And a self-hosted endpoint's only reasoning signal is the flag on its connection.+ assert.match(pickers, /provider\.isReasoningModel === true,/);+});++test("a Codex connection resolves against OpenAI's catalogue", async () => {+ // Behaviour rather than the shape of the alias table: a null entry is what the info panel+ // renders as "Not published", which is the whole symptom, and the alias is applied at the+ // snapshot lookup so every caller of it inherits this.+ const { resolveModelCatalogEntry } = await import("../src/features/chat/model-catalog.ts");+ const viaOpenAI = resolveModelCatalogEntry("openai", "gpt-4-turbo");+ assert.ok(viaOpenAI !== null, "the fixture model must be in the bundled snapshot");+ assert.deepEqual(resolveModelCatalogEntry("openai_codex", "gpt-4-turbo"), viaOpenAI);+});++test("the published context window reaches the row and the info box", () => {+ const catalog = readSrc("features/chat/model-catalog.ts");+ const snapshot = readSrc("features/chat/model-catalog-snapshot.ts");+ const infoDialog = readSrc(+ "features/model-picker/components/model-selector/connected-model-info-dialog.tsx",+ );+ assert.match(snapshot, /context\?: number;/);+ // models.dev publishes it on the snapshot only, so a live entry backfills from there rather+ // than reporting a model that has one as having none.+ assert.match(+ catalog,+ /if \(entry\.contextLength != null \|\| !snapshot\) return entry;/,+ );+ assert.match(+ catalog,+ /\.find\(\(context\) => typeof context === "number" && context > 0\)/,+ );+ // The info box alone, with the exact count. No chip on the row: the name is what a row is for,+ // and a window on every one of them read as noise rather than as the figure to compare.+ assert.doesNotMatch(pickers, /ctx`\]/);+ assert.doesNotMatch(marks, /formatContextLength/);+ assert.doesNotMatch(marks, /contextLength/);+ assert.match(infoDialog, /<Field label="Context window">/);+ assert.match(infoDialog, /tokens\(entry\.contextLength\)/);+});++test("a served catalogue cannot take away a context window it has no field for", async () => {+ // Behaviour, not source text. A regex over these two files passes just as happily with the+ // line present in code that never runs, and fails on a rename that changes nothing; the point+ // is what a user reads in the info panel, so drive the resolver and read the window back.+ const { resolveModelCatalogEntry, setModelsDevCatalog } = await import(+ "../src/features/chat/model-catalog.ts"+ );+ const bundled = resolveModelCatalogEntry("openai", "gpt-4-turbo")?.contextLength;+ assert.ok(+ typeof bundled === "number" && bundled > 0,+ "the bundled snapshot must publish a window for this model, else the rest proves nothing",+ );++ // A served entry that carries one wins, as it does for every other field.+ setModelsDevCatalog({+ fetched_at: Date.now(),+ providers: { openai: { "gpt-4-turbo": { input: ["text"], context: 999_999 } } },+ } as never);+ assert.equal(resolveModelCatalogEntry("openai", "gpt-4-turbo")?.contextLength, 999_999);++ // THE CASE: a backend older than the field, or its cached payload inside the day-long TTL,+ // serves the model with no context at all. Before the rescue this replaced the bundled entry+ // wholesale and every model models.dev covers read as publishing no window.+ setModelsDevCatalog({+ fetched_at: Date.now(),+ providers: { openai: { "gpt-4-turbo": { input: ["text"] } } },+ } as never);+ assert.equal(resolveModelCatalogEntry("openai", "gpt-4-turbo")?.contextLength, bundled);++ setModelsDevCatalog({ fetched_at: Date.now(), providers: {} } as never);+});diff --git a/studio/frontend/tests/helpers/kit.ts b/studio/frontend/tests/helpers/kit.tsindex cee4fba2376..ce64025d8be 100644--- a/studio/frontend/tests/helpers/kit.ts+++ b/studio/frontend/tests/helpers/kit.ts@@ -53,11 +53,13 @@ export type StorageFake = {*/export function installLocalStorageFake(): {store: Map<string, string>;- storage: StorageFake;+ storage: StorageFake & Pick<Storage, "length" | "key">;fireWindowEvent: (type: string, event: unknown) => number;} {const store = new Map<string, string>();- const storage: StorageFake = {+ const storage: StorageFake & Pick<Storage, "length" | "key"> = {+ get length() { return store.size; },+ key: (index) => [...store.keys()][index] ?? null,getItem: (key: string) => store.get(key) ?? null,setItem: (key: string, value: string) => {store.set(key, value);diff --git a/studio/frontend/tests/model-reasoning-preferences.test.ts b/studio/frontend/tests/model-reasoning-preferences.test.tsnew file mode 100644index 00000000000..164c58e7dc0--- /dev/null+++ b/studio/frontend/tests/model-reasoning-preferences.test.ts@@ -0,0 +1,306 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import assert from "node:assert/strict";+import { register } from "node:module";+import test from "node:test";+import type { ExternalReasoningCapabilities } from "../src/features/chat/provider-capabilities.ts";+import { installLocalStorageFake } from "./helpers/kit.ts";++const { store: storageData, storage, fireWindowEvent } = installLocalStorageFake();+register("./thread-sampling-resolver.mjs", import.meta.url);+const { settingsHttp } = await import("./helpers/store-stubs/settings-http.ts");+const { threadRows } = await import("./helpers/store-stubs/chat-history-storage.ts");+const {+ createModelReasoningEffortStore,+ useModelReasoningEffortStore,+ pinnedReasoningEffort,+} = await import("../src/features/model-picker/components/model-selector/model-reasoning-effort.ts");+const { resolveExternalReasoningEffort } = await import("../src/features/chat/provider-capabilities.ts");++const KEY = "unsloth_model_reasoning_effort";+const MODEL = "external::review::reasoning-model";+const THREAD = "review-thread";+const CAPS: ExternalReasoningCapabilities = {+ supportsReasoning: true,+ reasoningStyle: "reasoning_effort",+ reasoningAlwaysOn: false,+ supportsReasoningOff: true,+ reasoningEffortLevels: ["low", "medium", "high"],+};+type RuntimeModule = typeof import("../src/features/chat/stores/chat-runtime-store.ts");+const runtimeUrl = new URL("../src/features/chat/stores/chat-runtime-store.ts", import.meta.url).href;++async function boot(scenario: string, paired: boolean | null = true): Promise<RuntimeModule> {+ storageData.clear();+ storageData.set("unsloth_chat_settings_imported_to_studio_db", "true");+ useModelReasoningEffortStore.getState().syncFromStorage();+ settingsHttp.settings = { rememberParamsPerModel: false, reasoningEffort: "medium" };+ settingsHttp.puts.length = 0;+ threadRows.reset();+ const runtime = await import(`${runtimeUrl}?scenario=${scenario}`) as RuntimeModule;+ const store = runtime.useChatRuntimeStore;+ await store.getState().hydratePersistedSettings();+ store.getState().setCheckpoint(MODEL, null);+ store.setState({ ...CAPS, reasoningEffort: "medium" });+ if (paired !== null) store.getState().setActiveThreadId(THREAD);+ if (paired) store.getState().applyThreadScopedSettings(THREAD, { reasoningEffort: "medium" });+ else if (paired === false) runtime.beginThreadScopedPairing(THREAD);+ settingsHttp.puts.length = 0;+ return runtime;+}++function remotePin(runtime: RuntimeModule, effort: string | null): void {+ createModelReasoningEffortStore(storage).getState().setModelReasoningEffort(MODEL, effort);+ fireWindowEvent("storage", { key: `${KEY}::${MODEL}`, storageArea: storage });+ runtime.reconcilePinnedReasoningEffort({ checkpoint: MODEL, caps: CAPS, providerType: "openai" });+}++test("independent pin edits survive delayed storage events", () => {+ storageData.clear();+ const a = createModelReasoningEffortStore(storage);+ const b = createModelReasoningEffortStore(storage);+ a.getState().setModelReasoningEffort("model-a", "low");+ b.getState().setModelReasoningEffort("model-b", "high");+ a.getState().syncFromStorage();+ b.getState().syncFromStorage();+ const expected = { "model-a": "low", "model-b": "high" };+ assert.deepEqual(a.getState().effortByModel, expected);+ assert.deepEqual(b.getState().effortByModel, expected);+ assert.deepEqual(createModelReasoningEffortStore(storage).getState().effortByModel, expected);+});++test("clearing an unrelated pin does not erase a delayed edit", () => {+ storageData.clear();+ storageData.set(KEY, JSON.stringify({ "model-b": "medium" }));+ const a = createModelReasoningEffortStore(storage);+ const b = createModelReasoningEffortStore(storage);+ a.getState().setModelReasoningEffort("model-a", "high");+ b.getState().setModelReasoningEffort("model-b", null);+ assert.deepEqual(createModelReasoningEffortStore(storage).getState().effortByModel, { "model-a": "high" });+});++test("legacy pins load without writes and cleared pins cannot return", () => {+ storageData.clear();+ const legacy = JSON.stringify({ a: "low", b: "medium" });+ storageData.set(KEY, legacy);+ const a = createModelReasoningEffortStore(storage);+ assert.equal(storageData.size, 1);+ assert.deepEqual(a.getState().effortByModel, { a: "low", b: "medium" });+ a.getState().setModelReasoningEffort("a", null);+ const b = createModelReasoningEffortStore(storage);+ assert.deepEqual(b.getState().effortByModel, { b: "medium" });+ b.getState().setModelReasoningEffort("b", "high");+ assert.equal(storageData.get(KEY), legacy);+ assert.deepEqual(createModelReasoningEffortStore(storage).getState().effortByModel, { b: "high" });+});++test("same-model edits use the last persisted write", () => {+ storageData.clear();+ const a = createModelReasoningEffortStore(storage);+ const b = createModelReasoningEffortStore(storage);+ a.getState().setModelReasoningEffort("a", "low");+ b.getState().setModelReasoningEffort("a", "high");+ a.getState().syncFromStorage();+ assert.equal(a.getState().effortByModel.a, "high");+ a.getState().setModelReasoningEffort("a", null);+ b.getState().syncFromStorage();+ assert.deepEqual(b.getState().effortByModel, {});+});++test("malformed legacy storage does not hide newer pins", () => {+ storageData.clear();+ storageData.set(KEY, "invalid json");+ storageData.set(`${KEY}::a`, "high");+ assert.deepEqual(createModelReasoningEffortStore(storage).getState().effortByModel, { a: "high" });+});++test("unavailable storage keeps edits in memory", () => {+ const store = createModelReasoningEffortStore(null);+ store.getState().setModelReasoningEffort("a", "low");+ assert.equal(store.getState().effortByModel.a, "low");+});++test("an empty offered ladder rejects stored pins", () => {+ useModelReasoningEffortStore.setState({ effortByModel: { a: "high" } });+ assert.equal(pinnedReasoningEffort("a", []), null);+ assert.equal(pinnedReasoningEffort("a", ["high"]), "high");+});++test("restoration preserves a valid chat preference without changing selection defaults", () => {+ for (const [providerType, expected] of [["openai", "high"], ["anthropic", "high"], ["gemini", "medium"]]) {+ assert.equal(resolveExternalReasoningEffort({ caps: CAPS, providerType, current: "low" }), expected);+ assert.equal(resolveExternalReasoningEffort({ caps: CAPS, providerType, current: "low", restore: true }), "low");+ assert.equal(resolveExternalReasoningEffort({ caps: { ...CAPS, defaultEffort: "high" }, providerType, current: "low", restore: true }), "low");+ }+});++test("restoration clamps unavailable levels and ignores toggle-only pins", () => {+ assert.equal(resolveExternalReasoningEffort({ caps: { ...CAPS, reasoningEffortLevels: ["low", "high"] }, providerType: "openai", current: "medium", restore: true }), "low");+ assert.equal(resolveExternalReasoningEffort({ caps: { ...CAPS, reasoningStyle: "enable_thinking" }, providerType: "openai", current: "low", pinned: "high", restore: true }), "low");+});++test("a pin arriving during the debounce does not become the thread preference", async (t) => {+ const runtime = await boot("pending-edit");+ const store = runtime.useChatRuntimeStore;+ t.mock.timers.enable({ apis: ["setTimeout"] });+ store.getState().setReasoningEffort("low");+ t.mock.timers.tick(100);+ remotePin(runtime, "high");+ assert.equal(store.getState().reasoningEffort, "high");+ t.mock.timers.tick(300);+ await runtime.awaitStartedThreadScopedSettingsWrites();+ assert.equal(threadRows.rows.get(THREAD)?.reasoningEffort, "low");+ assert.equal(store.getState().reasoningEffort, "high");+ assert.equal(settingsHttp.puts.some((patch) => "reasoningEffort" in patch), false);+});++test("an ordinary pending edit persists without a pin", async (t) => {+ const runtime = await boot("ordinary-edit");+ t.mock.timers.enable({ apis: ["setTimeout"] });+ runtime.useChatRuntimeStore.getState().setReasoningEffort("low");+ t.mock.timers.tick(400);+ await runtime.awaitStartedThreadScopedSettingsWrites();+ assert.equal(threadRows.rows.get(THREAD)?.reasoningEffort, "low");+});++test("clearing a pin before the debounce restores the pending preference", async (t) => {+ const runtime = await boot("clear-before-save");+ const store = runtime.useChatRuntimeStore;+ t.mock.timers.enable({ apis: ["setTimeout"] });+ store.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "low");+ t.mock.timers.tick(400);+ await runtime.awaitStartedThreadScopedSettingsWrites();+ assert.equal(threadRows.rows.get(THREAD)?.reasoningEffort, "low");+});++test("reconciliation advances the queue epoch only when effort changes", async () => {+ const runtime = await boot("queue-epoch");+ const store = runtime.useChatRuntimeStore;+ const initial = store.getState().queuedSettingsEpoch;+ remotePin(runtime, "high");+ assert.equal(store.getState().queuedSettingsEpoch, initial + 1);+ remotePin(runtime, "high");+ assert.equal(store.getState().queuedSettingsEpoch, initial + 1);+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "medium");+ assert.equal(store.getState().queuedSettingsEpoch, initial + 2);+});++test("an incoming thread keeps its own effort beneath an existing pin", async () => {+ const runtime = await boot("switch-thread");+ const store = runtime.useChatRuntimeStore;+ remotePin(runtime, "high");+ store.getState().setActiveThreadId("other-thread");+ store.getState().applyThreadScopedSettings("other-thread", { reasoningEffort: "low" });+ assert.equal(store.getState().reasoningEffort, "high");+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "low");+});++test("held effort edits survive a pin arriving before pairing completes", async (t) => {+ const runtime = await boot("held-edit", false);+ const store = runtime.useChatRuntimeStore;+ t.mock.timers.enable({ apis: ["setTimeout"] });+ store.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ store.getState().applyThreadScopedSettings(THREAD, { reasoningEffort: "medium" });+ t.mock.timers.tick(400);+ await runtime.awaitStartedThreadScopedSettingsWrites();+ assert.equal(threadRows.rows.get(THREAD)?.reasoningEffort, "low");+ assert.equal(store.getState().reasoningEffort, "high");+ store.getState().setActiveThreadId(null);+ store.getState().applyThreadScopedSettings(null, null);+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "medium");+});++test("leaving mid-pairing persists the requested effort rather than the pin", async () => {+ const runtime = await boot("held-leave", false);+ runtime.useChatRuntimeStore.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ runtime.useChatRuntimeStore.getState().setActiveThreadId("other-thread");+ await runtime.commitHeldThreadScopedEditsToTheirThread();+ assert.equal(threadRows.rows.get(THREAD)?.reasoningEffort, "low");+});++test("a capability downgrade releases an effort pin", async () => {+ const runtime = await boot("toggle-only");+ const store = runtime.useChatRuntimeStore;+ remotePin(runtime, "high");+ const caps = { ...CAPS, reasoningStyle: "enable_thinking" as const };+ store.setState(caps);+ runtime.reconcilePinnedReasoningEffort({ checkpoint: MODEL, caps, providerType: "openai" });+ assert.equal(store.getState().reasoningEffort, "medium");+ assert.equal(runtime.pinHoldsLiveEffort(), false);+});++test("a global effort edit survives pinning after leaving a saved chat", async () => {+ const runtime = await boot("global-after-thread");+ const store = runtime.useChatRuntimeStore;+ store.getState().setActiveThreadId(null);+ store.getState().applyThreadScopedSettings(null, null);+ store.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "low");+});++test("reselecting a pinned level preserves the unsent chat's preference", async () => {+ const runtime = await boot("reselect-pin", null);+ const store = runtime.useChatRuntimeStore;+ store.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ store.getState().setReasoningEffort("high");+ assert.equal(pinnedReasoningEffort(MODEL, CAPS.reasoningEffortLevels), "high");+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "low");+ assert.equal(runtime.pinHoldsLiveEffort(), false);+});++test("choosing a different effort clears the pin and keeps the new preference", async () => {+ const runtime = await boot("replace-pin", null);+ const store = runtime.useChatRuntimeStore;+ remotePin(runtime, "high");+ store.getState().setReasoningEffort("low");+ assert.equal(pinnedReasoningEffort(MODEL, CAPS.reasoningEffortLevels), null);+ remotePin(runtime, null);+ assert.equal(store.getState().reasoningEffort, "low");+ assert.equal(runtime.pinHoldsLiveEffort(), false);+});++test("eject restores effort before a snapshotless chat captures its defaults", async () => {+ const runtime = await boot("eject-unsent", null);+ const store = runtime.useChatRuntimeStore;+ store.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ store.getState().clearCheckpoint();+ assert.equal(store.getState().params.checkpoint, "");+ assert.equal(store.getState().reasoningEffort, "low");+ assert.equal(runtime.pinHoldsLiveEffort(), false);+ assert.equal(pinnedReasoningEffort(MODEL, CAPS.reasoningEffortLevels), "high");+ runtime.beginThreadScopedPairing(THREAD);+ store.getState().applyThreadScopedSettings(null, null);+ store.getState().setActiveThreadId(THREAD);+ store.getState().applyThreadScopedSettings(THREAD, null);+ assert.equal(runtime.threadScopedOverride("reasoningEffort"), "low");+ store.getState().clearCheckpoint();+ assert.equal(store.getState().reasoningEffort, "low");+});++test("eject restores the active thread's effort without persisting the pin", async (t) => {+ const runtime = await boot("eject-thread");+ const store = runtime.useChatRuntimeStore;+ t.mock.timers.enable({ apis: ["setTimeout"] });+ store.getState().setReasoningEffort("low");+ remotePin(runtime, "high");+ store.getState().clearCheckpoint();+ assert.equal(store.getState().reasoningEffort, "low");+ t.mock.timers.tick(400);+ await runtime.awaitStartedThreadScopedSettingsWrites();+ assert.equal(threadRows.rows.get(THREAD)?.reasoningEffort, "low");+ assert.equal(settingsHttp.puts.some((patch) => "reasoningEffort" in patch), false);+});diff --git a/studio/frontend/tests/pinned-connected-models-reorder.test.ts b/studio/frontend/tests/pinned-connected-models-reorder.test.tsnew file mode 100644index 00000000000..53a26d549da--- /dev/null+++ b/studio/frontend/tests/pinned-connected-models-reorder.test.ts@@ -0,0 +1,93 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++import assert from "node:assert/strict";+import test from "node:test";+import { installLocalStorageFake } from "./helpers/kit.ts";++const { store: storage, fireWindowEvent } = installLocalStorageFake();+const { usePinnedConnectedModelsStore: pins } = await import(+ "../src/features/model-picker/components/model-selector/pinned-connected-models.ts"+);+const KEY = "unsloth_pinned_connected_models";+const [A, B, C, D] = ["a", "b", "c", "d"].map((id) => `external::connection::${id}`);++function reset(order = [A, B]) {+ pins.getState().endPinnedConnectedDrag(false);+ storage.clear();+ storage.set(KEY, JSON.stringify(order));+ pins.setState({ pinned: order });+}++function externalWrite(order: string[], notify = true) {+ storage.set(KEY, JSON.stringify(order));+ if (notify) assert.equal(fireWindowEvent("storage", { key: KEY }), 1);+}++function storedOrder(): string[] {+ return JSON.parse(storage.get(KEY)!);+}++function drag() {+ pins.getState().beginPinnedConnectedDrag();+ pins.getState().movePinnedConnected(A, B);+}++test("ordinary drags persist only on drop", () => {+ reset();+ drag();+ assert.deepEqual(pins.getState().pinned, [B, A]);+ assert.deepEqual(storedOrder(), [A, B]);+ pins.getState().endPinnedConnectedDrag(true);+ pins.getState().endPinnedConnectedDrag(false);+ assert.deepEqual(storedOrder(), [B, A]);+ assert.deepEqual(pins.getState().pinned, [B, A]);+});++for (const notify of [true, false]) {+ test(`drop keeps the dragged order and remote additions, storage event=${notify}`, () => {+ reset();+ drag();+ externalWrite([C, A, B], notify);+ assert.deepEqual(pins.getState().pinned, [B, A]);+ pins.getState().endPinnedConnectedDrag(true);+ assert.deepEqual(pins.getState().pinned, [C, B, A]);+ assert.deepEqual(storedOrder(), [C, B, A]);+ });+}++test("drop respects remote removals and the latest additions", () => {+ reset([A, B, C]);+ drag();+ externalWrite([D, A, B, C]);+ externalWrite([D, A, B]);+ pins.getState().endPinnedConnectedDrag(true);+ assert.deepEqual(pins.getState().pinned, [D, B, A]);+ assert.deepEqual(storedOrder(), [D, B, A]);+});++for (const notify of [true, false]) {+ test(`cancel adopts remote changes without persisting the drag, storage event=${notify}`, () => {+ reset();+ drag();+ externalWrite([C, A], notify);+ pins.getState().endPinnedConnectedDrag(false);+ assert.deepEqual(pins.getState().pinned, [C, A]);+ assert.deepEqual(storedOrder(), [C, A]);+ });+}++test("a drag without a move adopts the remote order", () => {+ reset([A, B, C]);+ pins.getState().beginPinnedConnectedDrag();+ externalWrite([C, B, A]);+ pins.getState().endPinnedConnectedDrag(true);+ assert.deepEqual(pins.getState().pinned, [C, B, A]);+ assert.deepEqual(storedOrder(), [C, B, A]);+});++test("storage events outside a drag apply immediately", () => {+ reset();+ externalWrite([C, A]);+ assert.deepEqual(pins.getState().pinned, [C, A]);+});diff --git a/tests/studio/studiobench/scene/actions.py b/tests/studio/studiobench/scene/actions.pyindex c69cbfe8003..cd1d8e5fd3c 100644--- a/tests/studio/studiobench/scene/actions.py+++ b/tests/studio/studiobench/scene/actions.py@@ -1075,14 +1075,7 @@ def settings(ctx: ActionContext) -> ActionResult:@register_action(name = "model_change", default_budget_ms = 10000)def model_change(ctx: ActionContext) -> ActionResult:- """Open the model picker and select a row.-- THE WEAKEST SELECTOR IN THE SUITE, and it is recorded as such rather than hidden. The picker's- option rows are plain `<button>` elements with utility classes: no `role="option"`, no- `data-model-id`, no CommandItem, nothing stable anywhere in features/model-picker. So the row- is found by position among the menu's buttons and the assertion is on the trigger's LABEL- changing, which is an observable consequence rather than a selector.- """+ """Open the model picker and select a row marked with data-model-picker-option."""trigger = ctx.page.query_selector("button.unsloth-model-selector-trigger")if trigger is None:return not_run("no model selector trigger on the page")@@ -1129,7 +1122,7 @@ def model_change(ctx: ActionContext) -> ActionResult:"label_before": before,"label_after": after,"menu_closed": closed,- "selector_confidence": "low: the option rows carry no stable attribute",+ "selector_confidence": "high: data-model-picker-option identifies selectable rows",},timings = {"open_ms": round(opened_ms, 1), "select_ms": round(select_ms, 1)},reason = None if ok else "no option could be selected, or the menu stayed open",diff --git a/tests/studio/studiobench/scene/dom.js b/tests/studio/studiobench/scene/dom.jsindex 3f41be6aa5a..1a092451a38 100644--- a/tests/studio/studiobench/scene/dom.js+++ b/tests/studio/studiobench/scene/dom.js@@ -331,9 +331,7 @@},modelOptions() {const menu = D.modelMenu();- // No role="option", no data-model-id: the rows are plain buttons with utility classes, so- // this is the only available handle and it is recorded as the weak point it is.- return menu ? qa("button", menu) : [];+ return menu ? qa("button[data-model-picker-option]", menu) : [];},currentModelLabel() {const t = D.modelTrigger();diff --git a/tests/studio/studiobench/scene/selftest/test_studiobench_model_options.py b/tests/studio/studiobench/scene/selftest/test_studiobench_model_options.pynew file mode 100644index 00000000000..97bfa01c9d0--- /dev/null+++ b/tests/studio/studiobench/scene/selftest/test_studiobench_model_options.py@@ -0,0 +1,54 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++"""Model selection excludes connection settings and row action buttons."""++import shutil+import subprocess+from pathlib import Path++import pytest+++def test_model_options_only_returns_selectable_rows():+ node = shutil.which("node")+ if node is None:+ pytest.skip("node is not installed")+ dom_js = Path(__file__).resolve().parents[1] / "dom.js"+ script = r"""+const assert = require("node:assert/strict");+const fs = require("node:fs");+const vm = require("node:vm");+const buttons = [+ { label: "Connections", option: false },+ { label: "Model A", option: true },+ { label: "Model settings", option: false },+ { label: "Model B", option: true },+];+let menuOpen = true;+const menu = {+ querySelectorAll(selector) {+ if (selector === "button") return buttons;+ if (selector === "button[data-model-picker-option]") {+ return buttons.filter((button) => button.option);+ }+ throw new Error(`Unexpected selector: ${selector}`);+ },+};+const context = {+ setInterval() {},+ window: { addEventListener() {} },+ document: {+ querySelector(selector) {+ assert.equal(selector, ".unsloth-model-selector-menu");+ return menuOpen ? menu : null;+ },+ },+};+vm.runInNewContext(fs.readFileSync(process.argv[1], "utf8"), context);+const options = context.window.__sb.dom.modelOptions();+assert.deepEqual(Array.from(options, (button) => button.label), ["Model A", "Model B"]);+menuOpen = false;+assert.equal(context.window.__sb.dom.modelOptions().length, 0);+"""+ subprocess.run([node, "-e", script, str(dom_js)], check = True, timeout = 10)