mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 03:46:29 -05:00
ai: ai.yaml config, model catalog, and the GGUF downloader
ai.yaml is the source of truth (opt-in: enabled=False by default) with active model, idle-unload minutes, context override, and tool-call bound. The model catalog follows the map pattern: a bundled constant keeps the Manage tab working offline, the CDN manifest (ai/models.json + detached GPG signature) wins when reachable. GGUF downloads clone the map-extract flow — the per-file meta4 is GPG-verified once and the same bytes handed to aria2c, so the verified hash is the enforced one; unverified downloads are refused. Models land in <media>/ai/models/ (gated by the existing media_mounted download rules). Manage endpoints (catalog with RAM-tier recommendation, settings) live under /api/ai/manage/ which the future agent loop excludes from its tool catalog. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
c837c1a268
commit
164e98553d
10 changed files with 593 additions and 3 deletions
|
|
@ -1,3 +1,17 @@
|
|||
# AI module test fixtures. The docs conftest is not star-imported by the root conftest, but the
|
||||
# AI endpoints cover docs; import its fixtures so AI tests can use doc_factory.
|
||||
import pytest
|
||||
|
||||
from modules.ai.config import ai_config_context
|
||||
from modules.docs.conftest import * # noqa
|
||||
from wrolpi.api_utils import api_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_ai_config(test_directory, async_client):
|
||||
"""An isolated ai.yaml config for one test."""
|
||||
(test_directory / 'config').mkdir(exist_ok=True)
|
||||
config_path = test_directory / 'config/ai.yaml'
|
||||
with ai_config_context() as config:
|
||||
config.initialize(api_app.shared_ctx.ai_config)
|
||||
yield config_path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue