From 98720d7fff8f93d1c6cc51a2b56e5001595397a0 Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Tue, 25 Aug 2026 13:59:08 -0700 Subject: [PATCH 1/4] [Workers AI] Document GLM-5.2 reasoning effort --- src/components/models/ModelDetailPage.astro | 42 +++++++++++++++++++++ src/components/models/ModelFeatures.astro | 2 +- src/content/workers-ai-models/glm-5.2.json | 16 ++++++-- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/components/models/ModelDetailPage.astro b/src/components/models/ModelDetailPage.astro index 19ace64ca45..f04591c4e6b 100644 --- a/src/components/models/ModelDetailPage.astro +++ b/src/components/models/ModelDetailPage.astro @@ -144,6 +144,7 @@ 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"; // `hasSchema`: input must have at least one key. const hasSchema = Object.keys(model.schema.input).length > 0; @@ -214,6 +215,11 @@ const pageTitle = `${displayName} (${authorName})`; const headTitle = `${pageTitle} · Cloudflare AI docs`; const headings: MarkdownHeading[] = [ + hasReasoningEffortGuidance && { + depth: 2, + slug: "reasoning-effort", + text: "Reasoning effort", + }, hasPlayground && { depth: 2, slug: "playground", text: "Playground" }, hasCodeExamples && { depth: 2, slug: "usage", text: "Usage" }, hasRemainingExamples && { depth: 2, slug: "examples", text: "Examples" }, @@ -343,6 +349,42 @@ const headings: MarkdownHeading[] = [ + { + hasReasoningEffortGuidance && ( + + +

+ GLM-5.2 supports high and max reasoning + effort, or you can turn reasoning off. For compatibility with Chat + Completions and other protocols in the ecosystem, other reasoning + efforts will be mapped to these modes: +

+
    +
  • + none and minimal turn reasoning off. +
  • +
  • + low and medium map to high. +
  • +
  • + xhigh maps to max. +
  • +
+

+ This is the same mapping used by Z.ai's API, and{" "} + + in their reasoning_effort documentation + + . +

