한국어 | Kubernetes | Installation
The release workflow publishes a CUDA 13 container image of mlxcel and mlxcel-server to ghcr.io/lablup/mlxcel, one manifest list for linux/amd64 and linux/arm64. It needs an NVIDIA GPU; there is no CPU, Apple Silicon or ROCm image. The image is built from docker/Dockerfile.cuda and carries the binaries of the GitHub release with the same tag, downloaded and checked against their .sha256 at build time.
| Tag | Contents | Moves |
|---|---|---|
vX.Y.Z-cuda13 |
runtime image of release vX.Y.Z (also prereleases such as vX.Y.Z-rc.1-cuda13) |
never |
vX.Y.Z-cuda13-debug |
debug image of the same release | never |
vX.Y-cuda13, vX.Y-cuda13-debug |
newest stable vX.Y.Z of that minor line |
on each stable full release that is the newest of its line |
latest-cuda13, latest-cuda13-debug |
newest stable full release | on each stable full release that is the newest overall |
A release gets images only when both of its Linux CUDA builds succeed. A prerelease (any -suffix) and a manual workflow run get only the versioned tags. Images exist only for releases whose tag tree contains docker/Dockerfile.cuda and the publish scripts, which rules out every tag up to and including v0.9.0-beta.3; the first image is published with v0.9.0. Pin a versioned tag (or a digest) in production; the moving tags point at a different image after each qualifying release.
Each image carries BuildKit SBOM and provenance attestations and a GitHub build provenance attestation:
gh attestation verify oci://ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 --repo lablup/mlxcelGitHub creates a container package private on its first push, and the maintainers then make it public once in the package settings. If docker pull answers denied or unauthorized for a tag the releases page lists, the package is still private: report it, or docker login ghcr.io with a token that has read:packages and can see the package.
runtime(the default tags) is a chiseled Ubuntu root filesystem with no shell, no package manager and no HTTP client. It holds/opt/mlxcel/{bin,include,lib,share}, the shared libraries the binaries load, and in/usr/local/cuda/includeexactly the CUDA headers inscripts/ci/nvrtc_header_allowlist.txt, which is what the kernel JIT reads./opt/mlxcel/sharehasLICENSE,NOTICE,cuda-packages.txt(the NVIDIA package versions) and the OpenBLAScopyrightfiles.debug(-debugtags) is NVIDIA'snvidia/cudacudnn-develimage with the same binaries, user, environment and entrypoint, plus a shell and the full CUDA toolkit. Use it to inspect a problem, not to serve.
The base follows the release runners that build each binary:
| Platform | Ubuntu | CUDA |
|---|---|---|
linux/arm64 |
24.04 | 13.0 |
linux/amd64 |
26.04 | 13.5 (the x86_64 binaries need glibc 2.43) |
- An NVIDIA GPU and an NVIDIA driver new enough for the image's CUDA minor (13.0 on arm64, 13.5 on amd64). NVIDIA's CUDA compatibility guide lists the minimum driver for each CUDA release. The validated host was a GB10 with driver 580.178.04 (host CUDA 13.0).
- The NVIDIA Container Toolkit, configured for Docker (
sudo nvidia-ctk runtime configure --runtime=docker, then restart Docker), so thatdocker run --gpus allworks. The validated host had toolkit 1.20.1. The toolkit injects the driver libraries (libcuda.so.1and friends); the image setsNVIDIA_VISIBLE_DEVICES=allandNVIDIA_DRIVER_CAPABILITIES=compute,utility. - The GPU architecture must be one the release binaries were built for; see CUDA architecture selection.
# Server on loopback, model downloaded into the /models volume on first start.
docker run -d --name mlxcel --gpus all -p 127.0.0.1:8080:8080 --stop-timeout 45 \
-v mlxcel-models:/models -v mlxcel-cache:/cache \
ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 -m mlx-community/Qwen3-4B-4bit
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"Hello"}],"max_tokens":32}'
# The CLI from the same image.
docker run --rm --gpus all -v mlxcel-models:/models -v mlxcel-cache:/cache \
--entrypoint mlxcel ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 \
generate -m mlx-community/Qwen3-4B-4bit -p Hello -n 20The entrypoint is mlxcel-server, so arguments after the image name are server flags; --entrypoint mlxcel runs the CLI instead. Flags and the LLAMA_ARG_* variables follow llama-server; see server features and environment variables.
To fetch the model once and then start without network access, which is what the Helm chart does:
docker run --rm --gpus all -v mlxcel-models:/models -v mlxcel-cache:/cache \
ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 download mlx-community/Qwen3-4B-4bit --models-dir /models
docker run -d --name mlxcel --gpus all -p 127.0.0.1:8080:8080 --stop-timeout 45 \
-v mlxcel-models:/models -v mlxcel-cache:/cache \
ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 -m mlx-community/Qwen3-4B-4bit --offlineThe image sets:
| Variable | Value | Purpose |
|---|---|---|
LLAMA_ARG_HOST |
0.0.0.0 |
listen on every interface inside the container |
LLAMA_ARG_PORT |
8080 |
listen port |
MLXCEL_MODELS_DIR |
/models |
model store root: snapshots at /models/<owner>/<name> |
MLXCEL_CACHE_DIR |
/cache/mlxcel |
root of mlxcel's on-disk caches, the CUDA kernel cache included |
MLXCEL_CACHE_TRUSTED_ROOT |
/cache |
trusted root for the kernel cache (see below) |
HOME |
/cache |
the image has no writable home directory otherwise |
CUDA_HOME |
/usr/local/cuda |
where the JIT finds the CUDA headers |
Override any of them with -e. MLXCEL_SHUTDOWN_TIMEOUT, LLAMA_API_KEY and the other server variables are read as usual.
The container runs as uid and gid 65532 (account mlxcel in the image's /etc/passwd and /etc/group). The runtime image has no shell: docker exec mlxcel sh fails, and docker run --entrypoint sh exits with 127. Use the -debug tag when you need a shell; it is a different image built on the full CUDA toolkit.
Everything the server writes goes to /models, /cache and /tmp. The Helm chart runs it with a read-only root filesystem and an emptyDir on /tmp; with Docker the equivalent is --read-only --tmpfs /tmp, which has not been run with Docker.
| Path | Contents |
|---|---|
/models/<owner>/<name> |
model snapshots (MLXCEL_MODELS_DIR) |
/cache |
HOME, and the trusted root of the kernel cache |
/cache/mlxcel |
MLXCEL_CACHE_DIR, created 0700 by the server |
/cache/mlxcel/cuda-ptx/<mlx-commit>/sm<cc>-nvrtc<ver>/ |
compiled CUDA kernels |
MLX compiles some CUDA kernels with NVRTC the first time they run and mlxcel keeps the results on disk, so only the first start pays for it: in the GB10 smoke test the first start was ready in 5.6 s and answered its first chat request 19.1 s after start, the second start 2.1 s and 2.6 s, on a loaded host. Keep /cache on a volume to keep that benefit across container replacements.
Anyone who can write the kernel cache can plant compiled code that the server loads, so the cache refuses directories other users could write and prints one line, mlxcel: CUDA kernel disk cache disabled: <directory> <reason>, then compiles every kernel in every run. Look for that line in docker logs if the second start is as slow as the first. Two rules make a volume usable:
- Trusted root (the image default). With
MLXCEL_CACHE_TRUSTED_ROOT=/cache,/cacheitself and everything above it are not checked, so a root-owned or world-writable volume root works. Every directory below it must be a real directory owned by 65532 that nobody else can write, and each cache entry must be a regular file owned by 65532 with no group or other write access. - Private group. With
MLXCEL_CACHE_TRUSTED_ROOTunset (-e MLXCEL_CACHE_TRUSTED_ROOT=), a directory that its group can write is accepted when that group is the process's own group and provably private: the image's/etc/passwd,/etc/groupand files-only/etc/nsswitch.confprove that for gid 65532.
What works for /cache:
/cache mount |
Kernel cache | Notes |
|---|---|---|
named volume (-v mlxcel-cache:/cache) |
kept | Docker copies the image's /cache (65532, 0700). Measured. |
bind mount owned by 65532, mode 0700 (sudo install -d -o 65532 -g 65532 -m 0700 /srv/mlxcel-cache) |
kept | The safest bind mount. |
bind mount owned by 65532:65532, mode 2775 |
kept | Works with the trusted root unset too (private-group rule). Measured. Any host account in gid 65532 can write /cache, so the model resolver ignores a HuggingFace cache there (see below). |
bind mount root:root, mode 0777 |
kept | Measured, but avoid it on a host with other users. The model resolver ignores a HuggingFace cache there (see below). |
What the trusted root gives up: another uid that can write /cache can delete or rename the cache, or put its own directory or a symlink in its place, which turns the cache off or cold but never gets a file it owns loaded. Before the server first compiles or loads a kernel, it could also rename another directory owned by 65532 that sits directly in /cache into the cache's place, and files there named like cache entries would be loaded. That is why the image puts the cache one level down (/cache/mlxcel) instead of using /cache itself. Do not mount the cache volume into another container that runs as uid 65532 (it is also the default uid of distroless images): such a container passes every owner check below the root. The full rule is in the MLXCEL_CACHE_TRUSTED_ROOT entry and in Prebuilt CUDA artifact: runtime requirements.
HOME is /cache, so the default HuggingFace cache is /cache/.cache/huggingface/hub, which the model resolver consults before the /models store. It reuses a snapshot there only when no other account can have written it or steered the lookup to it. Each of these must be owned by the server's uid (65532) or root and writable by neither group nor others: the hub directory, every directory on the way to the snapshot and to the refs/ file that selects it (with no sticky-directory exception), that ref file, every file and subdirectory in the snapshot, and the file each snapshot symlink resolves to (normally in blobs/) together with its directory. The parents of those directories, up to /, must pass the same rule, except that a root-owned sticky directory such as /tmp is accepted there. On a 2775 or 0777 mount another account could have planted the snapshot, so the resolver skips it, prints a warning naming the offending path with the fix (chmod -R go-w on the repository when its entries are writable, chown when another account owns them), and resolves the model from /models instead (downloading it there if it is missing). There is no group exception and MLXCEL_CACHE_TRUSTED_ROOT does not widen this check. Model downloads land in /models/<owner>/<name>, never in the HuggingFace cache. The one file mlxcel reads from that cache by repo id, the moondream/starmie-v1 tokenizer for starmie-era moondream2 checkpoints, always uses $HOME/.cache/huggingface/hub (it ignores HF_HOME) and passes the same check; a cached copy that fails it is fetched again into a private temporary directory on each load. To keep a HuggingFace cache out of /cache, point it into the model volume as the Helm chart does:
docker run ... -e HF_HOME=/models/.huggingface -e HF_HUB_CACHE=/models/.huggingface/hub ...With -m, the server binds its port only after the model is loaded and warmed up, so GET /health first fails to connect and then returns 200. It returns 503 (Loading model) only while the listener is up and no model is loaded, which a normal -m start does not reach. In router mode /health returns 200 as soon as the router listens. /health and /v1/health need no API key.
The image declares no HEALTHCHECK, because it has no shell or HTTP client to run one. Probe from outside, for example curl -fsS http://127.0.0.1:8080/health from the host, an orchestrator's HTTP probe, or a sidecar.
docker stop sends SIGTERM. The server stops accepting connections, lets in-flight responses (streams included) finish for up to --shutdown-timeout seconds (MLXCEL_SHUTDOWN_TIMEOUT, default 30), aborts what is still open, unloads its model workers and exits 0. A second SIGTERM or SIGINT during the drain exits 1 without draining.
Docker's own stop timeout defaults to 10 s, after which it sends SIGKILL in the middle of the drain. Give it the drain plus time for the worker join: docker run --stop-timeout 45 as in the examples, or docker stop -t 45 mlxcel. In the GB10 smoke test an idle server stopped in under a second with exit code 0.
The server has no API key by default, and the image listens on 0.0.0.0 inside the container, so the examples publish the port on loopback only (-p 127.0.0.1:8080:8080). Before publishing it on another interface, configure a key. With keys enabled, only /, /health and /v1/health are public (plus the static /webui files when the server runs with --webui).
# Key from a file (keeps it out of `docker inspect`).
docker run -d --gpus all -p 8080:8080 --stop-timeout 45 \
-v mlxcel-models:/models -v mlxcel-cache:/cache \
-v /srv/mlxcel/api-key:/run/secrets/api-key:ro \
ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 -m mlx-community/Qwen3-4B-4bit --api-key-file /run/secrets/api-key
curl http://HOST:8080/v1/models -H "Authorization: Bearer $(cat /srv/mlxcel/api-key)"-e LLAMA_API_KEY=... works too, but the value is then visible to anyone who can run docker inspect. The key file must be readable by uid 65532.
--metrics serves Prometheus metrics at GET /metrics. The route requires the API key when one is configured:
curl http://127.0.0.1:8080/metrics -H "Authorization: Bearer $KEY"Without -m, --models-dir starts the multi-model router, which discovers checkpoints under that directory and keeps at most --models-max of them loaded:
docker run -d --name mlxcel-router --gpus all -p 127.0.0.1:8080:8080 --stop-timeout 180 \
-v mlxcel-models:/models -v mlxcel-cache:/cache \
ghcr.io/lablup/mlxcel:vX.Y.Z-cuda13 --models-dir /models --models-max 2Requests select a model with the JSON model field. The router can also download (POST /models) and delete (DELETE /models) models on request, so set an API key before exposing it. On shutdown the router unloads its models within a fixed 150 s bound after the drain, hence the longer stop timeout. See Multi-model router mode.
docker buildx build -f docker/Dockerfile.cuda --platform linux/arm64 \
--build-arg MLXCEL_VERSION=vX.Y.Z --target runtime -t mlxcel:cuda13 --load .--target runtime(the default) or--target debug.MLXCEL_VERSIONnames the GitHub release whosemlxcel-linux-*-cuda13zips are downloaded and checked against their.sha256.--build-arg MLXCEL_SOURCE=local --build-context mlxcel-dist=<dir>takes the two zips and their.sha256files from<dir>instead.ARM64_UBUNTU_VERSION,ARM64_CUDA_VERSION,AMD64_UBUNTU_VERSIONandAMD64_CUDA_VERSIONchoose the base. The patch level of the CUDA version pins only thedebugbase image;runtimetakes the newest packages of that CUDA minor and the cuDNN version inCUDNN_VERSION.CHISEL_VERSIONandMLXCEL_RELEASE_URLare build arguments too.- The build stops, naming the symbol version, if a binary needs a newer glibc or libstdc++ than the chosen Ubuntu release has, and fails if any header outside the allow-list lands in
/usr/local/cuda/include. - Every
RUNexecutes on the build platform, so building the other architecture needs no QEMU.
The runtime image carries NVIDIA CUDA and cuDNN libraries and the CUDA headers the kernel JIT reads, taken from NVIDIA's CUDA apt repository and distributed under the CUDA EULA and the cuDNN license; the debug image is NVIDIA's cudnn-devel image with mlxcel added. These are not under mlxcel's Apache-2.0 license. See NOTICE.
From the GB10 smoke test: a linux/arm64 runtime image built from local main binaries served mlx-community/Qwen3-4B-4bit (bind-mounted) as 65532 with no shell, read only allow-listed CUDA headers, kept the kernel cache across starts on a named volume, a 0777 bind mount and a 2775 bind mount with the trusted root unset, and drained on docker stop with exit 0.
Not validated:
- Any image built from release binaries or pulled from GHCR: no release has published one yet.
- Any
linux/amd64container run, any x86_64 GPU, and NVRTC 13.5 against the allow-listed headers. The amd64 image has only been built. - The debug image at run time.
- A model download inside the container (the smoke test bind-mounted the checkpoint), and the
--offlinestart that follows it. - A 503 from
/health,--read-only --tmpfs /tmp,--api-key-file,--metricsand router mode in the container. These are the server's ordinary behavior, documented in server features, and were not exercised in the image. - Kernels other than those Qwen3-4B-4bit reaches.