# candle

> Minimalist ML framework for Rust

Source: https://talira.ai/catalog/candle-mxvc1kc7
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library, Framework
- Categories: [ai / inference / runtimes](https://talira.ai/categories/ai/inference/runtimes), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT OR Apache-2.0[^1][^2]
- Pricing: Free and open source[^1][^2]
- Free tier: yes[^1][^2]
- Self-hostable: yes[^3]
- Backed by: [Hugging Face](https://talira.ai/orgs/hugging-face.md)

candle is Hugging Face's machine learning framework for Rust, with a PyTorch-like tensor API, a CPU backend (optionally with MKL or Apple's Accelerate), CUDA with multi-GPU support through NCCL, Metal, and WebAssembly for running models in the browser. Its goals are serverless inference with small binaries and removing Python from production; it can also train. candle-transformers implements many models (LLaMA, Mistral, Phi, Gemma, Qwen, Whisper, Stable Diffusion, BERT, JinaBERT, nomic-bert, ModernBERT and more), loads safetensors, npz, GGML/GGUF and PyTorch files, and supports [llama.cpp](https://talira.ai/catalog/llama-cpp-g0rydd64.md)'s quantized types. The crates are candle-core, candle-nn and candle-transformers (the crate named candle is an unrelated placeholder); its BERT example embeds sentences with [all-MiniLM-L6-v2](https://talira.ai/catalog/all-minilm-l6-v2-e11ef7yh.md) by default, and [fastembed-rs](https://talira.ai/catalog/fastembed-rs-9cry7y9m.md) uses it for its Qwen3 and BERT backends.

## Links

- Website: https://huggingface.github.io/candle/
- GitHub: https://github.com/huggingface/candle
- Docs: https://huggingface.github.io/candle/

## Problems it solves

- run a Hugging Face model in Rust without Python or libtorch
- ship a small binary that does model inference for a serverless function
- compute sentence embeddings in a Rust program with a BERT model from the Hub
- run a quantized GGUF language model from my own Rust code
- run Whisper speech recognition inside a Rust app
- run an ML model in the browser compiled to WebAssembly from Rust
- use the GPU on Apple silicon or NVIDIA from a Rust inference program
- port a PyTorch model to Rust with a familiar tensor API
- train a small neural network in pure Rust
- the GIL and Python overhead are slowing down my model serving
- load safetensors weights directly in Rust
- run an ONNX model in Rust without linking a C++ runtime

## Features

- PyTorch-like tensor API with autograd and training
- CPU backend with optional MKL (x86) and Accelerate (macOS)
- CUDA backend with cuDNN, multi-GPU via NCCL, and JIT CUDA kernels in Rust (cuTile)
- Metal backend for Apple silicon
- WebAssembly support for in-browser models
- candle-transformers: LLMs, Whisper, Stable Diffusion, BERT-family encoders, vision models and more
- loads safetensors, npz, GGML/GGUF and PyTorch files
- quantization with llama.cpp's quantized types
- flash-attention v2 layer (candle-flash-attn)
- ONNX model evaluation (candle-onnx)
- sentence-embedding examples: BERT, JinaBERT, nomic-bert, ModernBERT, gte-Qwen, Stella, XLM-RoBERTa

## Capabilities

- Has official SDKs: plan not known

## Trust

Overall: 0.27 out of 1.
Signals: backing 0.30, extensibility 0.00.

- backed by Hugging Face

Warnings:

- GitHub activity not fetched yet

## Alternatives

- [model2vec-rs](https://talira.ai/catalog/model2vec-rs-nng7brwf.md): Fast State-of-the-Art Static Embeddings in Rust
- [fastembed-rs](https://talira.ai/catalog/fastembed-rs-9cry7y9m.md): Rust library for generating vector embeddings, reranking locally
- [ort](https://talira.ai/catalog/ort-e86n3wy1.md): Fast ML inference & training for ONNX models in Rust
- [Burn](https://talira.ai/catalog/burn-16d6c02a.md): A Rust tensor library and deep learning framework for training and inference on any hardware.
- [ONNX Runtime](https://talira.ai/catalog/onnx-runtime-82vyrppc.md): Cross-platform, high performance ML inferencing and training accelerator

## Sources

[^1]: https://github.com/huggingface/candle/blob/main/LICENSE-MIT (checked 20 Nov 2026)
[^2]: https://github.com/huggingface/candle/blob/main/LICENSE-APACHE (checked 20 Nov 2026)
[^3]: https://github.com/huggingface/candle (checked 20 Nov 2026)
