From 98c7c8cae271d80d1517bbd35aa941f4e382ec5e Mon Sep 17 00:00:00 2001 From: BlackAngelTV Date: Mon, 5 Oct 2026 20:40:12 +0200 Subject: [PATCH] feat(backend): accept OLLAMA_HOST as an alias for OLLAMA_URL Match the environment variable used throughout the Ollama ecosystem. --- backend/.env.example | 3 ++- backend/src/config.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index d2c7b36..46001da 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -22,6 +22,7 @@ RATE_LIMIT_MAX=300 RATE_LIMIT_WINDOW=60000 # Ollama (le moteur qui fait tourner Jarvis) +# OLLAMA_HOST est aussi accepté (variable standard de l'écosystème Ollama). OLLAMA_URL=http://localhost:11434 -OLLAMA_MODEL=llama3.2 +OLLAMA_MODEL=qwen2.5:3b # JARVIS_SYSTEM_PROMPT=Tu es Jarvis... diff --git a/backend/src/config.js b/backend/src/config.js index c71fb55..42cf8d5 100644 --- a/backend/src/config.js +++ b/backend/src/config.js @@ -61,7 +61,12 @@ export function loadConfig(overrides = {}) { expiresIn: overrides.jwtExpiresIn ?? process.env.JWT_EXPIRES_IN ?? '7d', }, ollama: { - url: (overrides.ollamaUrl ?? process.env.OLLAMA_URL ?? 'http://localhost:11434').replace(/\/+$/, ''), + url: ( + overrides.ollamaUrl ?? + process.env.OLLAMA_URL ?? + process.env.OLLAMA_HOST ?? + 'http://localhost:11434' + ).replace(/\/+$/, ''), model: overrides.ollamaModel ?? process.env.OLLAMA_MODEL ?? 'llama3.2', systemPrompt: overrides.systemPrompt ??