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")

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.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 chatterboxsynth 0.1.2
File Size Uploaded Provenance Actions
chatterboxsynth-0.1.2.tar.gz 59.7 kB Without provenance Details for chatterboxsynth-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 86.8 kB

Release files / chatterboxsynth-0.1.2.tar.gz

Download URL chatterboxsynth-0.1.2.tar.gz
Size 59.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7624f2faddee1f6f4ce5bfc595e23c353ca67141268ce97adf21d33141340b50
BLAKE2b-256 checksum
How to use checksums
f44c67f325bda82ab2a00c544cb110f774e448199e07e248c2db2a2883dcfb36
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.2-py3-none-any.whl

Download URL chatterboxsynth-0.1.2-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc2e9275806870464a9f002216d04ef3f6335c78ece2dea0d1dc457a48290111
BLAKE2b-256 checksum
How to use checksums
277f4f5500d6a3da03d65f4668f1883f04ccef3c09e72cc2a33f40b341a7033d
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.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.

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