Skip to main content

PyPI version PyPI downloads

faster_tts

The goal is to provide a Python library for accessing all text-to-speech models supported by CTranslate2.

Text-to-speech with Drama 3 on CPU and GPU, powered by CTranslate2. Provides a Python library API and the faster-tts command-line interface (CLI). Includes model downloading and caching, sentence splitting, speaker tags, and WAV output. Requires CTranslate2 4.8.5+.

Drama 3 supports 83 languages. With this library and CTranslate2, you can use:

  • Natural-language directions for emotion, tone, and pacing, such as [whispering].
  • Inline vocal sounds such as laughter and breathing, and delivery tags such as <emphasis>…</emphasis> for individual words or phrases.
  • Speaker-tagged dialogue using <|speaker:0|>, <|speaker:1|>, and so on.
  • Offline synthesis with mono audio output at 44.1 kHz on CPU or GPU.

Quick start

Python API:

from faster_tts import Model

model = Model()
result = model.synthesize(
    "Hello! Welcome to our application.",
    output="hello.wav",  # Save the audio as a WAV file.
)

Model() downloads and caches jordimas/drama-3-ct2. Reuse it across calls.

CLI (also available as python -m faster_tts):

faster-tts --text "Hello!" --output hello.wav

Generate emotion, dialogue, and multilingual audio with the sample scripts, or narrate a UTF-8 article:

python samples/article_voice.py samples/article_voice.txt --output article.wav

The article sample selects the device automatically. Use --device cpu or --device cuda to override it. Its default audio budget is 120 seconds (--max-duration-s); reaching it saves partial narration.

Models and devices

model = Model("drama-3")  # Default checkpoint
model = Model("jordimas/drama-3-ct2", revision="main", cache_dir="./models")
model = Model("/path/to/converted-model")
model = Model(local_files_only=True)  # Cached assets only

model = Model(device="cuda", device_index=0, compute_type="float16")
model = Model(device="cpu", compute_type="int8")

The default device="auto" selects GPU when available, otherwise CPU. CUDA and ROCm both use "cuda" with a matching CTranslate2 build. Compute types depend on the build; "default" lets CTranslate2 choose. Inspect settings with model.info(). Set CT2_DRAMA_GPU_WAVEFORM=0 to decode waveforms on CPU.

The CLI accepts the same model and cache options. For local models, use explicit paths such as ./model to avoid interpreting missing directories as Hub IDs. Custom checkpoints must match the engine's layout.

Memory

GPU expert caches size automatically. Set a total budget in decimal GB:

model = Model(
    device="cuda", num_workers=2,
    engine_options={"gpu_expert_cache_gb": 12},
)

This gives each worker a 6 GB cache. Use "auto" or "uncapped" instead of a number, or CLI --gpu-expert-cache-gb. Without an explicit budget, CT2_DRAMA3_GPU_EXPERT_CACHE_GB sets the per-worker limit (0 means uncapped). Automatic sizing reserves at least 2 GB and 30% of free memory and fails if memory cannot be queried or is insufficient. Cache budgets do not cap total VRAM.

When device="auto" selects CPU, large checkpoints can use expert memory mapping on Linux/macOS with compute_type="default" or "float32". Override with CT2_DRAMA3_CPU_MMAP=0 or 1. Explicit device="cpu" leaves it off by default. Keep the checkpoint unchanged while loaded; mapping does not cap RAM usage. Both memory features require a supporting CTranslate2 build.

Synthesis options and results

Voice cloning accepts Drama 3-style references with an audio file path (or encoded file bytes), its transcript, and an optional speaker ID:

result = model.synthesize(
    "New words spoken in the reference voice.",
    references=[{"audio": "reference.wav", "text": "The words in the recording."}],
)

Audio is mixed to mono, resampled to 44100 Hz, and encoded once per call. References establish voices; history supplies previous narration. Set each reference's optional speaker (0–15) and matching <|speaker:N|> tags in target text for multiple speakers. A leading transcript speaker tag takes precedence.

CLI: --reference-audio reference.wav --reference-text "Recorded words". Repeat both flags for multiple references, optionally with one --reference-speaker each.

Pass engine options through engine_options. Experimental directed_spans splits explicit breathing events from speech:

result = model.synthesize(
    "Set the bag down. [breathing] We can continue now.",
    engine_options={"directed_spans": True, "max_frames": 534},
)

Speech spans are capped at 256 frames and breathing events at 22, within the overall budget. Events use empty history and do not condition later speech. Listen to check voice, prosody, and event quality. CLI: --directed-spans.

