Skip to main content

ChatterboxSynth

Cleanroom Python synthesis frontend for the revision-pinned Chatterbox Nano v2 and Turbo ONNX bundles. OnnxVoice owns catalog access, installation, ONNX sessions, and the four-graph runtime; ChatterboxSynth owns tokenizer policy, reference audio, prepared voices, synthesis results, WAV output, and CLI.

Install

pip install "chatterboxsynth[cpu]"

ChatterboxSynth 0.1.x requires a Chatterbox-capable OnnxVoice 0.2.x release. Install chatterboxsynth[cpu] for the default ONNX Runtime CPU provider or chatterboxsynth[gpu] for CUDA.

ChatterboxSynth currently pins Python-SoXR 1.1.0 for reference-audio resampling.

Quick start

from chatterboxsynth import ChatterboxRuntime, GenerationConfig

with ChatterboxRuntime.from_pretrained("nano", quality="cpu", provider="cpu") as runtime:
    voice = runtime.prepare_voice("reference.wav")
    result = runtime.synthesize(
        "Hello from Chatterbox Nano.",
        voice=voice,
        config=GenerationConfig(max_new_tokens=1024, repetition_penalty=1.2),
    )
    result.save_wav("hello.wav")

Turbo supports [chuckle], [laugh], and other model-native tags:

with ChatterboxRuntime.from_pretrained("turbo", quality="fp32") as runtime:
    voice = runtime.prepare_voice("reference.wav")
    runtime.synthesize("Hello [chuckle] from Turbo.", voice=voice).save_wav("turbo.wav")

Turbo quality profiles

  • Turbo fp32: CPU-capable baseline, subject to available device memory.
  • Turbo q4f16: Provider-dependent, not a CPUExecutionProvider profile. The currently pinned published speech encoder requires AveragePool opset 19, which CPUExecutionProvider does not support. An explicit quality="q4f16" request with CPU is rejected before download; use Turbo fp32 for CPU or select an execution provider that supports the graph. No particular GPU provider is promised without end-to-end validation.

Use ChatterboxRuntime.load("/path/to/onnxvoice/install") for an already-installed OnnxVoice bundle. This local path reads the install manifest and verifies artifact sizes and SHA-256 values; it does not query a catalog or access the network.

For render-time opening of a managed model, use ChatterboxRuntime.from_installed("nano", quality="cpu"). It resolves and opens only a locally installed profile and never installs a model or refreshes a catalog. By contrast, from_pretrained() is the convenience path that may acquire and install a model.

CLI

chatterboxsynth models
chatterboxsynth download nano --quality cpu
chatterboxsynth synth --model nano --quality cpu --voice reference.wav --text "Hello" --output hello.wav
chatterboxsynth synth --model turbo --quality fp32 --voice reference.wav --text "Hello [chuckle]" --output turbo.wav

Common options include --provider cpu|cuda|auto, --offline, --cache-dir, --max-new-tokens, and --repetition-penalty. All catalog, cache, and model-install behavior is delegated to OnnxVoice.

Audio and request policy

prepare_voice() accepts an audio filename, AudioPrompt(samples, sample_rate), or a compatible PreparedVoice. Stereo audio is deterministically averaged to mono, validated as finite and within [-1, 1], and resampled to 24 kHz with soxr HQ. Prepared voice states cannot be reused across incompatible model/profile/source revisions.

Synthesis is deterministic greedy decoding. Empty text is rejected. The MVP does not split long text, stitch chunks, use random sampling, apply PerTh, or persist voice states. SynthesisResult validates non-empty finite mono float32 output at the bundle's 24 kHz rate; PCM16 WAV conversion clips only at the save boundary.

Request measurement and discovery

The public request contract is available from the package root: REQUEST_API_VERSION, request_api_contract(), SynthesisRequest, RequestMeasure, discover_bundles(), and runtime_identity(). runtime.measure_request(SynthesisRequest(id="request-1", text="Hello")) runs the same frontend encoding used by synthesis and reports the exact model-token count, including the export-specific EOT tokens. Measurement is tokenizer-only: it does not require a prepared voice, run ONNX inference, or acquire a model. Current bundles declare no finite text-input maximum, so accepted requests report maximum=None and fits=True. max_new_tokens and the bundle's default_max_new_tokens cap generated speech tokens; they are not text-input limits.

discover_bundles() normalizes the Chatterbox catalog and annotates profiles already present in the local OnnxVoice inventory. Discovery may refresh catalog metadata when requested, but it does not install models or open ONNX sessions.

Cleanroom and development

See docs/cleanroom.md and docs/architecture.md. Runtime dependencies exclude Chatterbox Python packages, Torch, Torchaudio, and Transformers. Tokenizers are loaded from the installed bundle, never package-global data.

pip install -e ".[cpu,dev]"
pytest
ruff check chatterboxsynth tests examples
mypy
python -m build

examples/first_wav.py --voice reference.wav uses a user-provided short WAV. No voice recording or model weights are included. setuptools_scm resolves package versions from Git metadata; a raw source ZIP without .git may report the documented fallback 0.0.0. Build publishable wheels and sdists from tagged Git checkouts.

Metadata

Release files for chatterboxsynth 0.1.3

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

Source distribution (sdist)

Source distribution for chatterboxsynth 0.1.3
File Size Uploaded Provenance Actions
chatterboxsynth-0.1.3.tar.gz 69.8 kB Without provenance Details for chatterboxsynth-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chatterboxsynth 0.1.3
File Interpreter ABI Platform Actions
chatterboxsynth-0.1.3-py3-none-any.whl Python 3 none any Details for chatterboxsynth-0.1.3-py3-none-any.whl

Total release size: 97.4 kB

Release files / chatterboxsynth-0.1.3.tar.gz

Download URL chatterboxsynth-0.1.3.tar.gz
Size 69.8 kB
Tags Source
SHA-256 checksum
How to use checksums
49d11da9e10e97388de9bd1a4a8d7e4d980c80a48ab19b2ceafc139f13a82358
BLAKE2b-256 checksum
How to use checksums
7feb0caabf70e0ecb255d39f1e86d257fbb65d1ce1554f24bae14514af88d3a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / chatterboxsynth-0.1.3-py3-none-any.whl

Download URL chatterboxsynth-0.1.3-py3-none-any.whl
Size 27.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c23cb600e2952463d837991db97ed1b2612a878122d1d8a36458cd34fa13de8
BLAKE2b-256 checksum
How to use checksums
2d3b85199f67ebbddbb2b8721d464c8c91f187405b093226f3707a62c2e65b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for chatterboxsynth 0.1.3

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.

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