Skip to content

llm-gateway(glm): pin reasoning effort to high (var-overridable) - #999

Open
aaronjmars wants to merge 1 commit into
mainfrom
glm-reasoning-effort
Open

llm-gateway(glm): pin reasoning effort to high (var-overridable)#999
aaronjmars wants to merge 1 commit into
mainfrom
glm-reasoning-effort

Conversation

@aaronjmars

Copy link
Copy Markdown
Collaborator

What

scripts/llm-gateway.sh glm arm now pins Claude Code reasoning effort to high:

export CLAUDE_CODE_EFFORT_LEVEL="${GLM_REASONING_EFFORT:-high}"
export CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1

Why

GLM-5.3 / glm-5.3-flash are forced-thinking models (thinking cannot be disabled), and depth is the reasoning_effort dial: the 5.3 series supports low / high / max only. Without a param, the Anthropic-compat endpoint leaves depth model-decided (docs claim default max, empirically it lands between high and max). This pins a deterministic fleet default.

Verified honored on the live fleet endpoint https://api.z.ai/api/anthropic (2026-08-31), fixed hard prompt, glm-5.3:

effort thinking chars output tokens
low 2,356 2,045
high 15,251 7,959
max 32,717 15,645
no param 21,034 10,840

CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 is required because Claude Code only sends the effort field for Claude model ids it recognizes; glm-* ids would silently drop it otherwise.

Override

Per-instance repo var GLM_REASONING_EFFORT (low / high / max) overrides the default. No new secrets; no new required vars.

Verification

  • bash -n clean; source-test of the glm arm with GATEWAY=glm exports CLAUDE_CODE_EFFORT_LEVEL=high (and =max with the var set).
  • Endpoint honoring verified directly with curl against the fleet key (table above).

GLM-5.3/5.3-flash are forced-thinking models; depth is the reasoning_effort
dial (5.3 series: low/high/max). Without a param the anthropic-compat endpoint
leaves depth model-decided. Verified honored 2026-08-31 on
api.z.ai/api/anthropic: thinking chars low 2.4k < high 15.3k < max 32.7k on a
fixed hard prompt.

Claude Code only sends effort for Claude model ids it recognizes, so
CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 forces it through for glm-* ids.
GLM_REASONING_EFFORT repo var overrides (low|high|max); default high.
aaronjmars added a commit to aaronjmars/aeon-agent that referenced this pull request Aug 31, 2026
CLAUDE_CODE_EFFORT_LEVEL=high + ALWAYS_ENABLE_EFFORT; GLM_REASONING_EFFORT var overrides (low|high|max). Canon PR aeonfun/aeon#999.
aaronjmars added a commit to aaronjmars/aeon-bd that referenced this pull request Aug 31, 2026
CLAUDE_CODE_EFFORT_LEVEL=high + ALWAYS_ENABLE_EFFORT; GLM_REASONING_EFFORT var overrides (low|high|max). Canon PR aeonfun/aeon#999.
aaronjmars added a commit to aaronjmars/miroshark-aeon that referenced this pull request Aug 31, 2026
CLAUDE_CODE_EFFORT_LEVEL=high + ALWAYS_ENABLE_EFFORT; GLM_REASONING_EFFORT var overrides (low|high|max). Canon PR aeonfun/aeon#999.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant