Skip to main content

realtimetts-qwen-native-cpu

realtimetts-qwen-native-cpu is the CPU-only native binding used by the RealtimeTTS Qwen CPU server. The distribution name is realtimetts-qwen-native-cpu; the Python import is qwentts_cpp_cpu, so it can be installed beside the CUDA package without an import collision.

Version 0.5.1 adds the onset profile for reference-text cloning; 0.5.0 added the ICL prefix cache for cloning with a reference text (QwenTTS.set_icl_prefix_cache, see below). It bundles the qwentts.cpp CPU implementation at commit e2853ded14f820dcf550c9bf5e96037af80479be (C ABI v5), including the parked worker pool, strict affinity handling, onset-silence profiles, and CPU recovery path. Model weights and voice references are not included.

CPU scheduling

Pass cpu_codec_threads with a positive worker count to overlap audio decoding with code generation. cpu_stream_frames=2 selects 160 ms delivery chunks; zero retains the native default. Optional cpu_affinity and cpu_codec_affinity are logical-CPU masks; zero leaves scheduling to the OS. Defaults remain serial.

Set QWENTTS_CPU_STARTUP_PRIORITY=second_chunk before constructing a CPU context to prioritize the second decode block; unset/off preserves normal overlap. Requires overlap and a two/four-frame cadence, and is not a quality or sampling setting. See CHANGELOG.md for measurements and limitations.

Cloning with a reference text: prefix cache

Cloning with ref_text and ref_codes prefills the reference on every request. tts.set_icl_prefix_cache(16) keeps the rows that depend on the voice alone (prompt head and reference text) for up to 16 voices; later requests of a voice prefill only the rest. The audio is the same as without the cache. It is off by default, set_icl_prefix_cache(0) frees it, and icl_prefix_cache_stats() reports entries, hits and misses. ref_spk_emb may come from a longer recording than ref_codes: the speaker embedding and the prosody prompt are independent inputs.

Install

In a fresh virtual environment, install the matching wheel from PyPI:

python -m pip install --upgrade pip
python -m pip install "realtimetts-qwen-native-cpu==0.5.1"
python -c "import qwentts_cpp_cpu as q; print(q.__version__, q.QT_ABI_VERSION, q.CPU_ONLY)"

The release provides these CPU wheels:

Platform Wheel baseline
Linux x86_64 manylinux_2_35_x86_64 (glibc 2.35 or newer)
Windows x86_64 win_amd64
macOS Intel macosx_13_0_x86_64
macOS Apple Silicon macosx_11_0_arm64

The native payload has no CUDA, Metal, Vulkan, OpenMP, or BLAS dependency. The x86_64 builds use GGML_NATIVE=OFF with a fixed AVX2/FMA/F16C/BMI2 kernel baseline; they require a CPU with those features. The macOS arm64 wheel is built separately for Apple Silicon. There is no runtime CPU dispatcher or generic x86 fallback.

Only the four platform families above have bundled native wheels. On another platform, do not rely on an automatic source fallback: the sdist intentionally refuses to create a wheel without the pinned native library and a qualified qwentts.cpp checkout.

Use

from qwentts_cpp_cpu import QwenLibrary, QwenTTS

library = QwenLibrary()
assert library.cpu_only()
print(library.version())

Model files can be resolved from the configured Hugging Face repository:

from qwentts_cpp_cpu import resolve_gguf_paths

talker, codec = resolve_gguf_paths(
    "Qwen/Qwen3-TTS-12Hz-0.6B-Base", quant="Q8_0"
)

The full RealtimeTTS CPU server supplies HTTP streaming, segmentation, language detection, and recovery behavior on top of this binding.

Build from source

Clone this repository and the pinned native source, then build the wheel and sdist:

