feat(realism/llm): GET/PUT /api/v1/realism/llm + worker hot-reload tick

This commit is contained in:
2026-05-09 23:12:29 -04:00
parent 155ab59ee8
commit 41b8e9b7b3
5 changed files with 460 additions and 2 deletions

View File

@@ -83,8 +83,14 @@ def apply(cfg: LLMConfig) -> None:
if cfg.provider == "ollama":
api_key: Optional[str] = None
if cfg.api_key_ciphertext:
from decnet.web.db.secrets import decrypt_secret
api_key = decrypt_secret(cfg.api_key_ciphertext)
try:
from decnet.web.db.secrets import decrypt_secret
api_key = decrypt_secret(cfg.api_key_ciphertext)
except RuntimeError as exc:
log.warning(
"realism.llm.config: DECNET_SECRET_KEY unavailable, "
"api_key will not be passed to backend: %s", exc,
)
from decnet.realism.llm.impl.ollama import OllamaBackend
_cached_backend = OllamaBackend(