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) <noreply@anthropic.com>
This commit is contained in:
@@ -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},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user