Degrade gracefully when local LLM is asleep

This commit is contained in:
Meta Vens 2026-05-03 08:44:38 +01:00
commit 7c1d7f24d4
3 changed files with 27 additions and 4 deletions

View file

@ -1050,7 +1050,7 @@ try {
remoteFile = $offsiteStatus.remoteFile
}
} else {
Add-Check -Name "offsite.status_file" -Status "failed" -Detail "Latest offsite sync status is '$([string]$offsiteStatus.status)' instead of completed." -Data @{
Add-Check -Name "offsite.status_file" -Status "warning" -Detail "Latest offsite sync status is '$([string]$offsiteStatus.status)' instead of completed." -Data @{
error = [string](Get-OptionalPropertyValue -InputObject $offsiteStatus -PropertyName "error")
}
}

View file

@ -514,17 +514,39 @@ if ($ragBackend -eq "ollama") {
if ($localLlmEnabled) {
$status.stage = "local_llm"
Write-StatusFile -Path $statusPath -Status $status
$status.localLlmOllama = Ensure-OllamaEndpoint -BaseUrl $localLlmBaseUrl -Model $localLlmModel -Label "Local LLM Ollama" -LogDir $logDir
try {
$status.localLlmOllama = Ensure-OllamaEndpoint -BaseUrl $localLlmBaseUrl -Model $localLlmModel -Label "Local LLM Ollama" -LogDir $logDir
} catch {
$status.localLlmOllama = @{
url = $localLlmBaseUrl
model = $localLlmModel
healthy = $false
degradedStartup = $true
error = $_.Exception.Message
}
}
if ($localLlmSocialReadModel -eq $localLlmModel) {
$status.localLlmSocialReadOllama = @{
url = $localLlmBaseUrl
model = $localLlmSocialReadModel
healthy = $true
healthy = [bool]$status.localLlmOllama.healthy
mirrorsLocalLlm = $true
degradedStartup = if ($status.localLlmOllama.ContainsKey("degradedStartup")) { $status.localLlmOllama.degradedStartup } else { $false }
error = if ($status.localLlmOllama.ContainsKey("error")) { $status.localLlmOllama.error } else { $null }
}
} else {
$status.localLlmSocialReadOllama = Ensure-OllamaEndpoint -BaseUrl $localLlmBaseUrl -Model $localLlmSocialReadModel -Label "Local LLM social-read Ollama" -LogDir $logDir
try {
$status.localLlmSocialReadOllama = Ensure-OllamaEndpoint -BaseUrl $localLlmBaseUrl -Model $localLlmSocialReadModel -Label "Local LLM social-read Ollama" -LogDir $logDir
} catch {
$status.localLlmSocialReadOllama = @{
url = $localLlmBaseUrl
model = $localLlmSocialReadModel
healthy = $false
degradedStartup = $true
error = $_.Exception.Message
}
}
}
Write-StatusFile -Path $statusPath -Status $status

View file

@ -33,3 +33,4 @@
{"ts":"2026-05-02T21:52:56Z","type":"implementation","status":"ok","note":"Situational sidecar now emits transcript-wide Ghostlight-style participant reads with durable binary label families plus ephemeral situational state; roster-constrained schema and full configured Ollama timeout are needed to keep multi-person reads viable on a busy remote box."}
{"ts":"2026-05-02T22:58:31Z","type":"research","status":"ok","note":"Gemma3 12B Q4_0 on the 4060 Ti box handles the transcript-wide social-read task once the schema sticks to a simpler subset; Ollama chokes on roster-constrained prefixItems/const schema but both Gemma and Qwen work with local roster reconciliation, and Gemma slightly beats Qwen on latency for the tested slice."}
{"ts":"2026-05-02T23:40:40Z","type":"implementation","status":"ok","note":"Split room-read sidecar model selection from the main local reply model so Gemma can drive transcript profiling without changing the public/local answer lane."}
{"ts":"2026-05-03T07:40:36Z","type":"implementation","status":"ok","note":"Offsite backup was stopping bot and worker, then leaving the stack dead if the remote local-LLM box was asleep; startup now records local-LLM degradation without aborting, and watchdog treats a failed offsite status file as a warning while remote freshness is checked separately."}