feat(api): config + role→model routing (qwen3.5 narrator default, think off)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-10 08:08:56 -05:00
parent ea2cfafd34
commit 42b3720721
3 changed files with 68 additions and 0 deletions

21
api/tests/test_routing.py Normal file
View File

@@ -0,0 +1,21 @@
import pytest
from app.routing import for_role
def test_narrator_defaults():
cfg = for_role("narrator")
assert cfg.model == "qwen3.5:latest"
assert cfg.think is False
assert cfg.options["num_predict"] == 300
assert cfg.options["temperature"] == 0.8
def test_env_overrides_model(monkeypatch):
monkeypatch.setenv("OLLAMA_NARRATOR_MODEL", "llama3.1:latest")
assert for_role("narrator").model == "llama3.1:latest"
def test_unknown_role_raises():
with pytest.raises(KeyError):
for_role("wizard")