fix: Ollama KEEP_ALIVE=-1 ve AbortError mesaj netliği, callAiModelRaw'a opsiyonel timeoutMs

KEEP_ALIVE '30m' -> -1: GPU'da bolca boş VRAM var, modeli sürekli bellekte
tutmanın maliyeti yok, 30dk sınırı gereksiz soğuk-başlangıç gecikmelerine
sebep oluyordu (bkz. 2026-08-14 log: 44GB boş / 17.5GB kullanılan).
This commit is contained in:
Mustafa Yildiz
2026-08-17 00:46:10 +03:00
parent 2324cb78a6
commit 66a3960d90
2 changed files with 13 additions and 3 deletions
+2 -2
View File
@@ -150,12 +150,12 @@ async function callAiModel(systemPrompt: string, userText: string): Promise<{ re
return { resultJson, aiModel };
}
export async function callAiModelRaw(systemPrompt: string, userText: string, numPredict = 1500): Promise<{ aiContent: string; aiModel: string }> {
export async function callAiModelRaw(systemPrompt: string, userText: string, numPredict = 1500, timeoutMs?: number): Promise<{ aiContent: string; aiModel: string }> {
const { aiModel } = getAiConfig();
const aiContent = await callOllama([
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userText.substring(0, 15000) },
], { numPredict });
], { numPredict, timeoutMs });
return { aiContent, aiModel };
}