| Crates.io | ctranslate2 |
| lib.rs | ctranslate2 |
| version | 2.1.1 |
| created_at | 2025-07-02 16:03:10.158626+00 |
| updated_at | 2025-10-06 14:55:03.574764+00 |
| description | Rust bindings for OpenNMT/CTranslate2 |
| homepage | |
| repository | https://github.com/frederik-uni/ctranslate2-src |
| max_upload_size | |
| id | 1735289 |
| size | 81,075 |
This library provides Rust bindings for OpenNMT/CTranslate2.
Add this crate to your Cargo.toml with selecting the backends you want to use as the features:
[dependencies]
ctranslate2 = { version = "2" }
ctranslate2-sys = { version = "0.1.5", features = ["cuda", "cudnn"] }
The installation of CMake is required to compile the library.
Setting the environment variable RUSTFLAGS=-C target-feature=+crt-static might be required.
vendor: Use prebuilt binariesshared: Build with ctranslate2 as shared librarycrt-dynamic: crt is statically linked on Windows-static builds. to link crt dynamically, use crt-dynamicThese features only do something if vendor is not used
cuda: Enables CUDA support
cudnn: Enables cuDNN supportcuda-dynamic-loading: Enables dynamic loading of CUDA libraries at runtime instead of static linking (requires
CUDA >= 11)
cuda-small-binary: Reduces binary size by compressing device codemkl: Enables Intel MKL supportopenblas: Enables OpenBLAS support (OpenBLAS needs to be installed manually
via vcpkg on Windows)ruy: Enables Ruy supportaccelerate: Enables Apple Accelerate support (macOS only)dnnl: Enables oneDNN supportopenmp-runtime-comp: Enables OpenMP runtime supportopenmp-runtime-intel: Enables OpenMP runtime support for Intel compilersmsse4_1: Enables MSSE4.1 supporttensor-parallel:
Enables Tensor Parallelism
flash-attention:
Enables Flash Attention