Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

docker: GGUF_DIR, RESIDENT_BUDGET_GIB and KV_STREAMING env vars; document the stop timeout

mad9home3e14442811fb
diff --git a/Dockerfile b/Dockerfile
index 6b62dae0e..a95d47e5d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -24,7 +24,8 @@
#
# Setup choices are env vars, read by docker-entrypoint.sh: FAMILY, MODEL, CONTEXT,
# VISION (no | yes | cpu), KV (int8 | q4_0 | k8v4), GPU (one card) or GPUS ("0,2"
-# or "all", with LAYER_SPLIT), LOW_RAM (auto | on | off), HOST, PORT, API_KEY.
+# or "all", with LAYER_SPLIT), LOW_RAM (auto | on | off), HOST, PORT, API_KEY,
+# GGUF_DIR (GGUF files you already have), RESIDENT_BUDGET_GIB, KV_STREAMING.
#
# Only the model files, the prepared pack, the MTP layer and the install config
# live in the /data volume; the engine is part of the image. Strata loads 32-62 GB
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index f167bed0b..d20ccdc9a 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -19,6 +19,9 @@ GPUS="${GPUS:-}" # "0,2" or "all": one model across several cards
GPU="${GPU:-}" # one card, numbered as nvidia-smi numbers them
LAYER_SPLIT="${LAYER_SPLIT:-}" # with GPUS: where each later card's layers start (default: auto)
LOW_RAM="${LOW_RAM:-auto}" # on: the experts come from the pack's experts.bin, not from RAM
+GGUF_DIR="${GGUF_DIR:-}" # a mounted folder with GGUF files you already have: no download
+RESIDENT_BUDGET_GIB="${RESIDENT_BUDGET_GIB:-}" # UD-Q4_K_XL: GiB of experts kept in RAM (default: setup's pick)
+KV_STREAMING="${KV_STREAMING:-}" # auto | on | off; empty: setup.py's own default (auto)
# setup.py starts the newest strata-*.json it finds, so link in exactly the one
# this family and model were set up with. The config is the recorded output of
@@ -38,7 +41,11 @@ mkdir -p "$STRATA_DATA/config"
# from /proc/meminfo, which in a container is the host's total, not the container's
# limit, so a memory-capped container has to ask for the low-RAM mode itself.
if [ "${REINSTALL:-0}" = "1" ] || [ ! -f "$cfg" ]; then
- echo "Setting up $tag: downloading the model (~70 GB; the engine is already in the image)."
+ if [ -n "$GGUF_DIR" ]; then
+ echo "Setting up $tag from the GGUF files in $GGUF_DIR (the engine is already in the image)."
+ else
+ echo "Setting up $tag: downloading the model (~70 GB; the engine is already in the image)."
+ fi
set -- --family "$FAMILY" --model "$MODEL" --context "$CONTEXT" --vision "$VISION" \
--data-dir "$STRATA_DATA" --host "$HOST" --api-key "$API_KEY" \
--port "$PORT" --no-start --low-ram "$LOW_RAM"
@@ -46,6 +53,9 @@ if [ "${REINSTALL:-0}" = "1" ] || [ ! -f "$cfg" ]; then
if [ -n "$GPUS" ]; then set -- "$@" --gpus "$GPUS"; fi
if [ -n "$GPU" ]; then set -- "$@" --gpu "$GPU"; fi
if [ -n "$LAYER_SPLIT" ]; then set -- "$@" --layer-split "$LAYER_SPLIT"; fi
+ if [ -n "$GGUF_DIR" ]; then set -- "$@" --gguf-dir "$GGUF_DIR"; fi
+ if [ -n "$RESIDENT_BUDGET_GIB" ]; then set -- "$@" --resident-budget-gib "$RESIDENT_BUDGET_GIB"; fi
+ if [ -n "$KV_STREAMING" ]; then set -- "$@" --kv-streaming "$KV_STREAMING"; fi
.venv/bin/python setup.py --setup --yes "$@"
[ -e "/opt/strata/strata-$tag.json" ] && { cmp -s "/opt/strata/strata-$tag.json" "$cfg" || cp -f "/opt/strata/strata-$tag.json" "$cfg"; }
else
diff --git a/docs/INSTALL.md b/docs/INSTALL.md
index 05b1035d2..fb1f32fd7 100644
--- a/docs/INSTALL.md
+++ b/docs/INSTALL.md
@@ -120,6 +120,15 @@ The same idea, in a container (NVIDIA cards).
The server listens on `0.0.0.0:8080` by default; set `-e API_KEY=<secret>` before exposing the port
to a network. The image has a `HEALTHCHECK` on `/health`, so `docker ps` shows the container
healthy once the model is loaded, and `GET /v1/status` says what it is running.
+ Model files you already have (setup's `--gguf-dir`): mount their folder and name it, e.g.
+ `-v /models/UD-Q4_K_XL:/gguf -e GGUF_DIR=/gguf -e FAMILY=unsloth -e MODEL=UD-Q4_K_XL`.
+ Mount it writable for the first start: setup checks the Unsloth file's SHA-256 once and keeps the
+ result as `<shard>.done` next to each shard; later starts skip setup, so `:ro` is fine then.
+ `-e RESIDENT_BUDGET_GIB=N` and `-e KV_STREAMING=on|off|auto` pass setup's `--resident-budget-gib`
+ and `--kv-streaming` (with `REINSTALL=1` for a model already set up).
+ Stopping: the engine releases its page-locked RAM (tens of GB) on SIGTERM, which takes longer than
+ Docker's default 10 s; give it time, or `docker stop` kills it (exit 137):
+ `docker run --stop-timeout 60 ...`, `docker stop -t 60 <name>`, or `stop_grace_period: 60s` in Compose.
## Older CPUs (experimental)