From 2c5f7f6ebe5a97cf180dcbb2ce6d0bcc0b5e624f Mon Sep 17 00:00:00 2001 From: Rene Fichtmueller Date: Thu, 2 Apr 2026 23:05:13 +0200 Subject: [PATCH] fix: OLLAMA_URL env var takes precedence over hardcoded models.yaml URL Gateway was reading ollama_base_url from YAML (192.168.178.169) instead of OLLAMA_URL env var (https://ollama.fichtmueller.org). Fix getOllamaBaseUrl() to prefer process.env['OLLAMA_URL'] and update YAML default to CF tunnel. --- packages/gateway/src/config/models.yaml | 2 +- packages/gateway/src/pipeline/router.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/gateway/src/config/models.yaml b/packages/gateway/src/config/models.yaml index dc4b319..6945091 100644 --- a/packages/gateway/src/config/models.yaml +++ b/packages/gateway/src/config/models.yaml @@ -1,7 +1,7 @@ # LLM Gateway Model Configuration # Ollama base URL: http://192.168.178.169:11434 -ollama_base_url: "http://192.168.178.169:11434" +ollama_base_url: "https://ollama.fichtmueller.org" tiers: fast: diff --git a/packages/gateway/src/pipeline/router.ts b/packages/gateway/src/pipeline/router.ts index 607965b..f6be0ff 100644 --- a/packages/gateway/src/pipeline/router.ts +++ b/packages/gateway/src/pipeline/router.ts @@ -168,6 +168,9 @@ export function getModelTier(model: string): 'fast' | 'medium' | 'large' { } export function getOllamaBaseUrl(): string { + // OLLAMA_URL env var takes precedence over config file + const envUrl = process.env['OLLAMA_URL']; + if (envUrl) return envUrl; const models = loadModels(); return models.ollama_base_url; }