Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: add reasoning for baseten glm-5 (#9998)
Ari Webb91eca421dba1
diff --git a/letta/llm_api/openai_client.py b/letta/llm_api/openai_client.pyindex bddd33102..863cb9ee5 100644--- a/letta/llm_api/openai_client.py+++ b/letta/llm_api/openai_client.py@@ -671,6 +671,12 @@ class OpenAIClient(LLMClientBase):if isinstance(msg, dict):for field in ("reasoning_content_signature", "redacted_reasoning_content", "omitted_reasoning_content"):msg.pop(field, None)+ # Enable reasoning via chat_template_args for GLM-5 on BYOK deployments (e.g. Baseten TRT-LLM)+ # Thinking is off by default; must be explicitly enabled+ if llm_config.enable_reasoner:+ request_data["extra_body"] = {+ "chat_template_args": {"enable_thinking": True},+ }# Add OpenRouter reasoning configuration via extra_bodyif is_openrouter and llm_config.enable_reasoner: