diff --git a/CHANGELOG.md b/CHANGELOG.md index c0b0314..933f6ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- "Hot: …" status no longer claims "unloads in X" when the server's `keep_alive` is `-1` (Ollama returns an absurd year-4001 `expires_at`). Threshold: any expiry >7 days drops the suffix and just shows the model name. + ## [0.2.0] - 2026-06-09 ### Added diff --git a/static/index.html b/static/index.html index 53bbfd1..66207d5 100644 --- a/static/index.html +++ b/static/index.html @@ -418,6 +418,10 @@ if (!expiresAt) return null; const ms = new Date(expiresAt).getTime() - Date.now(); if (!isFinite(ms) || ms <= 0) return null; + // Ollama's keep_alive=-1 returns expires_at far in the future (year 4001). + // Any realistic finite keep_alive is hours at most, so treat >7 days + // as "never unloads" and drop the misleading suffix. + if (ms > 7 * 24 * 60 * 60 * 1000) return null; const totalSec = Math.floor(ms / 1000); const mins = Math.floor(totalSec / 60); const secs = totalSec % 60;