wrolpi/modules/ai
Roland 32e0f69abc
ai: only list custom GGUFs llama-server can load; reset context on custom select
Review found two gaps in the custom-model listing.

Any *.gguf basename was listed and accepted, but start_llama_server.sh
reads active_model back out of ai.yaml through read_config_value.sh.
PyYAML dumps non-ASCII as escapes the reader prints literally, the
reader strips " #..." before unquoting, and the start script's
traversal guard rejects any ".." run. Those names got a 200 from the
API and then "Model file does not exist" at startup. A shared
is_loadable_model_name check now filters the catalog loop and rejects
the name in manage_settings, so the UI never shows an activation that
cannot start. Directories named *.gguf are skipped too.

Selecting a custom model after a catalog model kept the previous
model's explicit context_size (e.g. 16384 from the 4B) because the
adopt branch was skipped when there was no catalog default. The
default is now always written on model selection, so a custom model
resets to null and the conservative default applies. The hint text
says so instead of claiming the default is used unconditionally.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-24 13:49:37 -06:00
..
test ai: only list custom GGUFs llama-server can load; reset context on custom select 2026-09-24 13:49:37 -06:00
__init__.py ai: package llama-server for all three deployments, with idle unload 2026-09-13 20:10:16 -06:00
agent.py ai: the /api/chat agent loop — SSE streaming, modes, tool execution 2026-09-13 20:10:16 -06:00
api.py ai: only list custom GGUFs llama-server can load; reset context on custom select 2026-09-24 13:49:37 -06:00
catalog.py ai: only list custom GGUFs llama-server can load; reset context on custom select 2026-09-24 13:49:37 -06:00
chat.py ai: ground answers in a live library map, budget the context 2026-09-13 20:10:17 -06:00
config.py ai: ground answers in a live library map, budget the context 2026-09-13 20:10:17 -06:00
conftest.py ai: ai.yaml config, model catalog, and the GGUF downloader 2026-09-13 20:10:15 -06:00
context.py ai: kind-generic search_files / get_file / read_content 2026-09-13 20:10:18 -06:00
controller_client.py ai: package llama-server for all three deployments, with idle unload 2026-09-13 20:10:16 -06:00
downloader.py ai: ai.yaml config, model catalog, and the GGUF downloader 2026-09-13 20:10:15 -06:00
errors.py ai: system endpoints — aggregate status, services, logs, disks 2026-09-13 20:10:15 -06:00
help_docs.py ai: live-chat fixes from first real-model run 2026-09-13 20:10:16 -06:00
lib.py ai: research mode runs on the compact tool catalog 2026-09-13 20:10:18 -06:00
modes.py ai: research mode runs on the compact tool catalog 2026-09-13 20:10:18 -06:00
schema.py ai: research mode runs on the compact tool catalog 2026-09-13 20:10:18 -06:00
service.py ai: package llama-server for all three deployments, with idle unload 2026-09-13 20:10:16 -06:00