Skip to content

GLM-5.3-Flash EXL3 on 2x DGX Spark with TensorFold

Python

0091: refreshed against 0084's server.py (no fuzz)

MiaAI-Lab646c948a78a7
diff --git a/patches/0091-glm-loop-guard.patch b/patches/0091-glm-loop-guard.patch
index 489c87b..0baba3b 100644
--- a/patches/0091-glm-loop-guard.patch
+++ b/patches/0091-glm-loop-guard.patch
@@ -7,8 +7,8 @@
# The reply's usage stats carry loop_guard: N when it fired. It does not catch paraphrase loops, which only
# --thinking-budget bounds. Earlier turns' looped reasoning is still resent by agents: TF_GLM_CLEAR_THINKING=1 drops it.
---- tensorfold/cuda/server.py 2026-10-08
-+++ tensorfold/cuda/server.py 2026-10-08
+--- tensorfold/cuda/server.py
++++ tensorfold/cuda/server.py
@@ -4,6 +4,7 @@
import hashlib
import inspect
@@ -18,7 +18,7 @@
import time
from dataclasses import dataclass
@@ -19,6 +20,7 @@
- from tensorfold.server.stopping import stop_options
+ from tensorfold.server.stopping import matched_stop, stop_options
from tensorfold.server.tool_policy import ToolCallPolicy
from tensorfold.engine.call_gate import CallGate, ThinkBudget, call_format, generate_gated
+from tensorfold.engine.loop_guard import LoopGuard
@@ -56,7 +56,7 @@
# the model's end token (not a stop string or the token limit) ended the reply: a call it ended inside is
# closed when it then parses (#22), else its markup is the reply's text; it is never dropped
ended = bool(out) and out[-1] in ends and not stopped["stop"]
-@@ -637,10 +643,18 @@
+@@ -639,10 +645,18 @@
if prepared.think_budget <= 0 or think_end is None:
return None