diff --git a/src/components/models/ModelDetailPage.astro b/src/components/models/ModelDetailPage.astro index cc5874875ca..e6c2be67371 100644 --- a/src/components/models/ModelDetailPage.astro +++ b/src/components/models/ModelDetailPage.astro @@ -144,7 +144,11 @@ const authorName = model.authorName; const requiresWorkersPaid = model.properties.require_workers_paid === true || model.properties.require_workers_paid === "true"; -const hasReasoningEffortGuidance = model.name === "@cf/zai-org/glm-5.2"; +const hasGlm52ReasoningEffortGuidance = model.name === "@cf/zai-org/glm-5.2"; +const hasNemotronReasoningEffortGuidance = + model.name === "@cf/nvidia/nemotron-3-120b-a12b"; +const hasReasoningEffortGuidance = + hasGlm52ReasoningEffortGuidance || hasNemotronReasoningEffortGuidance; // `hasSchema`: input must have at least one key. const hasSchema = Object.keys(model.schema.input).length > 0; @@ -345,7 +349,7 @@ const headings: MarkdownHeading[] = [ - {hasReasoningEffortGuidance && ( + {hasGlm52ReasoningEffortGuidance && ( )} + {hasNemotronReasoningEffortGuidance && ( + + +

+ Nemotron supports normal reasoning, low reasoning, and reasoning turned + off. It does not currently select these modes from the top-level + reasoning_effort field. Pass the corresponding options + through chat_template_kwargs instead. +

+

+ To use low reasoning, set both enable_thinking and + low_effort: +

+ +

+ The low-effort option appends {`{reasoning effort: low}`}{" "} + to the latest user message. To turn reasoning off, set + enable_thinking to False. For coding agents, + set + force_nonempty_content to True in the same + chat_template_kwargs object. +

+

+ For more information, refer to{" "} + + NVIDIA's Nemotron API client example + + . +

