Ollama drops an idle model after five minutes by default, so the first question after a pause pays the whole several-second load. Every chat request now carries keep_alive (30 minutes by default) and POST /api/chat/warm loads the weights on demand, letting a client wake the model while the user is still writing. A warm-up that fails answers warmed=false instead of an error: it is an optimisation, not a step the answer depends on.
31 lines
977 B
Bash
31 lines
977 B
Bash
# Copier ce fichier en `.env` puis adapter les valeurs.
|
|
|
|
# Environnement : development | production | test
|
|
NODE_ENV=development
|
|
|
|
# Serveur HTTP
|
|
PORT=3000
|
|
HOST=0.0.0.0
|
|
|
|
# Secret de signature des JWT (OBLIGATOIRE : mets une longue chaîne aléatoire)
|
|
JWT_SECRET=change-moi-par-un-secret-long-et-aleatoire
|
|
JWT_EXPIRES_IN=7d
|
|
|
|
# Base de données SQLite (chemin relatif au dossier backend)
|
|
DB_PATH=./data/jarvise.db
|
|
|
|
# CORS : origine(s) autorisée(s). "*" pour tout, ou une liste séparée par des virgules.
|
|
CORS_ORIGIN=*
|
|
|
|
# Limitation de débit (par IP) : requêtes max sur une fenêtre en ms (60000 = 1 min)
|
|
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=qwen2.5:3b
|
|
# Durée pendant laquelle Ollama garde le modèle en mémoire après le dernier appel
|
|
OLLAMA_KEEP_ALIVE=30m
|
|
# JARVIS_SYSTEM_PROMPT=Tu es Jarvis...
|