Python ctypes bindings and wheel packaging for qwentts.cpp
Project description
qwentts-cpp-python
Python bindings and wheel packaging for Pascal's qwentts.cpp C ABI.
This package is intentionally small:
- it loads
libqwenwithctypes - it exposes buffered and streaming synthesis
- it can bundle prebuilt
libqwen/libggmlbinaries in platform wheels - it does not bundle GGUF model weights
CUDA development build with an existing qwentts.cpp checkout:
python scripts/build_native.py \
--source /path/to/qwentts.cpp \
--backend cuda \
--clean
QWENTTS_CPP_WHEEL_BUILD_TAG=1cu128 python -m build --wheel
CPU development build:
python scripts/build_native.py \
--source /path/to/qwentts.cpp \
--backend cpu \
--clean
QWENTTS_CPP_WHEEL_BUILD_TAG=1cpu python -m build --wheel
--backend cuda is the default because faster-qwen3-tts is a CUDA-first
package. CPU builds are still useful for development and smoke tests, but they
are not the primary release target.
The CI wheel build defaults to qwentts.cpp
9dbe7ea26a01b30fccb117ae5e86807c1dc23d42, which includes the scheduler
resets and ABI v2 cached voice-reference fields. CPU and CUDA both stay on the
backend prompt-projection path.
QWENTTS_CPP_WHEEL_BUILD_TAG is useful for local wheelhouses. For public
indexes, publish one backend flavor per package/version/platform compatibility
tag; otherwise pip has no way to choose between CPU and CUDA binaries.
Local smoke test with a built library:
QWENTTS_CPP_LIBRARY=/path/to/libqwen.so python - <<'PY'
from qwentts_cpp import QwenLibrary
lib = QwenLibrary()
print(lib.version())
PY
Model files are resolved with huggingface-hub by QwenTTS.from_pretrained(...)
or passed directly to QwenTTS(...) as GGUF paths.
Cached voice references
qwentts.cpp ABI v2 can skip reference WAV encoding for Base voice cloning by passing precomputed latents:
.spk: raw float32 speaker embedding fromqwen-codec --talker.rvq: packed 11-bit reference codec stream fromqwen-codec
from qwentts_cpp import QwenTTS, load_speaker_embedding
tts = QwenTTS.from_pretrained("Qwen/Qwen3-TTS-12Hz-1.7B-Base", quant="Q4_K_M")
spk = load_speaker_embedding("reference.spk")
audio, sr = tts.synthesize(
text="The sky is blue today.",
lang="english",
ref_spk_emb=spk,
max_new_tokens=128,
)
For ICL clone mode, load the RVQ matrix with the model's codebook count and also pass the reference transcript:
from qwentts_cpp import load_rvq_codes
rvq = load_rvq_codes("reference.rvq", tts.num_codebooks())
audio, sr = tts.synthesize(
text="The sky is blue today.",
lang="english",
ref_spk_emb=spk,
ref_codes=rvq,
ref_text="Transcript of the reference audio.",
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 104.3 MB
- Tags: Python 3, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b69107670f0de0d6e57483d42c7c716ec18ad5680d3a97e9a5d4b7e43718ee0d
|
|
| MD5 |
370da40c5ecba34cf75a056b17023364
|
|
| BLAKE2b-256 |
11f9574dd4c371bb96bbcbbf71cbd8ed45f2b8975501db531322a7e3f771858a
|
Provenance
The following attestation bundles were made for qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_x86_64.whl:
Publisher:
publish.yml on andimarafioti/qwentts-cpp-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_x86_64.whl -
Subject digest:
b69107670f0de0d6e57483d42c7c716ec18ad5680d3a97e9a5d4b7e43718ee0d - Sigstore transparency entry: 1958553768
- Sigstore integration time:
-
Permalink:
andimarafioti/qwentts-cpp-python@e8408c64ad03c46bfb3d9569837be2197148b234 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/andimarafioti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8408c64ad03c46bfb3d9569837be2197148b234 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_aarch64.whl.
File metadata
- Download URL: qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_aarch64.whl
- Upload date:
- Size: 104.0 MB
- Tags: Python 3, manylinux: glibc 2.39+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4449ea502cc213d8ebd589385786da88e6a6c32652a8bfcf66cd8889cd750b2
|
|
| MD5 |
d862af10a3124b21516aa5aea0bee0a8
|
|
| BLAKE2b-256 |
d5ce7e8c77dac538dec972a0f4556e7fb7edd345e0697b3df8013a286cace624
|
Provenance
The following attestation bundles were made for qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_aarch64.whl:
Publisher:
publish.yml on andimarafioti/qwentts-cpp-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qwentts_cpp_python-0.2.0-1cu128-py3-none-manylinux_2_39_aarch64.whl -
Subject digest:
d4449ea502cc213d8ebd589385786da88e6a6c32652a8bfcf66cd8889cd750b2 - Sigstore transparency entry: 1958553923
- Sigstore integration time:
-
Permalink:
andimarafioti/qwentts-cpp-python@e8408c64ad03c46bfb3d9569837be2197148b234 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/andimarafioti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e8408c64ad03c46bfb3d9569837be2197148b234 -
Trigger Event:
workflow_dispatch
-
Statement type: