Compare commits

...

1 Commits

Author SHA1 Message Date
fed52c57c7 fix: correct model fallback verification for custom providers
Some checks failed
Architecture Lint / Linter Tests (pull_request) Successful in 21s
Smoke Test / smoke (pull_request) Failing after 21s
Validate Config / YAML Lint (pull_request) Failing after 17s
Validate Config / JSON Validate (pull_request) Successful in 19s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 1m4s
Validate Config / Python Test Suite (pull_request) Has been skipped
Validate Config / Shell Script Lint (pull_request) Failing after 1m9s
Validate Config / Cron Syntax Check (pull_request) Successful in 12s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 15s
Validate Config / Playbook Schema Validation (pull_request) Successful in 25s
Architecture Lint / Lint Repository (pull_request) Failing after 18s
PR Checklist / pr-checklist (pull_request) Successful in 3m9s
- Fix base_url lookup for custom provider: use model.base_url or custom_providers
- Remove colon heuristic: only ollama provider uses Ollama API path
  The colon check incorrectly routed custom models (hermes4:14b) to Ollama API,
  causing verification failures for llama.cpp servers.

Closes #514
2026-04-29 17:25:28 -04:00

View File

@@ -121,7 +121,7 @@ def test_model(model, provider, api_key=None, base_url=None):
Test a model with a verification prompt. Test a model with a verification prompt.
Returns (success, response, error_message) Returns (success, response, error_message)
""" """
if provider == "ollama" or ":" in model: if provider == "ollama":
# Local Ollama model # Local Ollama model
ollama_host = os.environ.get("OLLAMA_HOST", "localhost:11434") ollama_host = os.environ.get("OLLAMA_HOST", "localhost:11434")
try: try:
@@ -306,8 +306,16 @@ def run_verification():
base_url = None base_url = None
if provider == "custom": if provider == "custom":
provider_config = config.get("auxiliary", {}).get("vision", {}) # Prefer base_url from primary model config if present
base_url = provider_config.get("base_url") model_cfg = config.get("model", {})
if isinstance(model_cfg, dict) and model_cfg.get("provider") == "custom":
base_url = model_cfg.get("base_url")
if not base_url:
# Fallback: search custom_providers by matching model name
for p in config.get("custom_providers", []):
if p.get("model") == model:
base_url = p.get("base_url")
break
log("Testing [" + role + "] " + model + " (" + provider + ")...") log("Testing [" + role + "] " + model + " (" + provider + ")...")
result = verify_model(model, provider, api_key, base_url) result = verify_model(model, provider, api_key, base_url)