+
+ ) + } + { /* 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 0f2b12cfa02..a465386643d 100644 --- a/src/components/models/ModelFeatures.astro +++ b/src/components/models/ModelFeatures.astro @@ -138,7 +138,7 @@ const price = Array.isArray(properties.price) {properties.reasoning && ( Reasoning - Yes + {properties.reasoning_options ?? "Yes"} )} {properties.vision && ( diff --git a/src/content/workers-ai-models/glm-5.2.json b/src/content/workers-ai-models/glm-5.2.json index d6505b83232..5080945e979 100644 --- a/src/content/workers-ai-models/glm-5.2.json +++ b/src/content/workers-ai-models/glm-5.2.json @@ -36,6 +36,10 @@ { "property_id": "reasoning", "value": "true" + }, + { + "property_id": "reasoning_options", + "value": "Off, High, Max" } ], "id": "4edc7dfe-de78-4156-890c-85b79227694e", @@ -297,7 +301,8 @@ "enum": [ "low", "medium", - "high" + "high", + "max" ] }, { @@ -1563,7 +1568,8 @@ "enum": [ "low", "medium", - "high" + "high", + "max" ] }, { @@ -2399,7 +2405,8 @@ "enum": [ "low", "medium", - "high" + "high", + "max" ] }, { @@ -3665,7 +3672,8 @@ "enum": [ "low", "medium", - "high" + "high", + "max" ] }, { From f2fcb67205c13bf228a56561d9a2567529dc1844 Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Tue, 25 Aug 2026 14:41:02 -0700 Subject: [PATCH 2/4] [Workers AI] Use canonical reasoning effort property --- src/components/models/ModelFeatures.astro | 2 +- src/content/workers-ai-models/glm-5.2.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/models/ModelFeatures.astro b/src/components/models/ModelFeatures.astro index a465386643d..36bbc6831c5 100644 --- a/src/components/models/ModelFeatures.astro +++ b/src/components/models/ModelFeatures.astro @@ -138,7 +138,7 @@ const price = Array.isArray(properties.price) {properties.reasoning && ( Reasoning - {properties.reasoning_options ?? "Yes"} + {properties.reasoning_effort ?? "Yes"} )} {properties.vision && ( diff --git a/src/content/workers-ai-models/glm-5.2.json b/src/content/workers-ai-models/glm-5.2.json index 5080945e979..a6729038a36 100644 --- a/src/content/workers-ai-models/glm-5.2.json +++ b/src/content/workers-ai-models/glm-5.2.json @@ -38,7 +38,7 @@ "value": "true" }, { - "property_id": "reasoning_options", + "property_id": "reasoning_effort", "value": "Off, High, Max" } ], From e89315811546e9749401d031d951f71c11596631 Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Tue, 25 Aug 2026 14:57:04 -0700 Subject: [PATCH 3/4] [Workers AI] Show GLM reasoning effort values --- src/components/models/SchemaDisplay.astro | 8 +++++++- src/content/workers-ai-models/glm-5.2.json | 12 ++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/components/models/SchemaDisplay.astro b/src/components/models/SchemaDisplay.astro index df79324e31e..0e56d2d61bc 100644 --- a/src/components/models/SchemaDisplay.astro +++ b/src/components/models/SchemaDisplay.astro @@ -171,6 +171,7 @@ function collectRows( let isNullable = false; let nullableType: string | undefined; let nullableChildDescription: string | undefined; + let nullableChildEnumValues: unknown[] | undefined; if ((hasOneOf || hasAnyOf) && reg.children?.length === 2) { const childTypes = reg.children.map((c) => String((c as RegularNode).primaryType ?? ""), @@ -183,6 +184,10 @@ function collectRows( nullableType = childTypes[nonNullIndex]; nullableChildDescription = nonNullChild.annotations?.description as string | undefined; + nullableChildEnumValues = + (nonNullChild.validations?.enum as unknown[]) ?? + ((nonNullChild.fragment as Record) + ?.enum as unknown[]); isNullable = true; } } @@ -207,7 +212,8 @@ function collectRows( // Check both validations and fragment for enum (different schema parsers put it in different places) const enumValues = ( (reg.validations?.enum as unknown[]) ?? - ((reg.fragment as Record)?.enum as unknown[]) + ((reg.fragment as Record)?.enum as unknown[]) ?? + nullableChildEnumValues )?.map(String); // Collect all metadata from fragment and validations diff --git a/src/content/workers-ai-models/glm-5.2.json b/src/content/workers-ai-models/glm-5.2.json index a6729038a36..fa603ba367a 100644 --- a/src/content/workers-ai-models/glm-5.2.json +++ b/src/content/workers-ai-models/glm-5.2.json @@ -299,8 +299,7 @@ { "type": "string", "enum": [ - "low", - "medium", + "none", "high", "max" ] @@ -1566,8 +1565,7 @@ { "type": "string", "enum": [ - "low", - "medium", + "none", "high", "max" ] @@ -2403,8 +2401,7 @@ { "type": "string", "enum": [ - "low", - "medium", + "none", "high", "max" ] @@ -3670,8 +3667,7 @@ { "type": "string", "enum": [ - "low", - "medium", + "none", "high", "max" ] From bf091a8cec1356290d05d7995855bd25123378ae Mon Sep 17 00:00:00 2001 From: Kastan Day Date: Tue, 25 Aug 2026 16:05:48 -0700 Subject: [PATCH 4/4] [Workers AI] Document model-specific reasoning controls --- src/components/models/ModelDetailPage.astro | 75 ++++++++++++++++++- .../deepseek-v4-flash-0731.json | 58 +++++++++----- .../deepseek-v4-pro-0813.json | 58 +++++++++----- .../workers-ai-models/gemma-4-26b-a4b-it.json | 58 +++++++++----- 4 files changed, 195 insertions(+), 54 deletions(-) diff --git a/src/components/models/ModelDetailPage.astro b/src/components/models/ModelDetailPage.astro index f04591c4e6b..6329801b1e0 100644 --- a/src/components/models/ModelDetailPage.astro +++ b/src/components/models/ModelDetailPage.astro @@ -144,7 +144,12 @@ 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 reasoningEffortGuidance = new Map([ + ["@cf/zai-org/glm-5.2", "glm-5.2"], + ["@cf/google/gemma-4-26b-a4b-it", "gemma-4"], + ["@cf/deepseek-ai/deepseek-v4-flash-0731", "deepseek-v4-official"], + ["@cf/deepseek-ai/deepseek-v4-pro-0813", "deepseek-v4-official"], +]).get(model.name); // `hasSchema`: input must have at least one key. const hasSchema = Object.keys(model.schema.input).length > 0; @@ -215,7 +220,7 @@ const pageTitle = `${displayName} (${authorName})`; const headTitle = `${pageTitle} · Cloudflare AI docs`; const headings: MarkdownHeading[] = [ - hasReasoningEffortGuidance && { + reasoningEffortGuidance && { depth: 2, slug: "reasoning-effort", text: "Reasoning effort", @@ -350,7 +355,7 @@ const headings: MarkdownHeading[] = [ { - hasReasoningEffortGuidance && ( + reasoningEffortGuidance === "glm-5.2" && ( + +

+ DeepSeek V4 Flash 0731 and Pro 0813 support low,{" "} + high, and max reasoning effort. You can also + turn reasoning off. Reasoning is off by default. +

+

Other reasoning efforts map to these modes:

+
    +
  • + none and minimal turn reasoning off. +
  • +
  • + medium and auto map to high. +
  • +
  • + xhigh maps to max. +
  • +
+

+ A request without reasoning controls remains off. If a prior assistant + message contains non-empty reasoning_content, the model + continues reasoning at high to preserve that context. +

+
+ ) + } + + { + reasoningEffortGuidance === "gemma-4" && ( + + +

+ Gemma 4 supports turning reasoning on or off. It does not support + different reasoning intensity levels. Reasoning is off by default. +

+
    +
  • + none and minimal turn reasoning off. +
  • +
  • + low, medium, high,{" "} + xhigh, max, and auto turn + reasoning on. +
  • +
+

+ These values provide API compatibility. They do not change the amount + of reasoning Gemma 4 performs. +

+
+ ) + } + { /* Defensive dead branch (model not in slice): nova-3 transport pricing. */ model.name === "@cf/deepgram/nova-3" && ( 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 3151bf95da1..3ba330e8c2a 100644 --- a/src/content/workers-ai-models/deepseek-v4-flash-0731.json +++ b/src/content/workers-ai-models/deepseek-v4-flash-0731.json @@ -17,6 +17,10 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": "Off, Low, High, Max" + }, { "property_id": "price", "value": [ @@ -295,24 +299,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -1561,24 +1570,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -2397,24 +2411,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -3663,24 +3682,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -4767,4 +4791,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 5153e5bc98c..b49832e15f3 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,10 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": "Off, Low, High, Max" + }, { "property_id": "vision", "value": "false" @@ -299,24 +303,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -1565,24 +1574,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -2401,24 +2415,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -3667,24 +3686,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls reasoning effort. none and minimal turn reasoning off; medium and auto map to high; xhigh maps to max." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -4771,4 +4795,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 4f09a88c0cc..f6b757790d4 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 @@ -38,6 +38,10 @@ "property_id": "reasoning", "value": "true" }, + { + "property_id": "reasoning_effort", + "value": "Off, On" + }, { "property_id": "terms", "value": "https://ai.google.dev/gemma/docs/gemma_4_license" @@ -298,24 +302,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls whether reasoning is on. none and minimal turn reasoning off; other listed values turn it on. Gemma 4 does not vary reasoning intensity by effort." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -1559,24 +1568,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls whether reasoning is on. none and minimal turn reasoning off; other listed values turn it on. Gemma 4 does not vary reasoning intensity by effort." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -2403,24 +2417,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls whether reasoning is on. none and minimal turn reasoning off; other listed values turn it on. Gemma 4 does not vary reasoning intensity by effort." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -3666,24 +3685,29 @@ { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "xhigh", + "max", + "auto" ] }, { "type": "null" } ], - "description": "Constrains effort on reasoning for reasoning models (o1, o3-mini, etc.)." + "description": "Controls whether reasoning is on. none and minimal turn reasoning off; other listed values turn it on. Gemma 4 does not vary reasoning intensity by effort." }, "chat_template_kwargs": { "type": "object", "properties": { "enable_thinking": { "type": "boolean", - "default": true, - "description": "Whether to enable reasoning, enabled by default." + "default": false, + "description": "Whether to turn reasoning on. Reasoning is off by default." }, "clear_thinking": { "type": "boolean", @@ -4769,4 +4793,4 @@ ] } } -} \ No newline at end of file +}