Candle
Minimalist machine learning framework for Rust focused on performance and serverless inference.
About
Candle is a minimalist machine learning framework written in Rust and maintained by Hugging Face, built to make serverless inference practical by removing the heavyweight Python dependencies of traditional frameworks. Its API is designed to feel familiar to PyTorch users while compiling to small, fast-starting binaries. The framework supports optimized CPU execution with optional MKL and Accelerate backends, CUDA with multi-GPU distribution via NCCL, and WebAssembly for running models directly in the browser. The repository ships working implementations of many models, including LLaMA, Mistral, Phi, Gemma, and Qwen language models, Stable Diffusion for image generation, Whisper for speech recognition, and YOLO and Segment Anything for vision. Weights load from safetensors, NPZ, GGML, and PyTorch files, including llama.cpp compatible quantized formats, and custom kernels such as FlashAttention v2 can be plugged in. Dual licensed under MIT and Apache 2.0, Candle suits developers who want production or edge inference without a Python runtime.
Should you use Candle?
Pick it when
Pick Candle when you are building a Rust service, CLI, or WebAssembly app and want to embed LLM, Whisper, or vision inference as a library with small binaries and fast cold starts, with no Python runtime in production.
Look elsewhere when
Skip it if you want a ready server or chat app rather than a framework to code against; mistral.rs gives Rust users an OpenAI-compatible server, and Python teams get more models and tooling from Transformers or vLLM.
Alternatives to Candle
- mistral.rs
Also Rust, but a complete server with OpenAI-compatible endpoints and broad quantization out of the box, less suited to custom model code.
- llama.cpp
A larger GGUF ecosystem and a mature LLM server, but a C/C++ codebase rather than a Rust-native API for embedding in your own crate.
- ONNX Runtime
Microsoft-backed engine with many language bindings and hardware providers, but you must convert models to ONNX first, which Candle skips.
- Transformers.js
The JavaScript route to in-browser inference with a Python-like pipeline API, while Candle's WASM path suits teams writing Rust.
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- LLM Inference & Serving
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Intermediate (3/5)
- License
- Apache-2.0
- Added
- May 7, 2026