CTranslate2

Fast inference engine for Transformer models using custom C++ runtime.

Open SourceSelf HostedOffline Capable
0.0 (0)

About

CTranslate2 is a C++ and Python library from the OpenNMT ecosystem for efficient inference with transformer models. Instead of running models through a general-purpose framework, it executes them in a custom runtime that applies weight quantization, layer fusion, padding removal, batch reordering, in-place operations, and caching to cut latency and memory use on both CPU and GPU. Supported architectures span encoder-decoder models such as Transformer, NLLB, BART, T5, and Whisper, decoder-only models including GPT-2, Llama, Mistral, Gemma, and Qwen2, and encoder-only models like BERT and XLM-RoBERTa, with converters for OpenNMT-py, OpenNMT-tf, Fairseq, Marian, and Hugging Face Transformers. Precision options cover FP16, BF16, INT16, INT8, and AWQ 4-bit quantization, letting models shrink to roughly a quarter of their disk size with minimal accuracy loss. Released under the MIT license, CTranslate2 powers production translation and transcription systems, most visibly as the engine behind faster-whisper.

Should you use CTranslate2?

Pick it when

Pick CTranslate2 when you serve translation, transcription, or encoder models such as NLLB, Whisper, T5, or BERT in production and want INT8 or FP16 speedups on CPU or GPU from a small C++ or Python library.

Look elsewhere when

Skip it for chat-style LLM serving to many concurrent users; it is a library with no built-in OpenAI-compatible server, so vLLM or the llama.cpp server fits better. Models also need converting into its own format first.

Alternatives to CTranslate2

  • faster-whisper

    Wraps CTranslate2 into a ready Whisper transcription package, the shorter path if speech-to-text is all you need from it.

  • ONNX Runtime

    More general across model types and hardware vendors, but less specialized for transformer text generation than CTranslate2's fused runtime.

  • vLLM

    Better for high-concurrency LLM chat with continuous batching and an OpenAI API, but built for GPUs, with a listed floor of about 16 GB of VRAM.

  • llama.cpp

    Better for decoder-only chat models with a large GGUF catalog and a ready server, while CTranslate2 is stronger on encoder-decoder translation.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Intermediate (3/5)
License
MIT
Added
Apr 3, 2026

Tags