magnitudedev/magnitude, runs Magnitude as a server: the OpenAI and Anthropic compatible API at :10100/inference/v1 and :10100/inference/anthropic, the browser app at :10100, and the magnitude CLI through docker exec. It is the same product as a remote server, packaged for people who run everything in containers.
The image is for Linux on x64 and ARM64; Docker picks the right one. One image serves CPU, NVIDIA CUDA and Vulkan GPUs.
Run it
healthy in docker ps once Magnitude is ready. On its first start Magnitude makes a network key, the API key for everything outside the container, and prints it:
http://localhost:10100/inference/v1 with the network key as the API key, or open http://localhost:10100 in a browser and sign in with the key. From another computer, use the Docker host’s address instead of localhost.
Always keep /data on a volume. It holds models, settings, the network key and the installation’s identity; without a volume, all of it is lost when the container is removed.
Docker Compose
compose.yaml
MAGNITUDE_NETWORK_KEY= and a long random value in a .env file beside it, then run docker compose up -d. Run CLI commands with docker compose exec magnitude magnitude ….
The network key
In a container, network access is on by default: Magnitude listens on all of the container’s interfaces and requires a key from every caller outside the container. Requests through a published port count as coming from another device.- Let Magnitude make one: as in Run it, the first start generates a key, saves it in the volume, and prints it once in
docker logs magnitude. Recreating the container on the same volume keeps it. Read it again with:
network.apiKey there.
- Or set your own: pass
-e MAGNITUDE_NETWORK_KEY=KEY, as the Compose and Kubernetes examples do. It must be 16 to 512 printable characters without spaces; use a long random value, such as the output ofopenssl rand -hex 32. Magnitude uses it at every start the variable is set, in place of the saved key, so pass it every time you recreate the container.
Authorization: Bearer KEY or x-api-key: KEY. Check it from the host:
localhost or a Tailscale name. To open it by another host name, such as http://nas.local:10100, list the names in MAGNITUDE_ALLOWED_HOSTS, separated by commas:
http://magnitude:10100 without this.
GPUs
- NVIDIA
- AMD and Intel (Vulkan)
- CPU
Install the NVIDIA driver and the NVIDIA Container Toolkit on the host, then add CUDA needs an Ampere or newer GPU. The image asks the toolkit for its Vulkan driver too, so older cards such as Turing run on Vulkan instead. Check what Magnitude sees with
--gpus all:docker exec magnitude magnitude hardware.Docker Desktop on macOS and Windows
Docker Desktop runs Linux containers in a virtual machine, so the container sees that machine’s memory and processors, not your computer’s.- macOS: containers can’t use the GPU; Metal isn’t available inside the virtual machine. The image runs on CPU only. To use your Mac’s GPU, install the macOS app instead. Colima and Podman’s machine run the image the same way.
- Windows: with the WSL 2 backend and a current NVIDIA driver on Windows,
--gpus allgives the container the NVIDIA GPU. AMD and Intel GPUs aren’t available to containers; use the Windows app for them.
Memory limits
With a memory limit, such as-m 8g or a Kubernetes resources.limits.memory, Magnitude counts the limit as the container’s memory and fits models to it. It keeps 2 GB or a tenth of the limit in reserve, whichever is larger, so even the smallest catalog models need a limit of about 5 GB. docker exec magnitude magnitude hardware shows the memory Magnitude sees.
Data and permissions
Magnitude runs as uid 1000 with its home at/data. Everything it keeps is in /data/.magnitude: models in models/, settings in config.json, logs in logs/.
A named volume, as in the examples, is created with the right owner. To use a host directory instead, make it writable by uid 1000 first:
ReadWriteMany volumes, nothing stops it, so make sure only one container uses each volume.
Ubuntu’s snap of Docker can only mount folders under your home directory; use a named volume, a folder in your home directory, or Docker from docker.com.
Use models you already have
Mount existing model folders read-only. Magnitude finds Ollama models and the Hugging Face cache automatically when the container’s environment points at them:/usr/share/ollama/.ollama/models is where the Ollama Linux service keeps models; a user’s own Ollama uses ~/.ollama/models. For any other folder of GGUF files, mount it, for example with -v /srv/gguf:/models/gguf:ro in the docker run command, and add it:
Hugging Face sign-in
For gated models, private repositories or higher download limits, sign in with a code you enter on any device:/data and survives upgrades. Magnitude doesn’t read HF_TOKEN.
Use it from other containers
Put your app and Magnitude on the same Docker network, such as one Compose project, and use the service name:
Requests that carry the key are accepted under any host name, so the service name works as it is.
Kubernetes
One replica with a persistent volume, the key from a Secret, and one NVIDIA GPU. It assumes the NVIDIA device plugin; for CPU, remove thenvidia.com/gpu limit.
magnitude.yaml
VERSION with a release, such as 0.2.14, so the cluster upgrades only when you change it. Recreate stops the old pod before the new one starts, since only one may use the volume. On clusters that select the NVIDIA runtime by class, such as k3s, add runtimeClassName: nvidia to the pod spec. Other pods reach it at http://magnitude:10100/inference/v1 with the key; run CLI commands with kubectl exec deploy/magnitude -- magnitude ….
Podman
Rootless Podman 4.3 or later maps your account to uid 1000 in the container with--userns=keep-id. NVIDIA GPUs use CDI after sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml:
:Z relabels the directory for SELinux, as on Fedora and RHEL. Leave out --device nvidia.com/gpu=all for CPU, or use --device /dev/dri --group-add keep-groups for Vulkan. Run CLI commands with podman exec magnitude magnitude ….
Logs and status
/data/.magnitude/logs/inference.log.
Upgrade
The container never updates itself: an update installed inside it would be lost when the container is recreated. It checks for new releases and says when one is available, in the logs, inmagnitude status and in Settings. To upgrade, pull the image and recreate the container on the same volume:
latest is the newest stable release, beta and alpha the newest prereleases, and each release also has its own tag, such as magnitudedev/magnitude:0.2.14, for pinning. A container on a prerelease is offered that channel’s releases and told to pull magnitudedev/magnitude:beta or :alpha; a pinned container upgrades when you change its tag.
Port 10100 is already in use
If Magnitude also runs on the host, it already uses port 10100. Publish the container on another host port and use that port in URLs:http://localhost:10101/inference/v1.