ZML is a production inference stack that compiles models to several accelerator backends from one codebase. It is built with Zig, MLIR, and Bazel and targets hardware including NVIDIA, AMD, Intel, TPU, and Trainium.
Overview
ZML focuses on running AI models on diverse hardware without tying workloads to a single vendor stack. The project describes compiling directly to NVIDIA, AMD, Intel, Google TPU, and AWS Trainium accelerators while sharing one codebase. Implementation uses Zig, MLIR, and Bazel for builds.
Getting started runs through Bazel, with a MNIST example that downloads weights, compiles, and classifies a sample digit. A unified LLM CLI example supports models such as Llama 3.1 and 3.2, Qwen 3.5, and LFM 2.5, loading from Hugging Face (with token for gated repos), local directories, or S3. Platform flags select CUDA, ROCm, OneAPI, TPU, or Neuron targets when building or running.
Additional examples cover sharding, benchmarking, and smaller end-to-end flows. Documentation points to guides for tensors, writing models, and deploying on a server. The public site positions ZML as Python-free inference technology that maps models down to the metal and references an LLM server offering.
The stack is licensed under Apache 2.0 and invites contributions through the project’s contributing guide.
Key features
- Multi-vendor accelerator compilation
- Bazel-based build workflow
- Unified LLM CLI example
- MNIST smoke test pipeline
- Platform flags for CUDA and ROCm
- TPU and Neuron target support
- Model load from HF, disk, or S3
- Sharding and benchmark examples
Use cases
- Cross-hardware model inference
- LLM prompt and chat loops
- Performance benchmarking on GPUs
- Exploring partitioned model execution