From 736ddf647d4f0f5c259b4aa2ef0db904a5c38500 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Wed, 22 Apr 2026 20:31:13 +0200 Subject: [PATCH] fix(llm-dedup): use think:false instead of /no_think, restore 30s timeout Ollama API supports "think": false to disable extended thinking mode on qwen3.5. Reduces response time from 95s to ~3s per comparison. Co-Authored-By: Claude Opus 4.6 (1M context) --- control-pipeline/api/control_generator_routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/control-pipeline/api/control_generator_routes.py b/control-pipeline/api/control_generator_routes.py index b91fb3f..ebafb54 100644 --- a/control-pipeline/api/control_generator_routes.py +++ b/control-pipeline/api/control_generator_routes.py @@ -1475,15 +1475,16 @@ async def _run_llm_dedup(req: LLMDedupRequest, job_id: str): prompt = f"Control A ({row.candidate_control_id}):\n{candidate_ctx}\n\nControl B ({row.matched_control_id}):\n{matched_ctx}\n\nSind diese Controls Duplikate?" - async with httpx.AsyncClient(timeout=120.0) as client: + async with httpx.AsyncClient(timeout=30.0) as client: resp = await client.post( f"{OLLAMA_URL}/api/chat", json={ "model": req.model, "stream": False, + "think": False, "options": {"num_predict": 200}, "messages": [ - {"role": "system", "content": "Du bist ein Compliance-Experte. Vergleiche zwei Controls und entscheide: DUPLIKAT (gleiche Anforderung, nur anders formuliert) oder VERSCHIEDEN (unterschiedlicher Scope/Inhalt). Antworte NUR mit einem JSON: {\"verdict\": \"DUPLIKAT\" oder \"VERSCHIEDEN\", \"reason\": \"kurze Begruendung\"} /no_think"}, + {"role": "system", "content": "Du bist ein Compliance-Experte. Vergleiche zwei Controls und entscheide: DUPLIKAT (gleiche Anforderung, nur anders formuliert) oder VERSCHIEDEN (unterschiedlicher Scope/Inhalt). Antworte NUR mit einem JSON: {\"verdict\": \"DUPLIKAT\" oder \"VERSCHIEDEN\", \"reason\": \"kurze Begruendung\"}"}, {"role": "user", "content": prompt}, ], },