wrolpi/modules/ai
Roland 861e183bd2
ai: cache the models manifest, skip it offline, show a loading state
The Manage tab fetched the CDN manifest and its signature on every
catalog request with a 30s timeout each, and the tab polls every 30s.
On a black-holed or offline network every poll paid up to 60s before
falling back to the bundled list, the frontend's 60s limit threw the
response away, and the tab showed a blank page the whole time.

get_models_catalog now skips the CDN while the have_internet flag is
explicitly clear, reuses the last attempt (success or failure) for an
hour, and uses a 5s timeout for the 2KB manifest. A skipped attempt is
not cached so the CDN is tried as soon as internet comes up. The cache
is per process and is cleared between tests by an autouse fixture.

The Manage tab shows "Loading the model catalog" while the first
response is pending, and on failure shows the error with a Retry
button and a note that the API may still be starting, instead of
rendering nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 18:28:11 -06:00
..
test ai: cache the models manifest, skip it offline, show a loading state 2026-09-24 18:28:11 -06:00
__init__.py ai: package llama-server for all three deployments, with idle unload 2026-09-24 18:23:21 -06:00
agent.py ai: the /api/chat agent loop — SSE streaming, modes, tool execution 2026-09-24 18:23:21 -06:00
api.py ai: list custom GGUF files in the Manage tab (#720) 2026-09-24 18:23:27 -06:00
catalog.py ai: cache the models manifest, skip it offline, show a loading state 2026-09-24 18:28:11 -06:00
chat.py ai: ground answers in a live library map, budget the context 2026-09-24 18:23:24 -06:00
config.py ai: ground answers in a live library map, budget the context 2026-09-24 18:23:24 -06:00
conftest.py ai: cache the models manifest, skip it offline, show a loading state 2026-09-24 18:28:11 -06:00
context.py ai: kind-generic search_files / get_file / read_content 2026-09-24 18:23:26 -06:00
controller_client.py ai: package llama-server for all three deployments, with idle unload 2026-09-24 18:23:21 -06:00
downloader.py ai: ai.yaml config, model catalog, and the GGUF downloader 2026-09-24 18:23:21 -06:00
errors.py ai: system endpoints — aggregate status, services, logs, disks 2026-09-24 18:23:21 -06:00
help_docs.py ai: live-chat fixes from first real-model run 2026-09-24 18:23:23 -06:00
lib.py ai: research mode runs on the compact tool catalog 2026-09-24 18:23:26 -06:00
modes.py ai: research mode runs on the compact tool catalog 2026-09-24 18:23:26 -06:00
schema.py ai: research mode runs on the compact tool catalog 2026-09-24 18:23:26 -06:00
service.py ai: package llama-server for all three deployments, with idle unload 2026-09-24 18:23:21 -06:00