diff --git a/src/fabledassistant/config.py b/src/fabledassistant/config.py index e15a364..8897fda 100644 --- a/src/fabledassistant/config.py +++ b/src/fabledassistant/config.py @@ -24,9 +24,10 @@ class Config: ) OLLAMA_URL: str = os.environ.get("OLLAMA_URL", "http://localhost:11434") OLLAMA_MODEL: str = os.environ.get("OLLAMA_MODEL", "qwen3:latest") - # KV cache context window for generation. Higher = more RAM usage but longer inputs/outputs. - # 131072 is the practical maximum for most models. Lower this on RAM-constrained hosts. - OLLAMA_NUM_CTX: int = int(os.environ.get("OLLAMA_NUM_CTX", "65536")) + # KV cache context window for generation. Keep this as small as practical — + # a larger context forces more KV cache into CPU RAM, drastically slowing prefill. + # 16384 covers ~30+ message conversations with our system prompt comfortably. + OLLAMA_NUM_CTX: int = int(os.environ.get("OLLAMA_NUM_CTX", "16384")) SECRET_KEY: str = _read_secret("SECRET_KEY", "SECRET_KEY_FILE", "dev-secret-change-me") SECURE_COOKIES: bool = os.environ.get("SECURE_COOKIES", "").lower() in ("1", "true", "yes") LOG_LEVEL: str = os.environ.get("LOG_LEVEL", "INFO")