# Requires CMake, a C++ compiler, and the platform's native build tools.
git clone --branch v0.5.1 https://github.com/KoljaB/realtimetts-qwen-native.git
cd realtimetts-qwen-native
git clone https://github.com/KoljaB/qwentts.cpp.git third_party/qwentts.cpp
git -C third_party/qwentts.cpp checkout e2853ded14f820dcf550c9bf5e96037af80479be
git -C third_party/qwentts.cpp submodule update --init --recursive
python -m pip install --upgrade build
python scripts/build_native.py --source third_party/qwentts.cpp --backend cpu --clean
python -m build --sdist --wheel

The build helper verifies the native revision and ABI before configuring CMake. The wheel bundles only qwen, ggml, ggml-base, and ggml-cpu shared libraries with an origin-relative runtime path; it refuses a build with no native payload.

Metadata

Release files for realtimetts-qwen-native-cpu 0.5.1

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

Source distribution (sdist)

Source distribution for realtimetts-qwen-native-cpu 0.5.1
File Size Uploaded Provenance Actions
realtimetts_qwen_native_cpu-0.5.1.tar.gz 44.0 kB Without provenance Details for realtimetts_qwen_native_cpu-0.5.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for realtimetts-qwen-native-cpu 0.5.1
File Actions
realtimetts_qwen_native_cpu-0.5.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for realtimetts_qwen_native_cpu-0.5.1-py3-none-win_amd64.whl
realtimetts_qwen_native_cpu-0.5.1-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details for realtimetts_qwen_native_cpu-0.5.1-py3-none-manylinux_2_35_x86_64.whl
realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details for realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_13_0_x86_64.whl
realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_11_0_arm64.whl

Total release size: 5.2 MB

Release files / realtimetts_qwen_native_cpu-0.5.1.tar.gz

Download URL realtimetts_qwen_native_cpu-0.5.1.tar.gz
Size 44.0 kB
Tags Source
SHA-256 checksum
How to use checksums
34d49cf9a05d8c0b27912e4a19c87604b0aa4fc9306507bb8698c30729177192
BLAKE2b-256 checksum
How to use checksums
e0150a8da6eeb886307e4d6234bd525cee54c7c62b019d9f15ecc65788895c37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / realtimetts_qwen_native_cpu-0.5.1-py3-none-win_amd64.whl

Download URL realtimetts_qwen_native_cpu-0.5.1-py3-none-win_amd64.whl
Size 1.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e67701d25758d6d6176e3bea7ff55a18c8cb3d9d8df486b27a1a07aad419a49b
BLAKE2b-256 checksum
How to use checksums
ad44fe05e5c55154bd2db1ba1d5fc77dc2eddccbc5c49b4513b6b53a0a42c790
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / realtimetts_qwen_native_cpu-0.5.1-py3-none-manylinux_2_35_x86_64.whl

Download URL realtimetts_qwen_native_cpu-0.5.1-py3-none-manylinux_2_35_x86_64.whl
Size 914.1 kB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c7b826008d23649c6cb81456c6c4c29a3c494cdfc73035479aea90441470538d
BLAKE2b-256 checksum
How to use checksums
ef203aecea79256bee7bb56fc17a7db30c8762efeb3c408790534826bd33d5d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_13_0_x86_64.whl

Download URL realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_13_0_x86_64.whl
Size 1.7 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
0f819f56ae808da4833a4c25352b4a1908b8754a37c7661dbe66cfc57db71dc0
BLAKE2b-256 checksum
How to use checksums
f1c6498eed6d4bc0eef2639a9ad2feae06eeb804ad40110c3f8fbb50cf53f62b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_11_0_arm64.whl

Download URL realtimetts_qwen_native_cpu-0.5.1-py3-none-macosx_11_0_arm64.whl
Size 1.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8ccf1760cd34402402d97d17848c96a6ab0adbf4650b7aa9f9d4c64882bf61db
BLAKE2b-256 checksum
How to use checksums
c10b53d7934e2f29774bf5eb38e90238eb06c94c648db89952e2936606f1c9a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for realtimetts-qwen-native-cpu 0.5.1

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