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
Chat: show the Thinking control for Ollama models that report the thinking capability (#10043)
Shubhankar Tripathyafd6a6c64429
diff --git a/studio/backend/core/inference/external_provider.py b/studio/backend/core/inference/external_provider.pyindex 5326d3b367c..a3f07a4d1b2 100644--- a/studio/backend/core/inference/external_provider.py+++ b/studio/backend/core/inference/external_provider.py@@ -7016,8 +7016,12 @@ class ExternalProviderClient:raw_models = data.get("data") or []if isinstance(raw_models, list):models = [model for model in raw_models if isinstance(model, dict)]- if not models and self.provider_type == "ollama":- models = await self._list_ollama_native_models()+ if self.provider_type == "ollama":+ # Only /api/tags carries the per-model "thinking" capability.+ if not models:+ models = await self._list_ollama_native_models()+ else:+ models = await self._with_ollama_capabilities(models)# Gemini's native /v1beta/models uses a different shape; repackage into the OpenAI-compatible one Unsloth# expects.if not models and self.provider_type == "gemini":@@ -7067,8 +7071,16 @@ class ExternalProviderClient:)return out+ @staticmethod+ def _ollama_capability_names(entry: dict[str, Any]) -> Optional[list[str]]:+ # None = the row is silent (older Ollama), not "no capabilities".+ raw = entry.get("capabilities")+ if not isinstance(raw, list):+ return None+ return [name for name in raw if isinstance(name, str) and name]+async def _list_ollama_native_models(self) -> list[dict[str, Any]]:- """Fallback when Ollama's /v1/models returns an empty or null catalog."""+ """Ollama's /api/tags catalog, with per-model capabilities when reported."""root = self.base_url.removesuffix("/v1").rstrip("/")response = await _client().get(f"{root}/api/tags",@@ -7082,11 +7094,39 @@ class ExternalProviderClient:raw_models = payload.get("models") or []if not isinstance(raw_models, list):return []- return [- {"id": entry.get("name", "").strip(), "owned_by": "ollama"}- for entry in raw_models- if isinstance(entry, dict) and entry.get("name", "").strip()- ]+ models: list[dict[str, Any]] = []+ for entry in raw_models:+ if not isinstance(entry, dict):+ continue+ model_id = entry.get("name", "").strip()+ if not model_id:+ continue+ model: dict[str, Any] = {"id": model_id, "owned_by": "ollama"}+ capabilities = self._ollama_capability_names(entry)+ if capabilities is not None:+ model["capabilities"] = capabilities+ models.append(model)+ return models++ async def _with_ollama_capabilities(self, models: list[dict[str, Any]]) -> list[dict[str, Any]]:+ # A working /v1/models must still list when /api/tags fails.+ try:+ native = await self._list_ollama_native_models()+ except (httpx.HTTPError, ValueError) as exc:+ logger.debug("Ollama /api/tags capabilities unavailable: %s", exc)+ return models+ capabilities = {+ entry["id"]: entry["capabilities"]+ for entry in native+ if entry.get("capabilities") is not None+ }+ if not capabilities:+ return models+ merged: list[dict[str, Any]] = []+ for model in models:+ names = capabilities.get(model.get("id", ""))+ merged.append(model if names is None else {**model, "capabilities": names})+ return mergedasync def verify_models_endpoint_lightweight(self) -> None:"""Confirm GET /models returns 200 without buffering the full response body. Used fordiff --git a/studio/backend/models/providers.py b/studio/backend/models/providers.pyindex 779220dba3d..43e7ce3ed74 100644--- a/studio/backend/models/providers.py+++ b/studio/backend/models/providers.py@@ -162,6 +162,10 @@ class ProviderModelInfo(BaseModel):display_name: str = Field("", description = "Human-readable model name")context_length: Optional[int] = Field(None, description = "Maximum context length in tokens")owned_by: Optional[str] = Field(None, description = "Model owner/organization")+ capabilities: Optional[list[str]] = Field(+ None,+ description = "Per-model capability names (Ollama /api/tags: thinking, tools, vision, ...)",+ )class ProviderModelReasoningInfo(BaseModel):diff --git a/studio/backend/routes/providers.py b/studio/backend/routes/providers.pyindex 6d097900b9b..ccef15ad3d1 100644--- a/studio/backend/routes/providers.py+++ b/studio/backend/routes/providers.py@@ -1002,6 +1002,14 @@ async def list_provider_model_capabilities(return capabilities+def _model_capability_names(model: dict) -> Optional[list[str]]:+ # Another server's shape under this key must not fail the listing's validation.+ values = model.get("capabilities")+ if not isinstance(values, list):+ return None+ return [name for name in values if isinstance(name, str) and name]++@router.post("/models", response_model = list[ProviderModelInfo])async def list_provider_models(payload: ProviderModelsRequest,@@ -1126,6 +1134,7 @@ async def list_provider_models(display_name = m.get("id", ""),context_length = m.get("context_length") or m.get("context_window"),owned_by = m.get("owned_by"),+ capabilities = _model_capability_names(m),)for m in models]diff --git a/studio/backend/tests/test_ollama_model_capabilities.py b/studio/backend/tests/test_ollama_model_capabilities.pynew file mode 100644index 00000000000..1d1b16d302e--- /dev/null+++ b/studio/backend/tests/test_ollama_model_capabilities.py@@ -0,0 +1,156 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++"""Ollama /api/tags capabilities layered onto /v1/models (#9649)."""++import asyncio++import httpx+import pytest++from core.inference import external_provider+from core.inference.external_provider import ExternalProviderClient+from models.providers import ProviderModelsRequest+from routes import providers as providers_route++TAGS = {+ "models": [+ {"name": "qwen3:8b", "capabilities": ["completion", "tools", "thinking"]},+ {"name": "llama3.2:3b", "capabilities": ["completion", "tools"]},+ {"name": "vicuna:7b"},+ ]+}+++class _FakeResponse:+ def __init__(self, payload):+ self._payload = payload++ def raise_for_status(self):+ return None++ def json(self):+ return self._payload+++def _stub_http(monkeypatch, *, v1_payload, tags_payload):+ """Answer /v1/models and /api/tags; None means "raise like an unreachable host"."""+ seen: list[str] = []++ async def _get(url, **_kwargs):+ seen.append(url)+ payload = tags_payload if url.endswith("/api/tags") else v1_payload+ if payload is None:+ raise httpx.ConnectError("unreachable")+ return _FakeResponse(payload)++ monkeypatch.setattr(external_provider._http_client, "get", _get)+ return seen+++def _list_models(+ monkeypatch,+ *,+ v1_payload,+ tags_payload = TAGS,+):+ seen = _stub_http(monkeypatch, v1_payload = v1_payload, tags_payload = tags_payload)+ client = ExternalProviderClient(+ provider_type = "ollama",+ base_url = "http://127.0.0.1:11434/v1",+ api_key = None,+ )+ models = asyncio.new_event_loop().run_until_complete(client.list_models())+ return models, seen+++V1_CATALOG = {+ "data": [+ {"id": "qwen3:8b", "owned_by": "library"},+ {"id": "llama3.2:3b", "owned_by": "library"},+ {"id": "vicuna:7b", "owned_by": "library"},+ ]+}+++def test_the_native_catalog_carries_per_model_capabilities(monkeypatch):+ models, _seen = _list_models(monkeypatch, v1_payload = {"data": []})+ by_id = {m["id"]: m for m in models}+ assert by_id["qwen3:8b"]["capabilities"] == ["completion", "tools", "thinking"]+ assert by_id["llama3.2:3b"]["capabilities"] == ["completion", "tools"]+ # A row that says nothing must not read as "explicitly not thinking".+ assert "capabilities" not in by_id["vicuna:7b"]+++def test_a_populated_v1_catalog_still_gets_capabilities(monkeypatch):+ models, seen = _list_models(monkeypatch, v1_payload = V1_CATALOG)+ assert any(url.endswith("/api/tags") for url in seen), seen+ by_id = {m["id"]: m for m in models}+ assert by_id["qwen3:8b"]["owned_by"] == "library"+ assert "thinking" in by_id["qwen3:8b"]["capabilities"]+ assert "thinking" not in by_id["llama3.2:3b"]["capabilities"]+ assert "capabilities" not in by_id["vicuna:7b"]+++def test_an_unreachable_tags_endpoint_leaves_the_catalog_usable(monkeypatch):+ models, _seen = _list_models(monkeypatch, v1_payload = V1_CATALOG, tags_payload = None)+ assert [m["id"] for m in models] == ["qwen3:8b", "llama3.2:3b", "vicuna:7b"]+ assert all("capabilities" not in m for m in models)+++def test_a_non_ollama_provider_never_queries_tags(monkeypatch):+ seen = _stub_http(monkeypatch, v1_payload = V1_CATALOG, tags_payload = TAGS)+ client = ExternalProviderClient(+ provider_type = "vllm",+ base_url = "http://127.0.0.1:8000/v1",+ api_key = None,+ )+ asyncio.new_event_loop().run_until_complete(client.list_models())+ assert not any(url.endswith("/api/tags") for url in seen), seen+++ "raw, expected",+ [+ (["thinking"], ["thinking"]),+ ([], []),+ # Foreign shapes are dropped, never surfaced as a broken capability list.+ ("thinking", None),+ ({"thinking": True}, None),+ (["thinking", 3, "", None], ["thinking"]),+ ],+)+def test_the_route_only_forwards_string_capability_names(raw, expected):+ assert providers_route._model_capability_names({"capabilities": raw}) == expected+ assert providers_route._model_capability_names({}) is None+++def test_the_models_route_surfaces_capabilities(monkeypatch):+ class _FakeClient:+ def __init__(self, **_kwargs):+ pass++ async def list_models(self):+ return [+ {"id": "qwen3:8b", "capabilities": ["thinking"]},+ {"id": "llama3.2:3b", "capabilities": []},+ {"id": "vicuna:7b"},+ ]++ async def close(self):+ return None++ monkeypatch.setattr(providers_route, "ExternalProviderClient", _FakeClient)+ monkeypatch.setattr(providers_route, "resolve_provider_api_key_or_400", lambda *a, **k: None)+ payload = ProviderModelsRequest(+ provider_type = "ollama",+ base_url = "http://127.0.0.1:11434/v1",+ )+ result = asyncio.new_event_loop().run_until_complete(+ providers_route.list_provider_models(payload, "tester", False)+ )+ assert [(m.id, m.capabilities) for m in result] == [+ ("qwen3:8b", ["thinking"]),+ ("llama3.2:3b", []),+ ("vicuna:7b", None),+ ]diff --git a/studio/frontend/src/features/chat/api/providers-api.ts b/studio/frontend/src/features/chat/api/providers-api.tsindex ef567dc55c3..3efa6261c06 100644--- a/studio/frontend/src/features/chat/api/providers-api.ts+++ b/studio/frontend/src/features/chat/api/providers-api.ts@@ -64,6 +64,8 @@ export interface ProviderModelInfo {owned_by?: string | null;/** Only the ChatGPT plan catalog reports this; the registry describes the rest. */vision?: boolean | null;+ /** Only Ollama's /api/tags reports these; absent is not the same as none. */+ capabilities?: string[] | null;}export interface ProviderModelReasoningInfo {diff --git a/studio/frontend/src/features/chat/chat-providers-dialog.tsx b/studio/frontend/src/features/chat/chat-providers-dialog.tsxindex 2ab12a01782..a8213c83613 100644--- a/studio/frontend/src/features/chat/chat-providers-dialog.tsx+++ b/studio/frontend/src/features/chat/chat-providers-dialog.tsx@@ -76,6 +76,7 @@ import {LEGACY_CUSTOM_PROVIDER_TYPE,CUSTOM_PROVIDER_DISPLAY_NAME,getProviderModelCapabilities,+ learnCatalogModelCapabilities,providerModelSupportsStudioTools,setProviderModelCapabilities,removeExternalProviderApiKey,@@ -723,6 +724,8 @@ export function ChatProvidersSettings({baseUrl,apiType: providerType === LEGACY_CUSTOM_PROVIDER_TYPE ? apiType : undefined,});+ // The picker keeps only ids, so per-model capabilities are learned here or lost.+ learnCatalogModelCapabilities(providerType, models);const registryDefaults = supportsRemoteModelCatalog(providerType)? []: (registryByType.get(providerType)?.default_models ?? []);diff --git a/studio/frontend/src/features/chat/external-providers.ts b/studio/frontend/src/features/chat/external-providers.tsindex d1e4267fe21..2f58e0a025e 100644--- a/studio/frontend/src/features/chat/external-providers.ts+++ b/studio/frontend/src/features/chat/external-providers.ts@@ -115,7 +115,7 @@ export function isPromptCacheTtl(value: unknown): value is "5m" | "1h" {}// Provider types exposing the connection-level "reasoning model" toggle. vLLM's OpenAI-compat-// endpoint does not advertise this per model.+// endpoint does not advertise this per model; Ollama's /api/tags does.const REASONING_TOGGLE_PROVIDER_TYPES = new Set(["vllm"]);export function supportsProviderReasoningToggle(@@ -171,9 +171,15 @@ export function providerTypeSupportsVision(}+export type ProviderModelCapability = {+ vision?: boolean;+ studio_tools?: boolean;+ thinking?: boolean;+};+const REGISTRY_MODEL_CAPABILITIES = new Map<string,- Record<string, { vision?: boolean; studio_tools?: boolean }>+ Record<string, ProviderModelCapability>>();const REGISTRY_MODEL_CAPABILITIES_KEY =@@ -187,10 +193,7 @@ function hydrateProviderModelCapabilities(): void {try {const parsed = JSON.parse(localStorage.getItem(REGISTRY_MODEL_CAPABILITIES_KEY) ?? "{}",- ) as Record<- string,- Record<string, { vision?: boolean; studio_tools?: boolean }>- >;+ ) as Record<string, Record<string, ProviderModelCapability>>;for (const [providerType, capabilities] of Object.entries(parsed)) {if (capabilities && typeof capabilities === "object") {REGISTRY_MODEL_CAPABILITIES.set(providerType, capabilities);@@ -215,14 +218,14 @@ function persistProviderModelCapabilities(): void {export function getProviderModelCapabilities(providerType: string,-): Record<string, { vision?: boolean; studio_tools?: boolean }> | undefined {+): Record<string, ProviderModelCapability> | undefined {hydrateProviderModelCapabilities();return REGISTRY_MODEL_CAPABILITIES.get(providerType);}export function setProviderModelCapabilities(providerType: string,- capabilities: Record<string, { vision?: boolean; studio_tools?: boolean }> | undefined,+ capabilities: Record<string, ProviderModelCapability> | undefined,): void {hydrateProviderModelCapabilities();if (capabilities) REGISTRY_MODEL_CAPABILITIES.set(providerType, capabilities);@@ -313,6 +316,42 @@ export function providerModelSupportsStudioTools(return typeof providerDefault === "boolean" ? providerDefault : null;}+/** No wildcard fallback: one Ollama host serves thinking and non-thinking models. `null` = never+ * described (hand-typed id, older Ollama), which is not a yes. */+export function providerModelSupportsThinking(+ providerType: string | null | undefined,+ modelId: string | null | undefined,+): boolean | null {+ if (!providerType || !modelId) return null;+ hydrateProviderModelCapabilities();+ const value =+ REGISTRY_MODEL_CAPABILITIES.get(providerType)?.[modelId]?.thinking;+ return typeof value === "boolean" ? value : null;+}++/** Rows with a capability list overwrite `thinking` (a re-pulled tag can lose it); rows without+ * one are left alone. */+export function learnCatalogModelCapabilities(+ providerType: string,+ models: readonly { id: string; capabilities?: string[] | null }[],+): void {+ if (!providerType) return;+ const stored = getProviderModelCapabilities(providerType) ?? {};+ const merged: Record<string, ProviderModelCapability> = { ...stored };+ let learned = false;+ for (const model of models) {+ const names = model.capabilities;+ const modelId = model.id?.trim();+ if (!modelId || !Array.isArray(names)) continue;+ merged[modelId] = {+ ...stored[modelId],+ thinking: names.includes("thinking"),+ };+ learned = true;+ }+ if (learned) setProviderModelCapabilities(providerType, merged);+}+/** Whether the connection behind an `external::` model id runs Unsloth tools. Resolves the* provider type from the saved connection, so callers holding only a checkpoint id can ask* the capability question without risking an import cycle. */diff --git a/studio/frontend/src/features/chat/provider-capabilities.ts b/studio/frontend/src/features/chat/provider-capabilities.tsindex a0d0ab5d9c1..d5f7f3fd7c5 100644--- a/studio/frontend/src/features/chat/provider-capabilities.ts+++ b/studio/frontend/src/features/chat/provider-capabilities.ts@@ -4,6 +4,7 @@import {normalizeProviderMaxOutputTokens,providerModelSupportsStudioTools,+ providerModelSupportsThinking,} from "./external-providers";import {type ModelCatalogEntry,@@ -1170,9 +1171,14 @@ export function effectiveExternalReasoningProviderType(: normalizedProvider;}-// vLLM has no per-model reasoning signal on OpenAI-compat, so pin via user toggle.-function resolveConnectionLevelReasoning(+// Thinking off sends "none". https://docs.ollama.com/api/openai-compatibility+const OLLAMA_EFFORT_LEVELS = ["low", "medium", "high", "max"] as const;++// vLLM has no per-model reasoning signal on OpenAI-compat, so pin via user toggle. Ollama errors a+// thinking request at a model without the /api/tags "thinking" capability, so gate on it (#9649).+function resolveProviderReasoning(normalizedProvider: string,+ modelId: string,options: ExternalReasoningResolveOptions | undefined,): ExternalReasoningCapabilities | null {if (normalizedProvider === "vllm" && options?.isReasoningProvider) {@@ -1181,6 +1187,16 @@ function resolveConnectionLevelReasoning(supportsReasoningOff: true,});}+ if (+ normalizedProvider === "ollama" &&+ providerModelSupportsThinking(normalizedProvider, modelId) === true+ ) {+ return withReasoningEffortStyle({+ supportsReasoning: true,+ supportsReasoningOff: true,+ reasoningEffortLevels: OLLAMA_EFFORT_LEVELS,+ });+ }return null;}@@ -1283,17 +1299,20 @@ export function getExternalReasoningCapabilities(modelId: string | null | undefined,options?: ExternalReasoningResolveOptions,): ExternalReasoningCapabilities {- const normalizedModel = modelId?.trim().toLowerCase() ?? "";+ // The capability map is keyed by the catalog's id, so look it up before case-folding.+ const catalogModel = modelId?.trim() ?? "";+ const normalizedModel = catalogModel.toLowerCase();const normalizedProvider = effectiveExternalReasoningProviderType(providerType,options?.apiType,);- const connectionLevel = resolveConnectionLevelReasoning(+ const providerLevel = resolveProviderReasoning(normalizedProvider,+ catalogModel,options,);- if (connectionLevel) {- return connectionLevel;+ if (providerLevel) {+ return providerLevel;}if (!normalizedModel) {return withEnableThinkingStyle();diff --git a/studio/frontend/src/features/chat/research-inference-request.ts b/studio/frontend/src/features/chat/research-inference-request.tsindex d8426a30b38..d6f631e44e0 100644--- a/studio/frontend/src/features/chat/research-inference-request.ts+++ b/studio/frontend/src/features/chat/research-inference-request.ts@@ -122,6 +122,12 @@ export function buildResearchInferenceRequest(input: {input.reasoningEffort,input.reasoningEffortLevels,);+ } else if (+ input.reasoningStyle === "reasoning_effort" &&+ input.external?.supportsReasoningOff+ ) {+ // Ollama thinks when no control arrives; gated as "none" is not in every ladder (gpt-5).+ request.reasoningEffort = "none";}return request;}diff --git a/studio/frontend/tests/ollama-connection-reasoning.test.ts b/studio/frontend/tests/ollama-connection-reasoning.test.tsnew file mode 100644index 00000000000..91a618cba6d--- /dev/null+++ b/studio/frontend/tests/ollama-connection-reasoning.test.ts@@ -0,0 +1,100 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// #9649: the selected model's /api/tags "thinking" capability decides, not the connection.++import assert from "node:assert/strict";+import test from "node:test";++import { registerBundlerResolver } from "./helpers/kit.ts";++registerBundlerResolver();++const { getExternalReasoningCapabilities } = await import(+ "../src/features/chat/provider-capabilities.ts"+);++const {+ learnCatalogModelCapabilities,+ providerModelSupportsThinking,+ supportsProviderReasoningToggle,+} = await import("../src/features/chat/external-providers.ts");++learnCatalogModelCapabilities("ollama", [+ {+ id: "thinkingcap-27b-bottlecap:latest",+ capabilities: ["completion", "tools", "thinking"],+ },+ { id: "plainhat-7b:latest", capabilities: ["completion", "tools"] },+ { id: "silent-13b:latest" },+]);++test("an ollama model advertising thinking gets the effort ladder", () => {+ const caps = getExternalReasoningCapabilities(+ "ollama",+ "thinkingcap-27b-bottlecap:latest",+ );+ assert.equal(caps.supportsReasoning, true);+ assert.equal(caps.reasoningStyle, "reasoning_effort");+ assert.equal(caps.supportsReasoningOff, true);+ assert.deepEqual(+ [...caps.reasoningEffortLevels],+ ["low", "medium", "high", "max"],+ );+});++test("a non-thinking model on the same connection keeps no controls", () => {+ const caps = getExternalReasoningCapabilities("ollama", "plainhat-7b:latest");+ assert.equal(caps.supportsReasoning, false);+});++test("a model the catalog never described keeps no controls", () => {+ assert.equal(+ providerModelSupportsThinking("ollama", "silent-13b:latest"),+ null,+ );+ assert.equal(+ getExternalReasoningCapabilities("ollama", "silent-13b:latest")+ .supportsReasoning,+ false,+ );+ assert.equal(+ getExternalReasoningCapabilities("ollama", "never-listed:latest")+ .supportsReasoning,+ false,+ );+});++test("a re-pulled model that stopped thinking loses the ladder", () => {+ learnCatalogModelCapabilities("ollama", [+ { id: "thinkingcap-27b-bottlecap:latest", capabilities: ["completion"] },+ ]);+ assert.equal(+ getExternalReasoningCapabilities(+ "ollama",+ "thinkingcap-27b-bottlecap:latest",+ ).supportsReasoning,+ false,+ );+ learnCatalogModelCapabilities("ollama", [+ {+ id: "thinkingcap-27b-bottlecap:latest",+ capabilities: ["completion", "thinking"],+ },+ ]);+});++test("the connection dialog no longer offers the toggle for ollama", () => {+ assert.equal(supportsProviderReasoningToggle("ollama"), false);+ assert.equal(supportsProviderReasoningToggle("vllm"), true);+ assert.equal(supportsProviderReasoningToggle("openai"), false);+});++test("a flagged vllm connection still gets enable_thinking", () => {+ const caps = getExternalReasoningCapabilities("vllm", "some-local-model", {+ isReasoningProvider: true,+ });+ assert.equal(caps.supportsReasoning, true);+ assert.equal(caps.reasoningStyle, "enable_thinking");+ assert.equal(caps.supportsReasoningOff, true);+});diff --git a/studio/frontend/tests/research-inference-request.test.ts b/studio/frontend/tests/research-inference-request.test.tsindex 842938ebbc8..61164b049a0 100644--- a/studio/frontend/tests/research-inference-request.test.ts+++ b/studio/frontend/tests/research-inference-request.test.ts@@ -247,3 +247,74 @@ test("an external run records whether the model reasons and can turn it off", ()/supportsReasoning: runtime\.supportsReasoning,\s*supportsReasoningOff: runtime\.supportsReasoningOff,/,);});++test("Thinking off reaches research synthesis as an explicit none", () => {+ assert.deepEqual(+ buildResearchInferenceRequest({+ checkpoint: "external::provider::gpt-oss:20b",+ external: {+ providerId: "provider",+ providerType: "ollama",+ modelId: "gpt-oss:20b",+ maxOutputTokens: null,+ maxOutputTokensFromSavedCap: false,+ maxOutputTokensPublished: null,+ supportsReasoningOff: true,+ },+ temperature: 0.2,+ topP: 0.9,+ maxTokens: 4096,+ reasoningRequested: false,+ reasoningStyle: "reasoning_effort",+ reasoningEffort: "medium",+ reasoningEffortLevels: ["low", "medium", "high", "max"],+ clampReasoningEffort: clamp,+ }),+ {+ model: "gpt-oss:20b",+ providerId: "provider",+ providerType: "ollama",+ externalModel: "gpt-oss:20b",+ supportsReasoningOff: true,+ temperature: 0.2,+ topP: 0.9,+ maxTokens: 4096,+ reasoningEffort: "none",+ },+ );+});++test("a provider without an off value sends no effort when reasoning is off", () => {+ assert.deepEqual(+ buildResearchInferenceRequest({+ checkpoint: "external::provider::gpt-5",+ external: {+ providerId: "provider",+ providerType: "openai",+ modelId: "gpt-5",+ maxOutputTokens: null,+ maxOutputTokensFromSavedCap: false,+ maxOutputTokensPublished: null,+ supportsReasoningOff: false,+ },+ temperature: 0.2,+ topP: 0.9,+ maxTokens: 4096,+ reasoningRequested: false,+ reasoningStyle: "reasoning_effort",+ reasoningEffort: "medium",+ reasoningEffortLevels: ["low", "medium", "high"],+ clampReasoningEffort: clamp,+ }),+ {+ model: "gpt-5",+ providerId: "provider",+ providerType: "openai",+ externalModel: "gpt-5",+ supportsReasoningOff: false,+ temperature: 0.2,+ topP: 0.9,+ maxTokens: 4096,+ },+ );+});