Skip to content

Installation

There are two ways to get qix onto a machine:

  1. Install the wheel with uv or pip (below). No C++ compiler is needed, but a CUDA toolkit is required at serving time because FlashInfer may compile an attention kernel during warm-up. This is the way to use qix.
  2. Build from source (build-from-source.md). This is the way to change qix, or to use a torch other than the one the wheel was built with.

A source build installs in one of two ways:

Way What you get What you do not get
The CMake build, then cmake --install (build-from-source.md) the tnd Python package and its compiled modules, the qix-serve launcher, tnd-node-router, the serving profiles, the shared libraries the parts that are not in the open tree (the last table on this page)
pip install . from the repository root the tnd Python package and its compiled modules, qix-serve, tnd-node-router, tnd-serve-launch and the serving profiles, built by CMake under setup.py the shared libraries under <prefix>/lib, the C++ headers and the tnd-enable tools

This page lists what the machine needs first, and what each way puts where.

Install the wheel

The wheel is named iturai-qix; the Python import name is tnd. It holds what a served model needs: the tnd package and its compiled modules, the CUDA library, qix-serve, tnd-node-router, tnd-serve-launch and the serving profiles.

uv venv --python 3.12 && source .venv/bin/activate
uv pip install iturai-qix --find-links ./wheels/
qix-serve --dry-run --model Qwen/Qwen2.5-7B-Instruct     # prints the plan, starts nothing
qix-serve --model Qwen/Qwen2.5-7B-Instruct

pip install iturai-qix --find-links ./wheels/ works the same way. You do not have to activate the environment: .venv/bin/tnd-serve starts the server with that environment's Python.

Where the version comes from: you do not type one. ./wheels/ is a folder of wheel files, named like iturai_qix-<version>-cp312-cp312-manylinux_2_28_x86_64.whl. --find-links tells the installer to look in that folder. It reads the version and the Python tag from each file name, takes the files that fit your Python, and installs the newest. To install one exact build, give its file instead: uv pip install ./wheels/<that file>.

The wheel is not on PyPI yet. Once it is published, drop --find-links ./wheels/ and the line is uv pip install iturai-qix. Until then, fill the folder by building the wheel once, on a machine with a CUDA toolkit. Build from source has the full commands; in short:

python3 -m venv .build-venv && source .build-venv/bin/activate
pip install "torch==2.8.0" --index-url https://download.pytorch.org/whl/cu128 --extra-index-url https://pypi.org/simple
pip install "cmake>=3.24,<4" ninja "pybind11>=2.12" "setuptools>=69" wheel numpy
pip wheel . --no-deps --no-build-isolation -w wheels/

The two pairs we built and served with:

CUDA toolkit torch Where
12.9 2.8.0 (the cu128 index) an AlmaLinux 8 container with GCC 12; 19 min 23 s for the Python 3.10 and 3.12 wheels on 8 cores, with five GPU architectures
13.0 2.11.0 (the cu130 index) Ubuntu 24.04 with GCC 13; 5 min 16 s for one wheel on 12 cores, with seven GPU architectures

CUDA toolkit 13.2 does not compile csrc/models/v4_decode_topk.cu. A wheel built on your own machine is tagged linux_x86_64, not manylinux_2_28_x86_64: it installs on the same Linux release or a newer one. "What pip install . builds" lists what goes into the wheel.

What the wheel needs and brings:

Machine Linux on x86_64 with glibc 2.28 or newer (the wheel's tag is manylinux_2_28_x86_64), an NVIDIA GPU, its driver, and a CUDA toolkit with nvcc for FlashInfer warm-up compilation
Python 3.10 or 3.12: one wheel file per version
torch 2.8.0, installed with the wheel. The CUDA library in the wheel loads only against the torch release it was built with
Other packages installed with it flashinfer-python, transformers, huggingface_hub, safetensors, numpy
GPUs it has code for compute capability 8.0, 8.9, 9.0, 10.0 and 10.3: A100, L40S, H100 and H200, B200, B300
Size 22.5 MB per wheel

If another torch is installed over the wheel's, tnd stops at import and names both versions and the fix (pip install torch==2.8.0). It does not fall back to a slower path.

What was run, and what was not:

  • One B200, Ubuntu 24.04, Python 3.12, 2026-12-01: the install took 16 s with its dependencies, and qix-serve --model Qwen/Qwen2.5-7B-Instruct answered its first request 142 s after start.
  • That machine had a CUDA toolkit installed. FlashInfer compiled its kernels with it at the first start. A machine with the driver only is not supported.
  • No other GPU, no multi-GPU layout and no DeepSeek-V4 model has been served from the wheel. The Python 3.10 wheel was built and never installed.

System requirements

Need Version Where it is stated
OS Linux, x86_64 The packaged build targets Linux on x86_64. No file in the open tree checks the platform.
CMake 3.22.1 or newer for the CMake build; 3.24 or newer and below 4 for pip install . CMakeLists.txt:1 (cmake_minimum_required); pyproject.toml:9
C++ compiler C++17 CMakeLists.txt:4 (CMAKE_CXX_STANDARD 17)
Python 3.10 or newer pyproject.toml:22 (requires-python = ">=3.10"). No file in the open tree sets an upper bound. Which newer versions work is not checked there.
pybind11 any version CMake finds through python -m pybind11 --cmakedir; 2.12 or newer for pip install . CMakeLists.txt:1495-1509; pyproject.toml:11. Without it the Python bindings and the HTTP server are not built.
CUDA toolkit optional; see below CMakeLists.txt:81-121
PyTorch required when CUDA is on TND_REQUIRE_TORCH (CMakeLists.txt:16) fails the configure when CUDA is enabled and torch is missing

The first configure downloads its C++ dependencies with CMake FetchContent (abseil-cpp, xxHash, tokenizers-cpp, cpp-httplib, nlohmann/json, minja, xgrammar, GoogleTest and, with CUDA, CUTLASS and FlashInfer), so it needs network access.

CUDA versions

CMake does not refuse any CUDA version. What a build contains depends on the version it finds:

CUDA toolkit Effect Where
none, or neither libcuda.so.1 nor the toolkit's stub libcuda (lib64/stubs, CMakeLists.txt:98-102) host-only build: the scheduler, block manager and batch assembler, no GPU kernels CMakeLists.txt:104-120
below 11.8 FP8 KV-cache and FP8 GEMM kernels are turned off CMakeLists.txt:133, :151
12.0 or newer the sm_90 FP8 GEMM can build CMakeLists.txt:181
12.8 or newer sm_100 (B200, GB200) is added to the default architecture list cmake/TndPackagingContracts.cmake:38-39
12.9 or newer sm_103 (B300, GB300) is added as well cmake/TndPackagingContracts.cmake:36-37
13.0 or newer sm_70 is dropped from the default list; CUTLASS v4.5.0 is used cmake/TndPackagingContracts.cmake:26-30, CMakeLists.txt:193-196

The full architecture rule is on build-from-source.md.

Python packages

The serving path imports these at run time:

  • torch (a CUDA build that matches the toolkit you build against)
  • flashinfer
  • transformers, safetensors, huggingface_hub
  • numpy
  • pyyaml (read only when a sampling profile is requested)

pip install . installs numpy, torch, transformers, huggingface_hub and safetensors (setup.py, dependencies). What it asks of torch depends on the build:

  • A host-only build takes any torch.
  • A CUDA build requires the exact torch release it was compiled with, and flashinfer-python. The CUDA library in the wheel loads only against that release. import tnd.sampler stops with an ImportError that names both versions if another one is installed later.

Install a torch built for the CUDA version you compile with, before you configure: CMake reads torch's C++ ABI setting from that interpreter (cmake/TndPackagingContracts.cmake, tnd_probe_torch_cxx11_abi).

What pip install . builds

pyproject.toml names the distribution iturai-qix; the import name is tnd. It has no licence field yet (pyproject.toml:29-30). setup.py runs CMake, builds named targets and copies the results into the wheel's tnd/ package (setup.py:158-229):

In the wheel When
the tnd package and every tnd.* package under python/, except tnd.harness always (setup.py:46, setup.py:64-68)
tnd/_paged_core (the engine module) and tnd/libtnd_paged_core.so always
tnd/_tnd_server (the HTTP server module) and tnd/libtnd_server.so when CMake finds pybind11
tnd/_paged_cuda when nvcc is found through CUDACXX, CUDA_HOME or PATH (setup.py:113-122); otherwise the build is host-only
tnd/libtnd_paged_cuda.so (the CUDA library the sampler and the DeepSeek-V4 kernels load) and tnd/abi.json (the torch and CUDA it was built with) when nvcc is found
tnd/sampling_profiles.yaml, the Triton config files under tnd/kernels/configs/ always (setup.py:56-59)
qix-serve, tnd-node-router, tnd-serve-launch, in the environment's bin always
the serving profiles, in <environment>/share/tnd/serving-profiles always

qix-serve finds the profiles beside itself: it reads <its directory>/../share/tnd/serving-profiles first. The wheel's version comes from the nearest v0.* git tag: 0.1.0 on the tag, 0.1.1.dev7 seven commits past it, and 0.1.0.dev<commit count> when there is none. It never carries a +<sha> label.

A build with a CUDA toolkit needs torch in the Python that runs the build, so pass --no-build-isolation: pip install --no-build-isolation .

A wheel built this way requires the exact torch release of the Python that built it, not the 2.8.0 of the published wheel.

What make install puts where

After the build on build-from-source.md, cmake --install build (or make install inside build/) installs:

What Destination Rule
qix-serve (the launcher) <prefix>/bin CMakeLists.txt:2389
tnd-node-router <prefix>/bin CMakeLists.txt:2387
Serving profiles <prefix>/share/tnd/serving-profiles CMakeLists.txt:2390-2392
libtnd_paged_core.so, and libtnd_paged_cuda.so with CUDA <prefix>/lib CMakeLists.txt:2385, :2394
libtnd_server.so, when pybind11 was found <prefix>/lib CMakeLists.txt:2448
The tnd Python package and its compiled modules the interpreter's site-packages CMakeLists.txt:1657-1658, :2449
The engine's C++ headers (*.h, *.cuh under csrc/) <prefix>/include/tnd CMakeLists.txt:2482
abi.json, with CUDA: the torch version, CUDA version and architectures of this build <prefix>/share/tnd CMakeLists.txt:2416-2417
tnd-enable, tnd-disable, tnd-status (Linux) <prefix>/bin CMakeLists.txt:2489-2500

The Python package goes to the first site-packages directory of the Python that CMake found (CMakeLists.txt:1645-1653), not under <prefix>. Install into a virtual environment if you do not want it in the system Python.

Some install rules run only when their source is in the tree. Each is guarded, and a missing source prints a Skipped: line at configure time:

What Source In the open tree Rule
tnd_autowire.py and tnd_autowire.pth, to site-packages python/tnd_autowire.{py,pth} no: not installed CMakeLists.txt:1578-1584, :1665-1669
the transformers_tnd package, to site-packages integrations/transformers-tnd/ no: not installed CMakeLists.txt:1585-1592, :1676-1681
the tnd-server systemd unit and /etc/tnd-server/tnd-server.conf the systemd packaging sources no: not installed CMakeLists.txt:2457-2468
libtnd_preload.so preload/ no: not built CMakeLists.txt:2356-2360
the TensorRT plugin library plugins/ no: not built CMakeLists.txt:2368-2379

A tree that still holds those sources builds and installs them. not-included.md lists the parts that are not in the open tree.

You can also run without installing: see "Run from the build tree" on build-from-source.md.

Check the install

qix-serve --help                       # prints the usage line
qix-serve --dry-run --model Qwen/Qwen2.5-7B-Instruct
python3 -c "import tnd, tnd._paged_core; print('ok')"

--dry-run probes the GPUs, reads the checkpoint's config.json, prints the plan and the commands it would run, and starts nothing. quickstart.md explains its output.

Common problems

Symptom Cause Fix
import tnd fails with _paged_core not loading, and the message names an ABI mismatch the compiled modules were built for a different Python than the one running rebuild with the Python you run, and with the torch installed in it
A second server on the same host stops at start on a port bind both servers count their internal ports from the same MASTER_PORT (trusted-network.md) give each server its own --port and its own MASTER_PORT
The server stops with an out-of-memory error while it loads the weights and the KV pool do not fit this GPU use a GPU with more memory, or more GPUs; qix-serve --dry-run prints the plan first
The first start takes minutes the server loads the weights and records CUDA graphs before it listens wait for the TND server listening line (quickstart.md)