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: combine OpenCode Console and Go into one connection (#16482)
Nilayd6ca61ae0cb3
diff --git a/studio/backend/core/inference/providers.py b/studio/backend/core/inference/providers.pyindex d94624bb89b..2d053d2f655 100644--- a/studio/backend/core/inference/providers.py+++ b/studio/backend/core/inference/providers.py@@ -300,9 +300,9 @@ PROVIDER_REGISTRY: dict[str, dict[str, Any]] = {# Fixed at 1 / 0.95 server-side (https://platform.minimax.io/docs/api-reference/text-openai-api)."body_omit": ("temperature", "top_p", "presence_penalty"),},- # Zen is pay as you go, Go a subscription; both translate every text model to /chat/completions.+ # Console is pay as you go, Go a subscription; both translate every text model to /chat/completions."opencode": {- "display_name": "OpenCode Zen",+ "display_name": "OpenCode Console","base_url": "https://opencode.ai/inference/v1","default_models": ["kimi-k3",diff --git a/studio/frontend/src/features/chat/chat-providers-dialog.tsx b/studio/frontend/src/features/chat/chat-providers-dialog.tsxindex 2100541332d..e91a53c40af 100644--- a/studio/frontend/src/features/chat/chat-providers-dialog.tsx+++ b/studio/frontend/src/features/chat/chat-providers-dialog.tsx@@ -88,7 +88,10 @@ import {PROVIDER_MAX_OUTPUT_TOKENS_MIN,connectionApiFields,getExternalProviderApiKey,+ connectionPickerValue,isCustomProviderType,+ isOpenCodeProviderType,+ OPENCODE_PLANS,isDecisionConnection,LEGACY_CUSTOM_PROVIDER_TYPE,CUSTOM_PROVIDER_DISPLAY_NAME,@@ -119,7 +122,7 @@ const PROVIDER_FORM_EASE: [number, number, number, number] = [const PROVIDER_FORM_DURATION = 0.2;const CUSTOM_PROVIDER_MISSING_KEY_MESSAGE ="No API key found. Add a valid API key for this connection.";-const HIDDEN_PROVIDER_TYPES = new Set(["qwen"]);+const HIDDEN_PROVIDER_TYPES = new Set(["qwen", "opencode_go"]);// Ends the open provider menu just above this item so the rows from it on need a scroll.function capProviderMenuAtItem(item: HTMLElement | null) {@@ -354,6 +357,19 @@ export function ChatProvidersSettings({null,) === true;+ const chooseProviderType = (value: string) => {+ if (editingProviderId) return;+ setProviderType(value);+ setReasoningConfig(null);+ setAvailableModels([]);+ setSelectedModelIds([]);+ setManualModelIds("");+ setModelSearchQuery("");+ if (isCustomProviderType(value)) {+ setCustomProviderName(customProviderDisplayName(value));+ }+ };+const registryByType = useMemo(() => new Map(registry.map((entry) => [entry.provider_type, entry])),[registry],@@ -1511,19 +1527,8 @@ export function ChatProvidersSettings({</p></div><Select- value={providerType}- onValueChange={(value) => {- if (editingProviderId) return;- setProviderType(value);- setReasoningConfig(null);- setAvailableModels([]);- setSelectedModelIds([]);- setManualModelIds("");- setModelSearchQuery("");- if (isCustomProviderType(value)) {- setCustomProviderName(customProviderDisplayName(value));- }- }}+ value={connectionPickerValue(providerType)}+ onValueChange={chooseProviderType}><SelectTriggerid="provider-preset"@@ -1579,7 +1584,9 @@ export function ChatProvidersSettings({className="size-4"title={entry.display_name}/>- <span className="truncate">{entry.display_name}</span>+ <span className="truncate">+ {entry.provider_type === "opencode" ? "OpenCode" : entry.display_name}+ </span></span></SelectItem>))}@@ -1588,6 +1595,35 @@ export function ChatProvidersSettings({</Select></div>+ {isOpenCodeProviderType(providerType) ? (+ <div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-start gap-4 px-4 py-3 @max-[520px]:grid-cols-1">+ <div className="flex min-w-0 flex-col gap-0.5">+ <Label htmlFor="provider-opencode-plan" className="text-sm font-medium">+ Plan+ </Label>+ <p className="text-xs leading-snug text-muted-foreground">+ The same OpenCode key works for both.+ </p>+ </div>+ <Select value={providerType} onValueChange={chooseProviderType}>+ <SelectTrigger+ id="provider-opencode-plan"+ className="mt-[var(--ui-title-cap-inset)] h-9 w-full text-sm @max-[520px]:mt-0"+ disabled={editingProviderId != null}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {OPENCODE_PLANS.map((plan) => (+ <SelectItem key={plan.providerType} value={plan.providerType}>+ {plan.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </div>+ ) : null}+{showApiKeyField ? (<div className="grid grid-cols-[minmax(140px,0.8fr)_minmax(0,1.2fr)] items-start gap-4 px-4 py-3 @max-[520px]:grid-cols-1"><div className="flex min-w-0 flex-col gap-0.5">diff --git a/studio/frontend/src/features/chat/external-providers.ts b/studio/frontend/src/features/chat/external-providers.tsindex 0c037087118..a817a623592 100644--- a/studio/frontend/src/features/chat/external-providers.ts+++ b/studio/frontend/src/features/chat/external-providers.ts@@ -376,6 +376,22 @@ export function supportsProviderMaxOutputTokens();}+// One picker entry: the plan picks the registry type, and with it the URL that decides the billing.+export const OPENCODE_PLANS = [+ { providerType: "opencode", label: "Console" },+ { providerType: "opencode_go", label: "Go" },+] as const;++export function isOpenCodeProviderType(+ providerType: string | null | undefined,+): boolean {+ return OPENCODE_PLANS.some((plan) => plan.providerType === providerType);+}++export function connectionPickerValue(providerType: string): string {+ return isOpenCodeProviderType(providerType) ? "opencode" : providerType;+}+export const CUSTOM_PROVIDER_PRESETS = [{providerType: "llama_cpp",diff --git a/studio/frontend/tests/connections-opencode-plan.test.ts b/studio/frontend/tests/connections-opencode-plan.test.tsnew file mode 100644index 00000000000..8e3fc79bd80--- /dev/null+++ b/studio/frontend/tests/connections-opencode-plan.test.ts@@ -0,0 +1,43 @@+// 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 { readFileSync } from "node:fs";+import { register } from "node:module";+import test from "node:test";++register("./bundler-resolver.mjs", import.meta.url);+const { connectionPickerValue, isOpenCodeProviderType, OPENCODE_PLANS } = await import(+ "../src/features/chat/external-providers.ts"+);++const dialog = readFileSync(+ new URL("../src/features/chat/chat-providers-dialog.tsx", import.meta.url),+ "utf8",+);++test("both OpenCode plans share one picker entry", () => {+ assert.deepEqual(+ OPENCODE_PLANS.map((plan: { providerType: string }) => plan.providerType),+ ["opencode", "opencode_go"],+ );+ assert.deepEqual(+ OPENCODE_PLANS.map((plan: { label: string }) => plan.label),+ ["Console", "Go"],+ );+ assert.equal(connectionPickerValue("opencode"), "opencode");+ assert.equal(connectionPickerValue("opencode_go"), "opencode");+ assert.match(dialog, /HIDDEN_PROVIDER_TYPES = new Set\(\[[^\]]*"opencode_go"/);+});++test("other connections keep their own picker entry and show no plan", () => {+ for (const type of ["openai", "minimax", "custom"]) {+ assert.equal(connectionPickerValue(type), type);+ assert.equal(isOpenCodeProviderType(type), false);+ }+});++test("a saved connection cannot change plan", () => {+ assert.match(dialog, /id="provider-opencode-plan"[\s\S]{0,160}disabled=\{editingProviderId != null\}/);+ assert.match(dialog, /chooseProviderType = \(value: string\) => \{\s*if \(editingProviderId\) return;/);+});