Installation¶
uv pip install flide
Flide runs on Linux or WSL2 with an NVIDIA GPU, on Linux with an AMD Instinct GPU, or on a Mac with Apple silicon, with Python 3.10 or newer and PyTorch 2.12.1 to 2.14, which installing Flide brings in. Every model family comes inside the same package.
Drivers that run CUDA 12¶
PyTorch from PyPI is built for CUDA 13. On a machine whose NVIDIA driver runs only CUDA 12, Flide stops at startup and says so. Install the CUDA 12.6 build of PyTorch first, then Flide, which keeps the PyTorch it finds.
uv venv -p 3.12 && source .venv/bin/activate
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu126
uv pip install flide
AMD GPUs¶
Install the ROCm build of PyTorch first, then Flide, which keeps the PyTorch it finds.
uv venv -p 3.12 && source .venv/bin/activate
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm7.2
uv pip install flide
Flide is tested on the MI210 with PyTorch 2.14.1 for ROCm 7.2. --quantize int8, which keeps the weights in 8 bits,
works there as on NVIDIA GPUs. The MI210 has no float8 products, so --quantize fp8 stops at startup and says so.
Triton for ROCm builds one small C module at the first start, so the machine needs gcc or clang. The rocm Docker image
has gcc.
On one MI210, Flide answers a request faster than vLLM 0.32 for ROCm, as the median latency over 32 requests of each workload with both servers on the same card.
| Model | MultiRC | RACE | QuALITY |
|---|---|---|---|
| Qwen3.5-0.8B | 6.9× | 3.4× | 1.6× |
| Qwen3-1.7B | 1.9× | 1.7× | 1.3× |
Macs¶
On a Mac with Apple silicon (M1 or later) and macOS 14 or later, Flide runs on the Mac's GPU through MLX, Apple's array
library. Installing Flide brings MLX in, and Flide picks the Mac's GPU by itself, so flide serve and its requests work
as in the Quick start.
uv venv -p 3.12 && source .venv/bin/activate
uv pip install flide
flide serve --model OmniJev/OneJev1.6-0.8B
A Mac runs Qwen3.5 dense models, from 0.8B to 27B, the decision models built on them, and d1-3B and d1-2B, on text. As on a GPU, the state of a request runs once and every question runs after it, in one stream.
Before loading a model, Flide checks that its weights fit in the memory the Mac's GPU can use, and stops with a hint
when they do not. With --quantize int8 the weights take about half the memory, so a larger model fits.
Models run in bfloat16, and with --quantize int8 in float16, which stays closer to a float32 reference on 8-bit
weights. On Qwen3.5-0.8B with 8-bit weights over 157 questions, float16 changed one of the answers that the float32
reference decides clearly and bfloat16 two. mlx-lm, MLX's own engine for language models, changed one with the same
8-bit weights, and float16 sat nearer the reference than mlx-lm on 116 of the 157. --dtype float16 or --dtype
float32 picks another.
Families that read a question's tokens both ways do not run on a Mac yet, nor do
images and video, LoRA adapters, Qwen3.5 mixtures of experts, Gemma 4, Qwen2.5 and Qwen3. The same holds for keeping the
states of earlier requests (--session-cache-gb) and for batch-invariant products (--batch-invariant). A model or
request that needs one of them stops with a message that says so. Flide is tested on a MacBook Air with an M3 and 16 GB,
with Qwen3.5-0.8B, Qwen3.5-2B, d1-2B and d1-3B. On 48 requests of RACE, MultiRC and QuALITY, d1-2B and d1-3B picked
the same option on the Mac as a float32 reference on every question, d1-3B with 8-bit weights and d1-2B with and
without them.
Docker¶
The image omnijev/flide holds Flide, PyTorch and torchvision, and no model. The host needs only the GPU driver.
| Tag | PyTorch | Platforms |
|---|---|---|
latest, and each release by number (0.2.2) |
CUDA 13 build, driver 580 or newer | linux/amd64, linux/arm64 |
cu126, and each release by number (0.2.2-cu126) |
CUDA 12.6 build, older drivers | linux/amd64 |
rocm, and each release by number (0.2.2-rocm) |
ROCm 7.2 build, AMD Instinct GPUs | linux/amd64 |
mkdir -p ~/.cache/huggingface
docker run --gpus all -p 8000:8000 \
--user $(id -u):$(id -g) \
-v ~/.cache/huggingface:/data/hf \
omnijev/flide serve --model OmniJev/OneJev1.6-0.8B
Everything after the image name is the flide command, so every option of flide serve works the
same way. Models download into the mounted Hugging Face cache at the first start, and another model only needs a
different --model. --user runs the server as you, so the files it downloads are yours. Create the cache folder
before the first run, since a folder Docker creates itself belongs to root. A model already on disk is mounted and
named by its path in the container.
docker run --gpus all -p 8000:8000 \
--user $(id -u):$(id -g) \
-v /data/models/OneJev1.6-0.8B:/model \
omnijev/flide serve --model /model
-e HF_TOKEN passes a Hugging Face token for gated models, and -e FLIDE_API_KEY turns on the server's key check
with the key in your shell (the same as --api-key).
Apptainer¶
On a cluster without Docker, Apptainer runs the same image. The build converts it into one file, once.
mkdir -p ~/.cache/huggingface ~/.cache/flide
apptainer build flide.sif docker://omnijev/flide
apptainer run --nv --cleanenv \
--bind ~/.cache/huggingface:/data/hf \
--bind ~/.cache/flide:/data/triton \
flide.sif serve --model OmniJev/OneJev1.6-0.8B
--cleanenv keeps the login shell's variables out, such as an HF_HUB_CACHE that points somewhere else. The image
file is read-only, so the second --bind gives Triton's kernel cache a folder it can write.
On AMD GPUs, build from the rocm tag and pass --rocm in place of --nv.
apptainer build flide-rocm.sif docker://omnijev/flide:rocm
apptainer run --rocm --cleanenv \
--bind ~/.cache/huggingface:/data/hf \
--bind ~/.cache/flide:/data/triton \
flide-rocm.sif serve --model Qwen/Qwen3.5-0.8B
Kernels¶
Flide's kernels are compiled for each GPU. The package carries them precompiled for sm86 GPUs (A40, A10, RTX 30 series), sm89 GPUs (L4, L40S, RTX 40 series), sm90 GPUs (H100, H200), sm120 GPUs (RTX 50 series, RTX PRO 6000) and sm121 GPUs (DGX Spark), for PyTorch 2.13 and 2.14, and for the AMD MI210 (gfx90a) for PyTorch 2.14. On these, a server starts without compiling. On any other GPU, the first start compiles the kernels once and keeps them in the Triton cache; later starts reuse them. That first start says so in its log, counts the kernels it has compiled every ten seconds and reports its progress at every quarter of the CUDA graph capture. Any later start that still compiles a kernel says how many.
Attention on GPUs with less shared memory¶
On GPUs with about 100 KB of shared memory a block (A40, A10 and the RTX 30 series, L4, L40S and the RTX 40 series, the RTX 50 series and RTX PRO 6000, DGX Spark), attention runs a kernel written in Gluon, Triton's lower-level language, with the query tile and the key and value blocks placed by hand. On an A40 it computes attention 1.7 times as fast as the Triton kernel at 128- and 256-dim heads, and answers Qwen3-1.7B over 3.5k tokens 12% sooner end to end. On an RTX PRO 6000 it computes attention 2.3 to 2.5 times as fast at 64- and 128-dim heads and 1.5 times at 256-dim heads, which the RTX 50 series, RTX PRO 6000 and DGX Spark run in fewer registers, and answers KnowLine-35B's 140 questions over 34k tokens 14% sooner end to end. Its answers differ from the Triton kernel's at rounding level, as they would on another GPU, and stay as close to a float32 reference. H100, H200, A100 and AMD GPUs run the Triton kernel as before. To run the Triton kernel on these GPUs too:
FLIDE_ATTENTION=triton flide serve --model Qwen/Qwen3.5-0.8B
Kernel bundles¶
flide kernels packs compiled kernels into a bundle and files a bundle into another machine's cache, so a fleet of
the same GPU compiles once.
| Command | What it does |
|---|---|
flide kernels export --model M --out B |
warms the model in a fresh cache and packs the kernels into bundle B |
flide kernels seed B |
files bundle B into this machine's kernel cache |
flide kernels merge OUT B1 B2 |
unites bundles made with the same Triton on the same GPU |
flide kernels info B |
lists what a bundle holds |
Check the install¶
flide formats
The command lists the installed model families: intern_decision, next_token for chat models, onejev,
open_jev and torchcast.