+
+ )} + { /* Defensive dead branch (model not in slice): nova-3 transport pricing. */ model.name === "@cf/deepgram/nova-3" && ( diff --git a/src/components/models/ModelFeatures.astro b/src/components/models/ModelFeatures.astro index c3915c40cc3..0f027ba6427 100644 --- a/src/components/models/ModelFeatures.astro +++ b/src/components/models/ModelFeatures.astro @@ -6,7 +6,11 @@ * beta → Batch → request formats → partner → realtime → unit price → * dashboard pricing link. */ -import { modelCurrencyFormatter, type ModelView } from "~/util/models"; +import { + formatModelReasoning, + modelCurrencyFormatter, + type ModelView, +} from "~/util/models"; interface Props { model: ModelView; @@ -44,6 +48,10 @@ const hasProps = Object.keys(properties).length > 0; const price = Array.isArray(properties.price) ? (properties.price as { price: number; unit: string }[]) : null; +const reasoning = formatModelReasoning( + properties.reasoning_effort, + properties.reasoning, +); --- {hasProps && ( @@ -54,7 +62,7 @@ const price = Array.isArray(properties.price) - + {properties.planned_deprecation_date && ( @@ -127,10 +135,23 @@ const price = Array.isArray(properties.price) Yes )} - {properties.reasoning && ( + {reasoning && ( Reasoning - {properties.reasoning_effort ?? "Yes"} + + {Array.isArray(reasoning) ? ( + + {reasoning.map((effort) => ( + + {effort.value} + {effort.isDefault && " (default)"} + + ))} + + ) : ( + reasoning + )} + )} {properties.vision && ( diff --git a/src/content/workers-ai-models/deepseek-v4-flash-0731.json b/src/content/workers-ai-models/deepseek-v4-flash-0731.json index f1b762fc15e..12d762c2912 100644 --- a/src/content/workers-ai-models/deepseek-v4-flash-0731.json +++ b/src/content/workers-ai-models/deepseek-v4-flash-0731.json @@ -21,6 +21,26 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "max", + "high", + "low", + "none" + ], + "default_effort": "high", + "default_enabled": true, + "mandatory": false, + "normalizes_to": { + "null": "high", + "minimal": "low", + "medium": "high", + "xhigh": "high" + } + } + }, { "property_id": "price", "value": [ @@ -299,16 +319,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -316,7 +338,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1546,16 +1568,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -1563,7 +1587,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2363,16 +2387,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -2380,7 +2406,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -3610,16 +3636,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -3627,7 +3655,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -4678,4 +4706,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/deepseek-v4-pro-0813.json b/src/content/workers-ai-models/deepseek-v4-pro-0813.json index d3dad444e1a..ba58a6ae356 100644 --- a/src/content/workers-ai-models/deepseek-v4-pro-0813.json +++ b/src/content/workers-ai-models/deepseek-v4-pro-0813.json @@ -17,6 +17,26 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "max", + "high", + "low", + "none" + ], + "default_effort": "high", + "default_enabled": true, + "mandatory": false, + "normalizes_to": { + "null": "high", + "minimal": "low", + "medium": "high", + "xhigh": "high" + } + } + }, { "property_id": "price", "value": [ @@ -295,16 +315,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -312,7 +334,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1542,16 +1564,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -1559,7 +1583,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2359,16 +2383,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -2376,7 +2402,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -3606,16 +3632,18 @@ { "type": "string", "enum": [ + "max", + "high", "low", - "medium", - "high" + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low, none. Compatibility aliases: minimal maps to low; medium maps to high; xhigh maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -3623,7 +3651,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -4674,4 +4702,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/gemma-4-26b-a4b-it.json b/src/content/workers-ai-models/gemma-4-26b-a4b-it.json index 42293e99990..e1c7c66a87e 100644 --- a/src/content/workers-ai-models/gemma-4-26b-a4b-it.json +++ b/src/content/workers-ai-models/gemma-4-26b-a4b-it.json @@ -17,6 +17,13 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "mandatory": false, + "default_enabled": true + } + }, { "property_id": "terms", "value": "https://ai.google.dev/gemma/docs/gemma_4_license" @@ -297,29 +304,13 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1548,29 +1539,13 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2369,29 +2344,13 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -3620,29 +3579,13 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -4693,4 +4636,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/glm-4.7-flash.json b/src/content/workers-ai-models/glm-4.7-flash.json index 4aa4c8ebd24..f6716f08014 100644 --- a/src/content/workers-ai-models/glm-4.7-flash.json +++ b/src/content/workers-ai-models/glm-4.7-flash.json @@ -27,6 +27,13 @@ { "property_id": "reasoning", "value": "true" + }, + { + "property_id": "reasoning_effort", + "value": { + "mandatory": false, + "default_enabled": true + } } ], "id": "86b3e51a-4b05-43fa-a403-0f27821919d2", @@ -279,29 +286,13 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1526,29 +1517,13 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2594,4 +2569,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/glm-5.2.json b/src/content/workers-ai-models/glm-5.2.json index 21783016702..318bf0ad990 100644 --- a/src/content/workers-ai-models/glm-5.2.json +++ b/src/content/workers-ai-models/glm-5.2.json @@ -17,6 +17,26 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "max", + "high", + "none" + ], + "default_effort": "max", + "default_enabled": true, + "mandatory": false, + "normalizes_to": { + "null": "max", + "low": "high", + "medium": "high", + "xhigh": "max", + "minimal": "none" + } + } + }, { "property_id": "price", "value": [ @@ -295,16 +315,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, none. Compatibility aliases: low maps to high; medium maps to high; xhigh maps to max; minimal maps to none.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -312,7 +333,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1542,16 +1563,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, none. Compatibility aliases: low maps to high; medium maps to high; xhigh maps to max; minimal maps to none.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -1559,7 +1581,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2359,16 +2381,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, none. Compatibility aliases: low maps to high; medium maps to high; xhigh maps to max; minimal maps to none.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -2376,7 +2399,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -3606,16 +3629,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, none. Compatibility aliases: low maps to high; medium maps to high; xhigh maps to max; minimal maps to none.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -3623,7 +3647,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -4674,4 +4698,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/glm-5.3-flash.json b/src/content/workers-ai-models/glm-5.3-flash.json index b3bca043762..233f9b5c280 100644 --- a/src/content/workers-ai-models/glm-5.3-flash.json +++ b/src/content/workers-ai-models/glm-5.3-flash.json @@ -17,6 +17,26 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "max", + "high", + "low" + ], + "default_effort": "max", + "normalizes_to": { + "none": "max", + "minimal": "max", + "medium": "max", + "xhigh": "max", + "null": "max" + }, + "mandatory": true, + "default_enabled": true + } + }, { "property_id": "terms", "value": "https://huggingface.co/zai-org/GLM-5.3-Flash/blob/main/LICENSE" @@ -303,16 +323,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -320,7 +341,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -1550,16 +1574,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -1567,7 +1592,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -2367,16 +2395,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -2384,7 +2413,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -3614,16 +3646,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -3631,7 +3664,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -4682,4 +4718,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/glm-5.3.json b/src/content/workers-ai-models/glm-5.3.json index 8642bf431df..cfc4e6f2bc5 100644 --- a/src/content/workers-ai-models/glm-5.3.json +++ b/src/content/workers-ai-models/glm-5.3.json @@ -17,6 +17,26 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "max", + "high", + "low" + ], + "default_effort": "max", + "normalizes_to": { + "none": "max", + "minimal": "max", + "medium": "max", + "xhigh": "max", + "null": "max" + }, + "mandatory": true, + "default_enabled": true + } + }, { "property_id": "price", "value": [ @@ -295,16 +315,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -312,7 +333,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -1542,16 +1566,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -1559,7 +1584,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -2359,16 +2387,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -2376,7 +2405,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -3606,16 +3638,17 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "max", + "high", + "low" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: max, high, low. Reasoning cannot be disabled. Compatibility aliases: none maps to max; minimal maps to max; medium maps to max; xhigh maps to max.", + "default": "max" }, "chat_template_kwargs": { "type": "object", @@ -3623,7 +3656,10 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -4674,4 +4710,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/gpt-oss-120b.json b/src/content/workers-ai-models/gpt-oss-120b.json index 1a66743187b..69c90e34505 100644 --- a/src/content/workers-ai-models/gpt-oss-120b.json +++ b/src/content/workers-ai-models/gpt-oss-120b.json @@ -31,6 +31,19 @@ { "property_id": "reasoning", "value": "true" + }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "low", + "medium", + "high" + ], + "default_effort": "medium", + "mandatory": true, + "default_enabled": true + } } ], "id": "f9f2250b-1048-4a52-9910-d0bf976616a1", @@ -442,12 +455,13 @@ "properties": { "effort": { "type": "string", - "description": "Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.", "enum": [ "low", "medium", "high" - ] + ], + "description": "Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.", + "default": "medium" }, "summary": { "type": "string", @@ -491,12 +505,13 @@ "properties": { "effort": { "type": "string", - "description": "Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.", "enum": [ "low", "medium", "high" - ] + ], + "description": "Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.", + "default": "medium" }, "summary": { "type": "string", @@ -537,4 +552,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/gpt-oss-20b.json b/src/content/workers-ai-models/gpt-oss-20b.json index 820e3c3606e..52fc9b4b2e7 100644 --- a/src/content/workers-ai-models/gpt-oss-20b.json +++ b/src/content/workers-ai-models/gpt-oss-20b.json @@ -31,6 +31,19 @@ { "property_id": "reasoning", "value": "true" + }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "low", + "medium", + "high" + ], + "default_effort": "medium", + "mandatory": true, + "default_enabled": true + } } ], "id": "188a4e1e-253e-46d0-9616-0bf8c149763f", @@ -442,12 +455,13 @@ "properties": { "effort": { "type": "string", - "description": "Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.", "enum": [ "low", "medium", "high" - ] + ], + "description": "Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.", + "default": "medium" }, "summary": { "type": "string", @@ -491,12 +505,13 @@ "properties": { "effort": { "type": "string", - "description": "Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.", "enum": [ "low", "medium", "high" - ] + ], + "description": "Reasoning effort. Supported levels: low, medium, high. Reasoning cannot be disabled.", + "default": "medium" }, "summary": { "type": "string", @@ -537,4 +552,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/kimi-k2.6.json b/src/content/workers-ai-models/kimi-k2.6.json index 6100f49e57f..befef3d09d5 100644 --- a/src/content/workers-ai-models/kimi-k2.6.json +++ b/src/content/workers-ai-models/kimi-k2.6.json @@ -21,6 +21,24 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "high", + "none" + ], + "default_effort": "high", + "normalizes_to": { + "low": "high", + "medium": "high", + "max": "high", + "null": "high" + }, + "mandatory": false, + "default_enabled": true + } + }, { "property_id": "terms", "value": "https://huggingface.co/moonshotai/Kimi-K2.6/blob/main/LICENSE" @@ -307,16 +325,16 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: high, none. Compatibility aliases: low maps to high; medium maps to high; max maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -324,7 +342,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1554,16 +1572,16 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: high, none. Compatibility aliases: low maps to high; medium maps to high; max maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -1571,7 +1589,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2371,16 +2389,16 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: high, none. Compatibility aliases: low maps to high; medium maps to high; max maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -2388,7 +2406,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -3618,16 +3636,16 @@ { "type": "string", "enum": [ - "low", - "medium", - "high" + "high", + "none" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: high, none. Compatibility aliases: low maps to high; medium maps to high; max maps to high.", + "default": "high" }, "chat_template_kwargs": { "type": "object", @@ -3635,7 +3653,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -4686,4 +4704,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/kimi-k2.7-code.json b/src/content/workers-ai-models/kimi-k2.7-code.json index 7f623e06209..b21ddd467ca 100644 --- a/src/content/workers-ai-models/kimi-k2.7-code.json +++ b/src/content/workers-ai-models/kimi-k2.7-code.json @@ -17,6 +17,13 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "mandatory": true, + "default_enabled": true + } + }, { "property_id": "terms", "value": "https://huggingface.co/moonshotai/Kimi-K2.7-Code/blob/main/LICENSE" @@ -298,29 +305,16 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -1545,29 +1539,16 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -2362,29 +2343,16 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -3609,29 +3577,16 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Reasoning is always enabled for this model and cannot be disabled.", + "enum": [ + true + ] }, "clear_thinking": { "type": "boolean", @@ -4682,4 +4637,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/nemotron-3-120b-a12b.json b/src/content/workers-ai-models/nemotron-3-120b-a12b.json index 54e2e7683a2..8f4e2775f95 100644 --- a/src/content/workers-ai-models/nemotron-3-120b-a12b.json +++ b/src/content/workers-ai-models/nemotron-3-120b-a12b.json @@ -50,14 +50,9 @@ { "title": "Prompt", "properties": { - "prompt": { - "type": "string", - "minLength": 1, - "description": "The input text prompt for the model to generate a response." - }, "model": { "type": "string", - "description": "ID of the model to use (e.g. '@cf/zai-org/glm-4.7-flash, etc')." + "description": "ID of the model to use (for example, '@cf/nvidia/nemotron-3-120b-a12b')." }, "audio": { "anyOf": [ @@ -161,7 +156,7 @@ "type": "null" } ], - "description": "Deprecated in favor of max_completion_tokens. The maximum number of tokens to generate." + "description": "The maximum number of tokens to generate." }, "max_completion_tokens": { "anyOf": [ @@ -183,7 +178,7 @@ "type": "null" } ], - "description": "Set of 16 key-value pairs that can be attached to the object." + "description": "Set of key-value pairs that can be attached to the object." }, "modalities": { "anyOf": [ @@ -201,7 +196,7 @@ "type": "null" } ], - "description": "Output types requested from the model (e.g. ['text'] or ['text', 'audio'])." + "description": "Output types requested from the model." }, "n": { "anyOf": [ @@ -283,34 +278,24 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", + "description": "Nemotron chat-template controls for normal reasoning, low-effort reasoning, and non-reasoning responses.", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning. Reasoning is enabled by default." }, - "clear_thinking": { + "low_effort": { "type": "boolean", "default": false, - "description": "If false, preserves reasoning context between turns." + "description": "When reasoning is enabled, use Nemotron's low-effort reasoning mode, which uses significantly fewer reasoning tokens." + }, + "force_nonempty_content": { + "type": "boolean", + "default": false, + "description": "For coding agent use, Nvidia suggests setting force_nonempty_content=true" } } }, @@ -433,7 +418,7 @@ } ], "default": false, - "description": "Whether to store the output for model distillation / evals." + "description": "Whether to store the output for model distillation or evaluation." }, "stream": { "anyOf": [ @@ -848,6 +833,11 @@ }, "minItems": 1, "maxItems": 128 + }, + "prompt": { + "type": "string", + "minLength": 1, + "description": "The input text prompt for the model to generate a response." } }, "required": [ @@ -857,490 +847,45 @@ { "title": "Messages", "properties": { - "messages": { - "type": "array", - "description": "A list of messages comprising the conversation so far.", - "items": { - "oneOf": [ - { - "type": "object", - "properties": { - "role": { - "type": "string", - "enum": [ - "developer" - ] - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "text": { - "type": "string" - } - }, - "required": [ - "type", - "text" - ] - } - } - ] - }, - "name": { - "type": "string" - } - }, - "required": [ - "role", - "content" - ] - }, - { - "type": "object", - "properties": { - "role": { - "type": "string", - "enum": [ - "system" - ] - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "text": { - "type": "string" - } - }, - "required": [ - "type", - "text" - ] + "model": { + "type": "string", + "description": "ID of the model to use (for example, '@cf/nvidia/nemotron-3-120b-a12b')." + }, + "audio": { + "anyOf": [ + { + "type": "object", + "description": "Parameters for audio output. Required when modalities includes 'audio'.", + "properties": { + "voice": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" } - } - ] - }, - "name": { - "type": "string" - } - }, - "required": [ - "role", - "content" - ] - }, - { - "type": "object", - "properties": { - "role": { - "type": "string", - "enum": [ - "user" - ] - }, - "content": { - "anyOf": [ - { - "type": "string" }, - { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text", - "image_url", - "video_url", - "input_audio", - "file" - ] - }, - "text": { - "type": "string" - }, - "image_url": { - "type": "object", - "properties": { - "url": { - "type": "string" - }, - "detail": { - "type": "string", - "enum": [ - "auto", - "low", - "high" - ], - "default": "auto" - } - } - }, - "video_url": { - "type": "object", - "properties": { - "url": { - "type": "string" - } - } - }, - "input_audio": { - "type": "object", - "properties": { - "data": { - "type": "string" - }, - "format": { - "type": "string", - "enum": [ - "wav", - "mp3" - ] - } - } - }, - "file": { - "type": "object", - "properties": { - "file_data": { - "type": "string" - }, - "file_id": { - "type": "string" - }, - "filename": { - "type": "string" - } - } - } - }, - "required": [ - "type" - ] - }, - "minItems": 1 - } - ] - }, - "name": { - "type": "string" - } + "required": [ + "id" + ] + } + ] }, - "required": [ - "role", - "content" - ] - }, - { - "type": "object", - "properties": { - "role": { - "type": "string", - "enum": [ - "assistant" - ] - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - }, - { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text", - "refusal" - ] - }, - "text": { - "type": "string" - }, - "refusal": { - "type": "string" - } - }, - "required": [ - "type" - ] - } - } - ] - }, - "refusal": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "name": { - "type": "string" - }, - "audio": { - "anyOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ] - } - ] - }, - "tool_calls": { - "type": "array", - "items": { - "oneOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "function" - ] - }, - "function": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string", - "description": "JSON-encoded arguments string." - } - }, - "required": [ - "name", - "arguments" - ] - } - }, - "required": [ - "id", - "type", - "function" - ] - }, - { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "custom" - ] - }, - "custom": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "input": { - "type": "string" - } - }, - "required": [ - "name", - "input" - ] - } - }, - "required": [ - "id", - "type", - "custom" - ] - } - ] - } - }, - "function_call": { - "anyOf": [ - { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string" - } - }, - "required": [ - "name", - "arguments" - ] - } - ] - } - }, - "required": [ - "role" - ] - }, - { - "type": "object", - "properties": { - "role": { - "type": "string", - "enum": [ - "tool" - ] - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - }, - "text": { - "type": "string" - } - }, - "required": [ - "type", - "text" - ] - } - } - ] - }, - "tool_call_id": { - "type": "string" - } - }, - "required": [ - "role", - "content", - "tool_call_id" - ] - }, - { - "type": "object", - "properties": { - "role": { - "type": "string", - "enum": [ - "function" - ] - }, - "content": { - "type": "string" - }, - "name": { - "type": "string" - } - }, - "required": [ - "role", - "content", - "name" - ] - } - ] - }, - "minItems": 1 - }, - "model": { - "type": "string", - "description": "ID of the model to use (e.g. '@cf/zai-org/glm-4.7-flash, etc')." - }, - "audio": { - "anyOf": [ - { - "type": "object", - "description": "Parameters for audio output. Required when modalities includes 'audio'.", - "properties": { - "voice": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "required": [ - "id" - ] - } - ] - }, - "format": { - "type": "string", - "enum": [ - "wav", - "aac", - "mp3", - "flac", - "opus", - "pcm16" - ] - } + "format": { + "type": "string", + "enum": [ + "wav", + "aac", + "mp3", + "flac", + "opus", + "pcm16" + ] + } }, "required": [ "voice", @@ -1408,7 +953,7 @@ "type": "null" } ], - "description": "Deprecated in favor of max_completion_tokens. The maximum number of tokens to generate." + "description": "The maximum number of tokens to generate." }, "max_completion_tokens": { "anyOf": [ @@ -1430,7 +975,7 @@ "type": "null" } ], - "description": "Set of 16 key-value pairs that can be attached to the object." + "description": "Set of key-value pairs that can be attached to the object." }, "modalities": { "anyOf": [ @@ -1448,7 +993,7 @@ "type": "null" } ], - "description": "Output types requested from the model (e.g. ['text'] or ['text', 'audio'])." + "description": "Output types requested from the model." }, "n": { "anyOf": [ @@ -1530,34 +1075,24 @@ "default": 0, "description": "Penalizes new tokens based on whether they appear in the text so far." }, - "reasoning_effort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." - }, "chat_template_kwargs": { "type": "object", + "description": "Nemotron chat-template controls for normal reasoning, low-effort reasoning, and non-reasoning responses.", "properties": { "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning. Reasoning is enabled by default." + }, + "low_effort": { + "type": "boolean", + "default": false, + "description": "When reasoning is enabled, use Nemotron's low-effort reasoning mode, which uses significantly fewer reasoning tokens." }, - "clear_thinking": { + "force_nonempty_content": { "type": "boolean", "default": false, - "description": "If false, preserves reasoning context between turns." + "description": "For coding agent use, Nvidia suggests setting force_nonempty_content=true" } } }, @@ -1606,495 +1141,940 @@ "json_schema": { "type": "object", "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "schema": { - "type": "object" - }, - "strict": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "schema": { + "type": "object" + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "type", + "json_schema" + ] + } + ] + } + ] + }, + "seed": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "If specified, the system will make a best effort to sample deterministically." + }, + "stop": { + "description": "Up to 4 sequences where the API will stop generating further tokens.", + "anyOf": [ + { + "type": "null" + }, + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "maxItems": 4 + } + ] + }, + "store": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Whether to store the output for model distillation or evaluation." + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "If true, partial message deltas will be sent as server-sent events." + }, + "stream_options": { + "anyOf": [ + { + "type": "object", + "properties": { + "include_usage": { + "type": "boolean" + }, + "include_obfuscation": { + "type": "boolean" + } + } + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number", + "minimum": 0, + "maximum": 2 + }, + { + "type": "null" + } + ], + "default": 1, + "description": "Sampling temperature between 0 and 2." + }, + "tool_choice": { + "anyOf": [ + { + "description": "Controls which (if any) tool is called by the model. 'none' = no tools, 'auto' = model decides, 'required' = must call a tool.", + "oneOf": [ + { + "type": "string", + "enum": [ + "none", + "auto", + "required" + ] + }, + { + "type": "object", + "description": "Force a specific function tool.", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "function": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "type", + "function" + ] + }, + { + "type": "object", + "description": "Force a specific custom tool.", + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ] + }, + "custom": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "type", + "custom" + ] + }, + { + "type": "object", + "description": "Constrain to an allowed subset of tools.", + "properties": { + "type": { + "type": "string", + "enum": [ + "allowed_tools" + ] + }, + "allowed_tools": { + "type": "object", + "properties": { + "mode": { + "type": "string", + "enum": [ + "auto", + "required" ] + }, + "tools": { + "type": "array", + "items": { + "type": "object" + } } }, "required": [ - "name" + "mode", + "tools" ] } }, "required": [ "type", - "json_schema" + "allowed_tools" ] } ] } ] }, - "seed": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "If specified, the system will make a best effort to sample deterministically." - }, - "stop": { - "description": "Up to 4 sequences where the API will stop generating further tokens.", - "anyOf": [ - { - "type": "null" - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" + "tools": { + "type": "array", + "description": "A list of tools the model may call.", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "function": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the function to be called." + }, + "description": { + "type": "string", + "description": "A description of what the function does." + }, + "parameters": { + "type": "object", + "description": "The parameters the function accepts, described as a JSON Schema object." + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Whether to enable strict schema adherence." + } + }, + "required": [ + "name" + ] + } + }, + "required": [ + "type", + "function" + ] }, - "minItems": 1, - "maxItems": 4 - } - ] - }, - "store": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": false, - "description": "Whether to store the output for model distillation / evals." - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": false, - "description": "If true, partial message deltas will be sent as server-sent events." - }, - "stream_options": { - "anyOf": [ - { - "type": "object", - "properties": { - "include_usage": { - "type": "boolean" + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ] + }, + "custom": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "format": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + } + }, + "required": [ + "type" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "grammar" + ] + }, + "grammar": { + "type": "object", + "properties": { + "definition": { + "type": "string" + }, + "syntax": { + "type": "string", + "enum": [ + "lark", + "regex" + ] + } + }, + "required": [ + "definition", + "syntax" + ] + } + }, + "required": [ + "type", + "grammar" + ] + } + ] + } + }, + "required": [ + "name" + ] + } }, - "include_obfuscation": { - "type": "boolean" - } + "required": [ + "type", + "custom" + ] } - } - ] + ] + } }, - "temperature": { + "top_p": { "anyOf": [ { "type": "number", "minimum": 0, - "maximum": 2 + "maximum": 1 }, { "type": "null" } ], "default": 1, - "description": "Sampling temperature between 0 and 2." + "description": "Nucleus sampling: considers the results of the tokens with top_p probability mass." }, - "tool_choice": { + "user": { + "type": "string", + "description": "A unique identifier representing your end-user, for abuse monitoring." + }, + "web_search_options": { "anyOf": [ { - "description": "Controls which (if any) tool is called by the model. 'none' = no tools, 'auto' = model decides, 'required' = must call a tool.", - "oneOf": [ - { + "type": "object", + "description": "Options for the web search tool (when using built-in web search).", + "properties": { + "search_context_size": { "type": "string", "enum": [ - "none", - "auto", - "required" - ] + "low", + "medium", + "high" + ], + "default": "medium" }, - { + "user_location": { "type": "object", - "description": "Force a specific function tool.", "properties": { "type": { "type": "string", "enum": [ - "function" + "approximate" ] }, - "function": { + "approximate": { "type": "object", "properties": { - "name": { + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "region": { + "type": "string" + }, + "timezone": { "type": "string" } - }, - "required": [ - "name" - ] + } } }, "required": [ "type", - "function" + "approximate" ] - }, - { - "type": "object", - "description": "Force a specific custom tool.", - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ] - }, - "custom": { - "type": "object", - "properties": { - "name": { - "type": "string" + } + } + } + ] + }, + "function_call": { + "anyOf": [ + { + "type": "string", + "enum": [ + "none", + "auto" + ] + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "required": [ + "name" + ] + } + ] + }, + "functions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the function to be called." + }, + "description": { + "type": "string", + "description": "A description of what the function does." + }, + "parameters": { + "type": "object", + "description": "The parameters the function accepts, described as a JSON Schema object." + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": false, + "description": "Whether to enable strict schema adherence." + } + }, + "required": [ + "name" + ] + }, + "minItems": 1, + "maxItems": 128 + }, + "messages": { + "type": "array", + "description": "A list of messages comprising the conversation so far.", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "developer" + ] + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "text": { + "type": "string" + } + }, + "required": [ + "type", + "text" + ] } + } + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "role", + "content" + ] + }, + { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "system" + ] + }, + "content": { + "anyOf": [ + { + "type": "string" }, - "required": [ - "name" - ] - } + { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] + }, + "text": { + "type": "string" + } + }, + "required": [ + "type", + "text" + ] + } + } + ] }, - "required": [ - "type", - "custom" - ] + "name": { + "type": "string" + } }, - { - "type": "object", - "description": "Constrain to an allowed subset of tools.", - "properties": { - "type": { - "type": "string", - "enum": [ - "allowed_tools" - ] - }, - "allowed_tools": { - "type": "object", - "properties": { - "mode": { - "type": "string", - "enum": [ - "auto", - "required" + "required": [ + "role", + "content" + ] + }, + { + "type": "object", + "properties": { + "role": { + "type": "string", + "enum": [ + "user" + ] + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text", + "image_url", + "video_url", + "input_audio", + "file" + ] + }, + "text": { + "type": "string" + }, + "image_url": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "detail": { + "type": "string", + "enum": [ + "auto", + "low", + "high" + ], + "default": "auto" + } + } + }, + "video_url": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + } + }, + "input_audio": { + "type": "object", + "properties": { + "data": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "wav", + "mp3" + ] + } + } + }, + "file": { + "type": "object", + "properties": { + "file_data": { + "type": "string" + }, + "file_id": { + "type": "string" + }, + "filename": { + "type": "string" + } + } + } + }, + "required": [ + "type" ] }, - "tools": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "required": [ - "mode", - "tools" - ] - } + "minItems": 1 + } + ] }, - "required": [ - "type", - "allowed_tools" - ] - } - ] - } - ] - }, - "tools": { - "type": "array", - "description": "A list of tools the model may call.", - "items": { - "oneOf": [ + "name": { + "type": "string" + } + }, + "required": [ + "role", + "content" + ] + }, { "type": "object", "properties": { - "type": { + "role": { "type": "string", "enum": [ - "function" + "assistant" ] }, - "function": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the function to be called." + "content": { + "anyOf": [ + { + "type": "string" }, - "description": { - "type": "string", - "description": "A description of what the function does." + { + "type": "null" }, - "parameters": { - "type": "object", - "description": "The parameters the function accepts, described as a JSON Schema object." + { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text", + "refusal" + ] + }, + "text": { + "type": "string" + }, + "refusal": { + "type": "string" + } + }, + "required": [ + "type" + ] + } + } + ] + }, + "refusal": { + "anyOf": [ + { + "type": "string" }, - "strict": { - "anyOf": [ - { - "type": "boolean" + { + "type": "null" + } + ] + }, + "name": { + "type": "string" + }, + "audio": { + "anyOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + ] + }, + "tool_calls": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "function" + ] + }, + "function": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "arguments": { + "type": "string", + "description": "JSON-encoded arguments string." + } + }, + "required": [ + "name", + "arguments" + ] + } + }, + "required": [ + "id", + "type", + "function" + ] + }, + { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "custom" + ] + }, + "custom": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "input": { + "type": "string" + } + }, + "required": [ + "name", + "input" + ] + } + }, + "required": [ + "id", + "type", + "custom" + ] + } + ] + } + }, + "function_call": { + "anyOf": [ + { + "type": "object", + "properties": { + "name": { + "type": "string" }, - { - "type": "null" + "arguments": { + "type": "string" } - ], - "default": false, - "description": "Whether to enable strict schema adherence." + }, + "required": [ + "name", + "arguments" + ] } - }, - "required": [ - "name" ] } }, "required": [ - "type", - "function" + "role" ] }, { "type": "object", "properties": { - "type": { + "role": { "type": "string", "enum": [ - "custom" + "tool" ] }, - "custom": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { + "content": { + "anyOf": [ + { "type": "string" }, - "format": { - "oneOf": [ - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ] - } + { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ] }, - "required": [ - "type" - ] + "text": { + "type": "string" + } }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "grammar" - ] - }, - "grammar": { - "type": "object", - "properties": { - "definition": { - "type": "string" - }, - "syntax": { - "type": "string", - "enum": [ - "lark", - "regex" - ] - } - }, - "required": [ - "definition", - "syntax" - ] - } - }, - "required": [ - "type", - "grammar" - ] - } - ] + "required": [ + "type", + "text" + ] + } } - }, - "required": [ - "name" ] + }, + "tool_call_id": { + "type": "string" } }, "required": [ - "type", - "custom" + "role", + "content", + "tool_call_id" ] - } - ] - } - }, - "top_p": { - "anyOf": [ - { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - { - "type": "null" - } - ], - "default": 1, - "description": "Nucleus sampling: considers the results of the tokens with top_p probability mass." - }, - "user": { - "type": "string", - "description": "A unique identifier representing your end-user, for abuse monitoring." - }, - "web_search_options": { - "anyOf": [ - { - "type": "object", - "description": "Options for the web search tool (when using built-in web search).", - "properties": { - "search_context_size": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ], - "default": "medium" - }, - "user_location": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "approximate" - ] - }, - "approximate": { - "type": "object", - "properties": { - "city": { - "type": "string" - }, - "country": { - "type": "string" - }, - "region": { - "type": "string" - }, - "timezone": { - "type": "string" - } - } - } - }, - "required": [ - "type", - "approximate" - ] - } - } - } - ] - }, - "function_call": { - "anyOf": [ - { - "type": "string", - "enum": [ - "none", - "auto" - ] - }, - { - "type": "object", - "properties": { - "name": { - "type": "string" - } - }, - "required": [ - "name" - ] - } - ] - }, - "functions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the function to be called." }, - "description": { - "type": "string", - "description": "A description of what the function does." - }, - "parameters": { + { "type": "object", - "description": "The parameters the function accepts, described as a JSON Schema object." - }, - "strict": { - "anyOf": [ - { - "type": "boolean" + "properties": { + "role": { + "type": "string", + "enum": [ + "function" + ] }, - { - "type": "null" + "content": { + "type": "string" + }, + "name": { + "type": "string" } - ], - "default": false, - "description": "Whether to enable strict schema adherence." + }, + "required": [ + "role", + "content", + "name" + ] } - }, - "required": [ - "name" ] }, - "minItems": 1, - "maxItems": 128 + "minItems": 1 } }, "required": [ @@ -2598,4 +2578,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/content/workers-ai-models/qwen3.8-27b.json b/src/content/workers-ai-models/qwen3.8-27b.json index 5339a8f5059..2083f0db086 100644 --- a/src/content/workers-ai-models/qwen3.8-27b.json +++ b/src/content/workers-ai-models/qwen3.8-27b.json @@ -17,6 +17,23 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": { + "supported_efforts": [ + "low", + "medium", + "xhigh" + ], + "default_effort": "xhigh", + "normalizes_to": { + "null": "xhigh" + }, + "mandatory": false, + "default_enabled": true, + "supports_max_tokens": false + } + }, { "property_id": "vision", "value": "true" @@ -301,14 +318,15 @@ "enum": [ "low", "medium", - "high" + "xhigh" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: low, medium, xhigh.", + "default": "xhigh" }, "chat_template_kwargs": { "type": "object", @@ -316,7 +334,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -1548,14 +1566,15 @@ "enum": [ "low", "medium", - "high" + "xhigh" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: low, medium, xhigh.", + "default": "xhigh" }, "chat_template_kwargs": { "type": "object", @@ -1563,7 +1582,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -2365,14 +2384,15 @@ "enum": [ "low", "medium", - "high" + "xhigh" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: low, medium, xhigh.", + "default": "xhigh" }, "chat_template_kwargs": { "type": "object", @@ -2380,7 +2400,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -3612,14 +3632,15 @@ "enum": [ "low", "medium", - "high" + "xhigh" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Reasoning effort. Supported levels: low, medium, xhigh.", + "default": "xhigh" }, "chat_template_kwargs": { "type": "object", @@ -3627,7 +3648,7 @@ "enable_thinking": { "type": "boolean", "default": true, - "description": "Whether to enable reasoning, enabled by default." + "description": "Whether to enable reasoning for this model." }, "clear_thinking": { "type": "boolean", @@ -4678,4 +4699,4 @@ } }, "deprecated": false -} \ No newline at end of file +} diff --git a/src/styles/prose.css b/src/styles/prose.css index f2d0d6f1e62..334b79d46f5 100644 --- a/src/styles/prose.css +++ b/src/styles/prose.css @@ -241,7 +241,9 @@ .docs-content :where( - tbody:not([class]):has(tr:nth-child(5)) tr:nth-child(even) td:not([class]) + tbody:not([class]):not([data-row-stripes="off"]):has(tr:nth-child(5)) + tr:nth-child(even) + td:not([class]) ) { background: var(--nb-accent); } diff --git a/src/util/models/model-format.node.test.ts b/src/util/models/model-format.node.test.ts index 9dcc6dac532..daaacf73310 100644 --- a/src/util/models/model-format.node.test.ts +++ b/src/util/models/model-format.node.test.ts @@ -1,5 +1,9 @@ import { describe, expect, it } from "vitest"; -import { formatCompactTokens, formatModelPricing } from "./model-format"; +import { + formatCompactTokens, + formatModelPricing, + formatModelReasoning, +} from "./model-format"; describe("model display formatting", () => { it("formats token counts compactly", () => { @@ -7,6 +11,82 @@ describe("model display formatting", () => { expect(formatCompactTokens(null)).toBeNull(); }); + it("formats structured reasoning efforts in a concise natural order", () => { + expect( + formatModelReasoning( + { + supported_efforts: ["xhigh", "medium", "low"], + default_effort: "xhigh", + default_enabled: true, + }, + "true", + ), + ).toEqual([ + { value: "low", isDefault: false }, + { value: "medium", isDefault: false }, + { value: "xhigh", isDefault: true }, + ]); + expect( + formatModelReasoning( + { + supported_efforts: ["medium", "low", "none"], + default_effort: "medium", + }, + "true", + ), + ).toEqual([ + { value: "none", isDefault: false }, + { value: "low", isDefault: false }, + { value: "medium", isDefault: true }, + ]); + expect( + formatModelReasoning( + { + supported_efforts: ["max", "high", "low"], + default_effort: "max", + }, + "true", + ), + ).toEqual([ + { value: "low", isDefault: false }, + { value: "high", isDefault: false }, + { value: "max", isDefault: true }, + ]); + expect( + formatModelReasoning( + { supported_efforts: ["off", "none", "low"] }, + "true", + ), + ).toEqual([ + { value: "none", isDefault: false }, + { value: "low", isDefault: false }, + ]); + }); + + it("falls back to a clean yes or no when effort metadata is absent", () => { + expect(formatModelReasoning(undefined, "true")).toBe("Yes"); + expect(formatModelReasoning(undefined, "false")).toBe("No"); + expect(formatModelReasoning(undefined, undefined)).toBeNull(); + }); + + it("summarizes structured binary reasoning metadata", () => { + expect( + formatModelReasoning({ mandatory: true, default_enabled: true }, "false"), + ).toBe("Always on"); + expect( + formatModelReasoning( + { mandatory: false, default_enabled: true }, + "false", + ), + ).toBe("Yes"); + expect( + formatModelReasoning( + { mandatory: false, default_enabled: false }, + "false", + ), + ).toBe("Yes"); + }); + it("formats supported pricing values and omits nested metadata", () => { expect( formatModelPricing({ diff --git a/src/util/models/model-format.ts b/src/util/models/model-format.ts index 744be21f29f..37f7848066a 100644 --- a/src/util/models/model-format.ts +++ b/src/util/models/model-format.ts @@ -15,6 +15,17 @@ const implicitTokenPriceLabels = new Map([ ["output_video_tokens", "Output video"], ]); +const reasoningEffortOrder = new Map( + ["none", "minimal", "low", "medium", "high", "xhigh", "max"].map( + (effort, index) => [effort, index], + ), +); + +export interface ModelReasoningEffort { + value: string; + isDefault: boolean; +} + export function formatCompactTokens(value: unknown): string | null { const count = Number(value); return Number.isFinite(count) && count > 0 @@ -22,6 +33,65 @@ export function formatCompactTokens(value: unknown): string | null { : null; } +export function formatModelReasoning( + reasoningEffort: unknown, + reasoning: unknown, +): string | ModelReasoningEffort[] | null { + if ( + typeof reasoningEffort === "object" && + reasoningEffort !== null && + !Array.isArray(reasoningEffort) + ) { + const metadata = reasoningEffort as Record; + const defaultEffort = + typeof metadata.default_effort === "string" + ? metadata.default_effort.toLowerCase() + : null; + const normalizedDefaultEffort = + defaultEffort === "off" ? "none" : defaultEffort; + const supportedEfforts = Array.isArray(metadata.supported_efforts) + ? [ + ...new Set( + metadata.supported_efforts + .filter((effort): effort is string => typeof effort === "string") + .map((effort) => effort.toLowerCase()) + .map((effort) => (effort === "off" ? "none" : effort)), + ), + ].sort( + (a, b) => + (reasoningEffortOrder.get(a) ?? Number.MAX_SAFE_INTEGER) - + (reasoningEffortOrder.get(b) ?? Number.MAX_SAFE_INTEGER), + ) + : []; + + if (supportedEfforts.length > 0) { + return supportedEfforts.map((value) => ({ + value, + isDefault: value === normalizedDefaultEffort, + })); + } + + if (metadata.mandatory === true) { + return "Always on"; + } + // Toggle-only reasoning reads like the legacy boolean flag. + if (typeof metadata.default_enabled === "boolean") { + return "Yes"; + } + } + + if (typeof reasoning === "boolean") { + return reasoning ? "Yes" : "No"; + } + if (typeof reasoning === "string") { + const normalized = reasoning.trim().toLowerCase(); + if (["true", "yes", "1"].includes(normalized)) return "Yes"; + if (["false", "no", "0"].includes(normalized)) return "No"; + } + + return null; +} + export function formatModelPricing( pricing: Record | undefined, ): string[] {