fix: env var overrides for campaign settings (hf_token, ollama_host etc)
Some checks failed
Build and Push / build (push) Has been cancelled

This commit is contained in:
KansaiGaijin
2026-07-21 18:30:08 +12:00
parent ca13989ca0
commit 9e70b78d7c
6 changed files with 45 additions and 12 deletions

View File

@@ -2,6 +2,7 @@ import requests
from fastapi import APIRouter, Query
from .. import database as db
from ..config import merge_campaign_settings_with_env
router = APIRouter(prefix="/api/models", tags=["models"])
@@ -10,7 +11,7 @@ router = APIRouter(prefix="/api/models", tags=["models"])
def list_ollama_models(campaign_id: str = Query("default")):
"""List models already pulled on the configured Ollama host, so the setup
wizard can offer a dropdown instead of asking the user to type a tag blind."""
settings = db.get_campaign_settings(campaign_id)
settings = merge_campaign_settings_with_env(db.get_campaign_settings(campaign_id))
host = settings.get("ollama_host", "http://host.docker.internal:11434")
try:
resp = requests.get(f"{host.rstrip('/')}/api/tags", timeout=5)