feat: make Ollama model configurable via OLLAMA_MODEL env var

- Add OLLAMA_MODEL setting to shared config (default: qwen3:32b)
- LLM router reads from settings instead of hardcoded model name
- Create .env file with all configurable settings documented
- docker-compose passes OLLAMA_MODEL to llm-pool container

To change the model: edit OLLAMA_MODEL in .env and restart llm-pool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 13:22:18 -06:00
parent 22c6a44ff6
commit ebf6e76174
3 changed files with 11 additions and 6 deletions

View File

@@ -66,9 +66,10 @@ services:
environment: environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-} - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- OPENAI_API_KEY=${OPENAI_API_KEY:-} - OPENAI_API_KEY=${OPENAI_API_KEY:-}
- OLLAMA_BASE_URL=http://host.docker.internal:11434 - OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
- OLLAMA_MODEL=${OLLAMA_MODEL:-qwen3:32b}
- REDIS_URL=redis://redis:6379/0 - REDIS_URL=redis://redis:6379/0
- LOG_LEVEL=INFO - LOG_LEVEL=${LOG_LEVEL:-INFO}
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8004/health || exit 1"] test: ["CMD-SHELL", "curl -sf http://localhost:8004/health || exit 1"]

View File

@@ -32,7 +32,7 @@ _model_list: list[dict] = [
{ {
"model_name": "local", "model_name": "local",
"litellm_params": { "litellm_params": {
"model": "ollama/qwen3:32b", "model": f"ollama/{settings.ollama_model}",
"api_base": settings.ollama_base_url, "api_base": settings.ollama_base_url,
}, },
}, },
@@ -40,7 +40,7 @@ _model_list: list[dict] = [
{ {
"model_name": "fast", "model_name": "fast",
"litellm_params": { "litellm_params": {
"model": "ollama/qwen3:32b", "model": f"ollama/{settings.ollama_model}",
"api_base": settings.ollama_base_url, "api_base": settings.ollama_base_url,
}, },
}, },
@@ -48,7 +48,7 @@ _model_list: list[dict] = [
{ {
"model_name": "economy", "model_name": "economy",
"litellm_params": { "litellm_params": {
"model": "ollama/qwen3:32b", "model": f"ollama/{settings.ollama_model}",
"api_base": settings.ollama_base_url, "api_base": settings.ollama_base_url,
}, },
}, },
@@ -56,7 +56,7 @@ _model_list: list[dict] = [
{ {
"model_name": "balanced", "model_name": "balanced",
"litellm_params": { "litellm_params": {
"model": "ollama/qwen3:32b", "model": f"ollama/{settings.ollama_model}",
"api_base": settings.ollama_base_url, "api_base": settings.ollama_base_url,
}, },
}, },

View File

@@ -112,6 +112,10 @@ class Settings(BaseSettings):
default="http://localhost:11434", default="http://localhost:11434",
description="Ollama inference server base URL", description="Ollama inference server base URL",
) )
ollama_model: str = Field(
default="qwen3:32b",
description="Ollama model to use for local inference (e.g., qwen3:32b, llama3.1:70b)",
)
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Auth / Security # Auth / Security