SynthesisResult includes audio, sample rate, and finish_reason. A "length" result may be truncated; the CLI saves it and exits with status 1. "eos" does not guarantee complete speech. Enable INFO logging for faster_tts.engines.drama3 for device and segment details.

See the API reference, python -m faster_tts --help, and CTranslate2 Drama 3 guide for options and conversion instructions.

Benchmark

Drama 3 only. See benchmark instructions to run your own measurements.

Benchmark results (2026-10-24)

CPU — AMD EPYC 7B13 (62 GiB RAM)

Test text: Hello! Welcome to our application.

Times in the CPU table are means. RTF is compute time divided by generated audio duration; lower is better, and 1 means real-time synthesis. Loading and warmup are excluded.

Implementation Precision Time (s) Audio duration (s) RTF Peak RAM (GiB RSS) Status
HF / PyTorch bfloat16 300.9 2.8 106.2 44.5 success
CTranslate2 bfloat16 — — — — unsupported (no matching precision)
HF / PyTorch float16 351.5 3.2 109.7 44.7 success
CTranslate2 float16 — — — — unsupported (no matching precision)
HF / PyTorch int8 — — — — unsupported (no matching precision)
CTranslate2 int8 18.4 2.4 7.6 44.7 success
HF / PyTorch int8_float32 — — — — unsupported (no matching precision)
CTranslate2 int8_float32 17.9 2.4 7.4 44.7 success
HF / PyTorch float32 155.2 3.0 52.2 51.3 success
CTranslate2 float32 37.7 2.5 15.0 45.5 success

GPU — NVIDIA Tesla T4 (15 GiB VRAM)

CTranslate2 4.8.4, 8 CPU threads, one warmup and three timed runs per successful configuration. Same test text as above. Times are means; peak RAM is process RSS and excludes VRAM. Expert cache: auto (10.874 GB), except the successful float16 run (8 GB).

Implementation Precision Time (s) Audio duration (s) RTF Peak RAM (GiB RSS) Status
CTranslate2 float16 — — — — CUDA OOM during warmup
CTranslate2 float32 34.5 2.5 13.8 34.5 success
CTranslate2 int8 27.3 4.3 6.3 36.6 success
CTranslate2 int8_float16 26.9 3.0 9.0 35.9 success
CTranslate2 int8_float32 27.2 4.3 6.3 36.6 success
CTranslate2 float16 37.9 3.7 10.3 36.0 success

GPU — NVIDIA L4

CTranslate2 4.8.4, 8 CPU threads, a 12 GB expert cache, one warmup and one timed run per configuration. Same test text as above. Loading and warmup are excluded; peak RAM is process RSS and excludes VRAM. Single runs do not measure timing variability.

Implementation Precision Time (s) Audio duration (s) RTF Peak RAM (GiB RSS) Status
CTranslate2 bfloat16 26.5 2.8 9.5 35.5 success
CTranslate2 float16 27.6 3.1 8.9 35.6 success
CTranslate2 float32 29.4 2.5 11.7 34.6 success
CTranslate2 int8 22.1 4.3 5.1 36.6 success
CTranslate2 int8_bfloat16 21.4 2.8 7.6 35.1 success
CTranslate2 int8_float16 22.8 3.0 7.7 35.9 success
CTranslate2 int8_float32 22.1 4.3 5.1 36.7 success

Contact: Jordi Mas jmas@softcatala.org

Metadata

Release files for faster-tts 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for faster-tts 0.0.2
File Size Uploaded Provenance Actions
faster_tts-0.0.2.tar.gz 52.7 kB Without provenance Details for faster_tts-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for faster-tts 0.0.2
File Interpreter ABI Platform Actions
faster_tts-0.0.2-py3-none-any.whl Python 3 none any Details for faster_tts-0.0.2-py3-none-any.whl

Total release size: 85.1 kB

Release files / faster_tts-0.0.2.tar.gz

Download URL faster_tts-0.0.2.tar.gz
Size 52.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3d5ec75d601d89ddaa1f7873b871cd5e99567b3d4d205d2e170edbc68cec0144
BLAKE2b-256 checksum
How to use checksums
7be9aaa9a699b7a0be3b18bcccbf454b212ff5b7bd8fcb0e7dfdd579fae74235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / faster_tts-0.0.2-py3-none-any.whl

Download URL faster_tts-0.0.2-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb32a9b66f10dc1c0cd0135c2881e552f23cc17439adc3050a8c7d9afefea4a8
BLAKE2b-256 checksum
How to use checksums
8b6876e49eeca1f06a5a0a91752cb963876c3e5d1c7b05b4f695a1fe1a267912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for faster-tts 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page