optz: Goal orchestrator

This commit is contained in:
thanhnv
2026-07-11 12:18:59 +09:00
parent b56f7d357e
commit 4fc72332f5
34 changed files with 850 additions and 452 deletions
@@ -171,6 +171,11 @@ def call_ollama(model_name, prompt, role):
# small budget is consumed by reasoning and `response` comes back empty.
body["think"] = False
body["options"]["num_predict"] = 16 # terse final answer + fast
else:
# Prevent an unconstrained local generation from consuming the whole
# request window. Goal Orchestrator can tune this without weakening the
# shorter classifier/judge budgets.
body["options"]["num_predict"] = max(64, int(os.environ.get("CASAN_MODEL_GENERATE_MAX_TOKENS", "1400")))
data = json.dumps(body).encode()
req = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"})
t0 = time.time()