From 95b2701c00c70dde26e08754bed0019dd2ee9a95 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Wed, 10 Jun 2026 21:23:34 -0700 Subject: [PATCH] feat(litellm): default glm-5.1 to thinking-off; add glm-5.1-reasoning opt-in glm-5.1 now disables GLM thinking by default via extra_body (LiteLLM strips top-level thinking under drop_params but forwards extra_body verbatim to z.ai). New glm-5.1-reasoning alias = same upstream with thinking enabled, so reasoning is opt-in. Operator call 2026-06-11; primary driver is the pi coding harness. Verified live: glm-5.1 reasoning_tokens=0, glm-5.1-reasoning reasoning_tokens>0. --- stacks/litellm/conf/config.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stacks/litellm/conf/config.yaml b/stacks/litellm/conf/config.yaml index 9270706..22d6c1a 100644 --- a/stacks/litellm/conf/config.yaml +++ b/stacks/litellm/conf/config.yaml @@ -53,11 +53,27 @@ model_list: # wildcard below (no collision with llama-swap's glm4.7-flash etc. # — different model IDs). NOTE: paid API; only gateway-keyed callers # can reach these, but they DO spend z.ai credits. Key in .env. --- + # glm-5.1: thinking DISABLED by default (2026-06-11, operator call). LiteLLM + # strips a top-level `thinking` param (drop_params), but forwards `extra_body` + # verbatim to z.ai, where the native thinking:{type:disabled} control lands — + # verified reasoning_tokens→0. Reasoning is opt-in via glm-5.1-reasoning below. - model_name: glm-5.1 litellm_params: model: openai/glm-5.1 api_base: https://api.z.ai/api/coding/paas/v4 api_key: os.environ/Z_AI_API_KEY + extra_body: + thinking: + type: disabled + # glm-5.1-reasoning: identical upstream, thinking ENABLED (opt-in reasoning). + - model_name: glm-5.1-reasoning + litellm_params: + model: openai/glm-5.1 + api_base: https://api.z.ai/api/coding/paas/v4 + api_key: os.environ/Z_AI_API_KEY + extra_body: + thinking: + type: enabled - model_name: glm-5-turbo litellm_params: model: openai/glm-5-turbo