up
This commit is contained in:
parent
f083fc1358
commit
5f2d03d06c
17
Dockerfile
17
Dockerfile
@ -1,7 +1,8 @@
|
|||||||
|
# Variante 1 (ta base actuelle)
|
||||||
FROM quay.io/go-skynet/local-ai:latest
|
FROM quay.io/go-skynet/local-ai:latest
|
||||||
|
|
||||||
# Utiliser bash pour les heredocs propres
|
# (facultatif) si l'image ne contient pas curl :
|
||||||
SHELL ["/bin/bash", "-lc"]
|
# RUN apk add --no-cache curl || (apt-get update && apt-get install -y curl ca-certificates)
|
||||||
|
|
||||||
ENV MODELS_PATH=/models \
|
ENV MODELS_PATH=/models \
|
||||||
DEBUG=false \
|
DEBUG=false \
|
||||||
@ -11,15 +12,15 @@ ENV MODELS_PATH=/models \
|
|||||||
# Crée le dossier des modèles
|
# Crée le dossier des modèles
|
||||||
RUN mkdir -p /models
|
RUN mkdir -p /models
|
||||||
|
|
||||||
# Télécharge un **petit modèle chat** (TinyLlama 1.1B, quantisé Q4) au **build**
|
# Télécharge un petit modèle chat (TinyLlama 1.1B quantisé Q4) AU BUILD
|
||||||
# -> Il sera **embarqué** dans l'image finale. Aucune connexion réseau n'est
|
# => Embarqué dans l'image, pas besoin de réseau à l'exécution pour ce fichier.
|
||||||
# nécessaire **à l'exécution**.
|
|
||||||
RUN curl -L --fail --progress-bar \
|
RUN curl -L --fail --progress-bar \
|
||||||
-o /models/tinyllama-1.1b-chat.Q4_K_M.gguf \
|
-o /models/tinyllama-1.1b-chat.Q4_K_M.gguf \
|
||||||
https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf
|
https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF/resolve/main/tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf
|
||||||
|
|
||||||
# Génère le mapping YAML du modèle exposé sous le nom "gpt-oss-20b"
|
# IMPORTANT : on utilise un heredoc NON quoted (<<YAML) pour EXPANSION des variables
|
||||||
RUN cat > /models/gpt-oss-20b.yaml <<'YAML'
|
# (n_ctx/n_threads prendront les valeurs de CONTEXT_SIZE/THREADS AU BUILD)
|
||||||
|
RUN cat > /models/gpt-oss-20b.yaml <<YAML
|
||||||
name: gpt-oss-20b
|
name: gpt-oss-20b
|
||||||
backend: llama
|
backend: llama
|
||||||
parameters:
|
parameters:
|
||||||
@ -30,4 +31,4 @@ parameters:
|
|||||||
top_p: 0.9
|
top_p: 0.9
|
||||||
YAML
|
YAML
|
||||||
|
|
||||||
# Le démarrage du serveur est piloté par docker-compose via `command`
|
# Le démarrage du serveur est piloté par docker-compose via `command`
|
||||||
|
|||||||
@ -1,19 +1,23 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
localai:
|
localai:
|
||||||
build: .
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
container_name: localai
|
container_name: localai
|
||||||
ports:
|
ports:
|
||||||
- "8085:8080"
|
- "8085:8080" # accès direct: http://<hôte>:8085
|
||||||
environment:
|
environment:
|
||||||
- MODELS_PATH=/models
|
- MODELS_PATH=/models
|
||||||
- THREADS=8 # ajustez selon vos cores (léger par défaut)
|
- THREADS=8 # adapte au nombre de cœurs
|
||||||
- CONTEXT_SIZE=2048 # contexte réduit pour tests
|
- CONTEXT_SIZE=2048 # augmente si tu as plus de RAM
|
||||||
- DEBUG=false
|
- DEBUG=false
|
||||||
- DISABLE_DOWNLOAD=false
|
- DISABLE_DOWNLOAD=false # laisse LocalAI récupérer le backend llama-cpp au 1er run
|
||||||
command: ["--models-path", "/models", "--address", "0.0.0.0:8080"]
|
command: ["--models-path", "/models", "--address", "0.0.0.0:8080"]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-fsS", "http://localhost:8080/v1/models"]
|
test: ["CMD", "curl", "-fsS", "http://localhost:8080/v1/models"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
restart: unless-stopped
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user