From 1f24d8ccf578783ecbc74719baffd4f6781e567b Mon Sep 17 00:00:00 2001 From: Loki Date: Sat, 15 Aug 2026 08:37:48 +0000 Subject: [PATCH] =?UTF-8?q?S=C3=A9lecteur=20de=20moteur=20par=20mod=C3=A8l?= =?UTF-8?q?e=20:=20=C2=AB=20Image=20=C2=BB=20en=20conteneur,=20et=20mentio?= =?UTF-8?q?n=20du=20fork?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le sélecteur de l'éditeur de modèle proposait encore « Précompilé » et « Compilé » — deux installations que Loki ne fait pas en conteneur : cliquer répondait « installez d'abord llama.cpp… ». Pire, le moteur de l'image ne correspondant à aucun des deux, il était classé « Personnalisé ». En conteneur, ces deux options laissent place à « Image » (sélectionnée par défaut, y compris pour un preset sans BIN) ; « Personnalisé » reste pour un binaire déposé dans /data/backends. Le moteur de l'image est désormais déclaré par l'image elle-même via LOKI_ENGINE_BIN (Dockerfile + entrypoint) au lieu d'être deviné d'après le chemin : /api/llamacpp expose provided et provided_bin. Attribution : sous le nom Loki, « fork de AJEAN » avec lien vers le dépôt d'origine. Vérifié dans l'image : provided=true, provided_bin=/app/llama-server, BIN semé identique ; build, vet et tests verts. --- Dockerfile | 1 + docker-entrypoint.sh | 2 +- internal/loki/ui/index.html | 37 ++++++++++++++++++++---- internal/loki/ui/src/index.tmpl.html | 9 ++++-- internal/loki/ui/src/js/07-models.js | 21 ++++++++++++-- internal/loki/ui/src/styles.css | 7 ++++- internal/loki/web_llamacpp.go | 42 ++++++++++++++++------------ 7 files changed, 88 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39c7b38..6b003b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,7 @@ RUN chmod +x /usr/local/bin/docker-entrypoint.sh && mkdir -p /data /models ENV LOKI_CONTAINER=1 \ LOKI_HOME=/data \ LOKI_MODEL_DIRS=/models \ + LOKI_ENGINE_BIN=/app/llama-server \ LD_LIBRARY_PATH=/app \ NVIDIA_VISIBLE_DEVICES=all \ NVIDIA_DRIVER_CAPABILITIES=compute,utility diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4b926d6..18cd143 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,7 +9,7 @@ mkdir -p "$LOKI_HOME" # Le chemin du moteur est imposé par l'image (llama-server précompilé de # l'image officielle llama.cpp, dans /app) : on le (re)pose à chaque boot, # une mise à jour de l'image ne doit pas laisser un BIN obsolète en base. -loki config set "BIN=/app/llama-server" +loki config set "BIN=${LOKI_ENGINE_BIN:-/app/llama-server}" # Les autres clés ne sont semées QUE si absentes : ce que l'utilisateur règle # ensuite dans l'UI (modèle, contexte…) est conservé d'un redémarrage à l'autre. diff --git a/internal/loki/ui/index.html b/internal/loki/ui/index.html index 9018665..5fd1a05 100644 --- a/internal/loki/ui/index.html +++ b/internal/loki/ui/index.html @@ -133,7 +133,12 @@ h1{margin:0;font-size:18px;color:var(--accent)} #brand svg{height:10px;width:auto;display:block;shape-rendering:crispEdges;fill:currentColor} #brand-word{display:inline-flex;color:var(--accent)} #ver{font-size:10px;font-weight:400;color:var(--dim);margin-left:7px;letter-spacing:0;align-self:flex-end;line-height:1;position:relative;top:1px} -.sidehead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px} +.sidehead{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px} +/* Attribution : Loki est un fork d'AJEAN (MIT). Discrète mais permanente, et le + nom du projet d'origine renvoie à son dépôt. */ +.brand-fork{font-size:10px;color:var(--dim);margin:0 0 14px;line-height:1.3} +.brand-fork a{color:var(--dim);text-decoration:underline;text-underline-offset:2px} +.brand-fork a:hover{color:var(--accent)} /* pastille d'état service, en haut à droite de la barre latérale */ .statuspill{display:inline-flex;align-items:center;gap:6px;font-size:11px;padding:3px 10px;border-radius:999px;border:1px solid var(--border);background:var(--panel);color:var(--dim);font-weight:600;white-space:nowrap;cursor:pointer} .statuspill.ok{color:var(--ok);border-color:color-mix(in srgb,var(--ok) 45%,transparent);background:color-mix(in srgb,var(--ok) 12%,transparent)} @@ -1207,6 +1212,7 @@ button:hover{border-color:var(--dim);color:var(--text)}

… +
fork de AJEAN
@@ -1839,9 +1845,13 @@ button:hover{border-color:var(--dim);color:var(--text)}
Moteur
+
- - + + +
+
fork de AJEAN
@@ -669,9 +670,13 @@
Moteur
+
- - + + +