Local speech recognition and synthesis, with language-aware model routing.
Multilingual STT and TTS · CPU inference · OpenAPI · No per-request API fee
SmartVoice
SmartVoice is a local speech-to-text (STT) and text-to-speech (TTS) service. It offers both through one OpenAI-style audio API, with models installed and run on your machine.
Why SmartVoice?
- Private, local processing: Audio and text are processed by models on your machine, without sending inference requests to a third-party speech service. You control where your data, models, and service configuration live.
- One API for speech in both directions: Transcribe audio and synthesize speech through a single OpenAI-style audio API, making it straightforward to connect compatible agents and applications.
- Language-aware model routing: Send requests to
smartvoice-autoand SmartVoice selects an installed model for the requested task and language, following your editable priority list. - Freedom to manage and move models: Install only the models you need, choose explicit model IDs when desired, and export/import model packages to transfer them to another machine.
- Run locally without per-request fees: Supported CPU deployments work on Windows x64, macOS Apple Silicon, and Linux x86_64. After setup, inference can run offline without a cloud account or network connection.
Model installation and updates may download files from their configured sources. SmartVoice binds to 127.0.0.1 by default. If you expose the API on your network, it currently has no authentication, so restrict access with your network configuration and firewall.
Capabilities
| Area | Capability |
|---|---|
| Platforms | Windows x64, macOS Apple Silicon, and Linux x86_64 source builds and platform wheels; Linux is validated on Ubuntu 26.04 x86_64 |
| Inference | sherpa-onnx CPU inference and native C INT8 Qwen3-TTS runtimes are supported on all three targets, including model-backed inference on Linux x86_64 |
| STT | Whisper Base multilingual, SenseVoice Small, Qwen3-ASR 0.6B |
| TTS | Kokoro 1.1, Matcha Baker, Supertonic 3, Qwen3-TTS 0.6B |
| Smart routing | Selects an installed model by task and language using an editable priority list; smartvoice-auto works for both STT and TTS |
| API | OpenAPI docs, transcription, speech synthesis, model catalog and runtime status |
| Model management | Install, uninstall, offline import/export, and resumable downloads |
| Not yet supported | GPU inference, streaming, Linux/Windows ARM64, Intel macOS, Android, HTTPS, packaged installers, MCP |
For the architecture principles, implementation overview, per-backend OS/architecture/device/build matrix, and the difference between installed models and inference availability, see Architecture Summary and Guidelines.
SmartVoice supports a subset of OpenAI Audio API conventions; this is not a claim of full API compatibility. See the API specification for request and response details.
Smart routing
Smart routing selects an installed model using the request task, language, and an ordered, user-editable JSON table. Use smartvoice-auto for language-aware routing on either audio endpoint, or pass a concrete model ID to call that model directly.
TTS model priority order:
- Chinese: Qwen3-TTS → Matcha → Kokoro
- German, French, Spanish, Japanese, Korean: Supertonic → Qwen3-TTS
- English: Supertonic → Qwen3-TTS → Kokoro
- Portuguese, Russian, Italian: Supertonic → Qwen3-TTS
- Other supported languages: Supertonic
For STT, the built-in route table prioritizes SenseVoice for Chinese, English, Cantonese, Japanese, and Korean; Qwen3-ASR covers the remaining configured languages, with Whisper as a fallback for selected languages.
SmartVoice routes by the API endpoint and language:
| Request | Virtual model ID | Language source |
|---|---|---|
| Transcription | smartvoice-auto |
Explicit language, or automatic detection when omitted or auto |
| Speech synthesis | smartvoice-auto |
Explicit language, or text detection when omitted or auto |
The built-in route table is copied to <data_dir>/router.json on first startup. Edit it to customize model priorities, then apply changes without restarting:
python -m smartvoice router reload
The first installed and verified candidate is selected. An inference failure does not trigger a retry with the next candidate. See the API specification for request details.
Model catalog
Language availability describes catalog support, not comparative quality. Model and voice licenses may differ from SmartVoice's license.
| Model ID | Task | Languages / voices | Estimated model files | Hot-request RTF | req/s per CPU core |
|---|---|---|---|---|---|
stt-whisper-base-multilingual-int8 |
STT | Auto detection; English, Chinese, Japanese, Korean, French, German | ~0.16 GB | 0.052 | 1.237 |
stt-sensevoice-small-int8 |
STT | Chinese, English, Cantonese, Japanese, Korean | ~0.24 GB | 0.017 | 4.169 |
stt-qwen3-asr-600m-int8 |
STT | 30 language codes including Cantonese; automatic detection | ~0.99 GB | 0.274 | 0.643 |
tts-kokoro-multilingual-v1-1-zh-en |
TTS | Chinese, English; 103 speakers | ~0.43 GB | 0.324 | 0.329 |
tts-matcha-zh-baker |
TTS | Chinese; one voice | ~0.15 GB | 0.030 | 2.379 |
tts-supertonic-v3-multilingual-int8 |
TTS | 31 languages; no Chinese | ~0.15 GB | 0.236 | 0.692 |
tts-qwen3-0-6b-customvoice |
TTS | 10 languages; 9 preset voices | ~2.50 GB | 0.557 | Not measured* |
RTF is the median for warm requests (Chinese where supported; English for Supertonic); lower is faster relative to audio duration. Throughput per CPU core is measured at the highest passing parallel request rate. Both use representative samples and are specific to the test platform: an Apple Silicon Mac running macOS 27.0, with 10 logical CPUs, 16 GiB RAM, Python 3.11.9, and sherpa-onnx 1.13.8. Sherpa tests used two instances, two threads per instance, and a four-request waiting limit; Qwen3-TTS uses one serialized native runtime. Qwen3-TTS's per-core rate is unavailable because its native engine process was not fully included in CPU sampling. See the benchmark reports for details.
Model sizes are approximate unpacked sizes; see catalog/models.json for exact assets and sizes. Qwen3-TTS 0.6B needs at least 6 GiB free during installation. Its Windows runtime requires AVX2 and FMA; Linux builds use the builder's available instruction set. See the platform compatibility notes.
For STT requests with language=auto, SmartVoice uses the optional Whisper Tiny language detector, then routes by the detected language. python -m smartvoice models install all installs it; otherwise SmartVoice uses an installed model that supports automatic detection. Its availability appears in /v1/capabilities.
Quick start
SmartVoice requires Python 3.11 or newer and runs inference on CPU. The service binds to 127.0.0.1 by default.
1. Install SmartVoice
Choose an installation method below. The PyPI option is recommended for normal use; the source option is for development or when you want an editable checkout.
From PyPI
Install the package for your platform. The macOS Apple Silicon, Windows x64, and Linux x86_64 wheels include the native Qwen3-TTS runtime. The Linux wheel is tagged manylinux_2_38_x86_64, bundles OpenBLAS and its required runtime libraries, and requires glibc 2.38 or newer. Linux x86_64 clean installation and model inference are validated on Ubuntu 26.04. CPUs without the native runtime's required instructions and Linux ARM64 are not supported by this wheel.
macOS Apple Silicon:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install smartvoice
Linux x86_64 (Ubuntu 24.04 or newer):
python3 -m venv .venv
source .venv/bin/activate
python -m pip install smartvoice
Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install smartvoice
From source
Run these commands from the repository root. Windows x64 source builds include the Qwen native runtime, so install the MSYS2 build tools described below before installing SmartVoice. Linux x86_64 source builds require GCC, Make, and OpenBLAS development files.
macOS:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .
Ubuntu 26.04, x86_64 (the validated Linux baseline):
sudo apt-get update
sudo apt-get install -y python3-venv build-essential libopenblas-dev
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e .
On macOS Apple Silicon, the source install builds the native INT8 Qwen3-TTS runtime using Xcode Command Line Tools. Windows x64 and Linux x86_64 source deployments need the explicit native build step described below.
Build the Qwen3-TTS runtime on Linux
The Linux x86_64 source build uses GCC, Make, and OpenBLAS. The builder detects the CPU instructions exposed by the current machine and runs the native kernel self-test before staging the runtime. On Ubuntu, install the prerequisites with:
sudo apt-get install -y build-essential libopenblas-dev
For an editable source checkout, run the builder explicitly to stage the runtime in the source package:
SMARTVOICE_QWEN_OUTPUT="$PWD/src/smartvoice/resources/bin" \
python scripts/build_qwen3_tts_linux.py
The builder stages qwen_tts and the runtime dependency license notices in the package resources. Source builds link to system OpenBLAS, so keep the OpenBLAS runtime package installed. The published Linux wheel bundles OpenBLAS and its required runtime libraries.
Build the Qwen3-TTS runtime on Windows
The Windows source deployment builds Qwen3-TTS with MSYS2 UCRT64 GCC and OpenBLAS. Install MSYS2 and its UCRT64 toolchain packages in an elevated MSYS2 UCRT64 terminal before installing SmartVoice:
pacman -S --needed make gcc diffutils mingw-w64-ucrt-x86_64-openblas
Then, from the SmartVoice repository root in PowerShell, build the runtime into the source package and check that it starts:
# Omit this if MSYS2 is installed at C:\msys64 or %USERPROFILE%\msys64.
$env:SMARTVOICE_MSYS2_ROOT = "C:\msys64"
$env:SMARTVOICE_QWEN_OUTPUT = "$PWD\src\smartvoice\resources\bin"
.\.venv\Scripts\python.exe .\scripts\build_qwen3_tts_windows.py
The build script runs the native runtime self-test and stages qwen_tts.exe, its required runtime DLLs, and license notices in src/smartvoice/resources/bin for the editable source checkout. The Windows package build also bundles the runtime in its build output. These generated binaries are local build artifacts and are not committed. If MSYS2 is installed elsewhere, set SMARTVOICE_MSYS2_ROOT to that directory. Python source installation remains editable; a SmartVoice wheel is not required.
Activate .venv before running the model and server commands below. On Windows PowerShell, you can instead keep the environment inactive and replace python with .\.venv\Scripts\python.exe in those commands.
2. Download models
Install a basic STT and TTS model. Model files are downloaded once and stored outside the source checkout, under ~/Library/Application Support/SmartVoice on macOS, ~/.smartvoice on Linux, or %LOCALAPPDATA%\SmartVoice on Windows.
python -m smartvoice models install stt-sensevoice-small-int8
python -m smartvoice models install tts-kokoro-multilingual-v1-1-zh-en
python -m smartvoice models install-language-id
On the macOS Apple Silicon, Windows x64, and Linux x86_64 PyPI wheels, the Qwen3-TTS runtime is bundled. From a source checkout, build the runtime on Windows and Linux as described above; the macOS source build compiles it during installation. Then install Qwen3-TTS to use the configured Chinese and multilingual routes:
python -m smartvoice models install tts-qwen3-0-6b-customvoice
Without the native runtime in a source deployment, Qwen3-TTS is listed as unavailable and other installed TTS models remain usable.
The first model installation requires internet access. After installation, inference runs locally. See Model catalog for supported languages and estimated sizes.
3. Start SmartVoice
By default the HTTP service listens only on 127.0.0.1. To allow other machines to connect, explicitly bind to an external interface, for example:
python -m smartvoice --host 127.0.0.1 --port 8000
# To listen on all IPv4 interfaces:
python -m smartvoice --host 0.0.0.0 --port 8000
External binding is plain HTTP without API authentication. Use it only on a trusted network and configure the machine firewall as needed. HTTPS is not currently supported.
Open the SmartVoice Console to use the speech workspace, review installed models, and verify STT/TTS with your installed models before connecting an application. Open API docs for endpoint details. Sherpa models use a lazy per-model instance pool: parallel inference is enabled by default, one instance is retained, and demand can expand the pool to two independent instances with two native threads each. The per-model waiting limit defaults to four. These settings do not promise a fixed request rate for every model or input. See inference concurrency and the fixed-arrival benchmark protocol. Service settings are stored in <data_dir>/smartvoice.json; routing priorities are stored separately in <data_dir>/router.json and can be reloaded with python -m smartvoice router reload.
4. Connect an agent or application
In your agent or application's settings, choose OpenAI-compatible API and set the SmartVoice API base URL to:
http://127.0.0.1:8000/v1
API
The audio endpoints follow a supported subset of the OpenAI Audio API conventions. For request fields, response formats, and errors, see the API specification.
Transcribe audio with routing
curl.exe -F "file=@sample.wav" -F "model=smartvoice-auto" -F "language=auto" `
http://127.0.0.1:8000/v1/audio/transcriptions
Supported upload formats include WAV, MP3, M4A, and FLAC. Audio is limited to 25 MiB and 10 minutes by default.
Synthesize speech with routing
curl.exe -X POST http://127.0.0.1:8000/v1/audio/speech `
-H "Content-Type: application/json" `
-d '{"model":"smartvoice-auto","input":"Hello from SmartVoice.","language":"auto"}' `
--output speech.mp3
TTS defaults to mono MP3 (96 kbps); send "response_format":"wav" for WAV. Requests support up to 4,000 characters; generated audio is limited to 180 seconds, with separate 32 MiB canonical WAV and final-response budgets. Supertonic uses bounded text chunks; long STT inputs use silence-aware model-declared windows (25 seconds for Whisper Base; 15 seconds by default) with 1-second overlap and a single language decision across chunks, while retaining the 10-minute input limit. See /docs or the API specification for available parameters, language behavior, and error codes. The local Whisper Chinese decoding repair requires a patched native wheel; see build and validation instructions.
Manage models
The CLI supports models list, refresh, install, uninstall, export, and import. models list groups models by installed state, then by STT, TTS, and SmartVoice native; each model shows its availability, and unavailable models include a reason. Availability checks both model-file integrity and the active inference runtime/device. The running service keeps one process-wide model availability snapshot, initializes it at startup, and updates it after model management operations. If model files are changed outside the running service, refresh that snapshot with python -m smartvoice models refresh or POST /v1/models/refresh. As a fallback, the service checks the snapshot every 10 minutes and refreshes it in the background while continuing to serve the last successful snapshot. A failed TTL refresh is retried after 5, 10, and 15 seconds; after three retries it waits for a manual or model-management refresh to resume scanning. Configure the interval with model_availability_ttl_seconds or SMARTVOICE_MODEL_AVAILABILITY_TTL_SECONDS. Use python -m smartvoice models install all to install every catalog model that is not already installed and the Whisper Tiny language detector. Model downloads run sequentially from their catalog sources; invalid existing model directories are skipped with a repair hint. Installing all models can require several gigabytes of disk space. On Windows x64, Qwen3-TTS is available only when its native runtime has been built; see Build the Qwen3-TTS runtime on Windows. Models can also be installed through API download jobs. Exported model packages can be transferred to offline machines and imported there. An installed model cannot be uninstalled while the service is using it.
Install a model with python -m smartvoice models install <model-id>. By default, SmartVoice uses the model's catalog source. For Hugging Face models, pass --source with a compatible mirror base URL to use another source, such as:
python -m smartvoice models install stt-qwen3-asr-600m-int8 --source https://hf-mirror.com
The base URL is combined with the catalog-pinned repository, revision, and file paths. This option is available only when all required model files are hosted on Hugging Face. Downloaded files are still checked against their catalog SHA-256 values.
python -m smartvoice models list
python -m smartvoice models refresh
python -m smartvoice models export stt-sensevoice-small-int8 ./sensevoice.smartvoice.zip
python -m smartvoice models import ./sensevoice.smartvoice.zip
python -m smartvoice models uninstall stt-sensevoice-small-int8
Architecture
Client / Agent ──► Versioned HTTP API ──► Application services
▲ │
│ ▼
Local CLI Domain contracts
│
┌─────────────────┴─────────────────┐
▼ ▼
Inference port Model repository port
│ │
▼ ▼
Composite inference provider Filesystem catalog adapter
┌───────┴────────┐
▼ ▼
sherpa-onnx native C INT8 Qwen-TTS
adapter adapter
│
▼
Platform diagnostics adapter
Callers use versioned API and capability endpoints; inference details stay behind provider and repository interfaces. The source deployment supports CPU inference on Windows x64, macOS Apple Silicon, and Linux x86_64. Qwen3-TTS uses the native C INT8 adapter on all three platforms; Linux source deployments build against the system OpenBLAS library as described above. GPU providers, streaming, and Android runtimes are not available in SmartVoice. See Architecture Summary and Guidelines for the detailed matrix and model availability semantics.
Development
python -m pip install -e ".[dev]"
python scripts/test.py ci
python scripts/test.py regression is the default inference regression suite. It includes the existing functional and real-inference tests, short bilingual functional cases for SenseVoice, Qwen3-ASR, and Whisper, audio-window boundary cases, and 75-second segmented inputs. Models not installed on the current runtime are skipped individually. Run python scripts/test.py full for every CI and regression test plus 300- and 590-second bilingual inputs across all three STT models. Full mode requires all three models and the validated patched Whisper runtime; it fails its prerequisite check rather than silently skipping them. Long-input expansion is intentionally excluded from the default regression run. The STT tests check functional success and response metadata, not transcript accuracy. See doc/testing.md and tests/fixtures/stt/README.md for suite details.
See doc/releasing.md for versioning, GitHub Releases, and optional PyPI publishing.
Repository layout
catalog/ Model metadata and default router table
src/ API/CLI entry points, application services, domain contracts, ports, and adapters
tests/ Unit, API, and optional real-inference tests
benchmarks/ Benchmark code, configurations, and results
config/ Example service settings
doc/ API specification, testing, release, requirements, and design notes
assets/ Project logo
License
SmartVoice source code is licensed under the Apache License 2.0. Model weights, voices, and other third-party assets may have separate license terms; review them before use or redistribution.
Metadata
Release files for smartvoice 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| smartvoice-0.3.0.tar.gz | 2.1 MB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smartvoice-0.3.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| smartvoice-0.3.0-py3-none-manylinux_2_38_x86_64.whl | Python 3 | none | Linux glibc 2.38+ x86-64 | Details |
| smartvoice-0.3.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 38.2 MB
Release files / smartvoice-0.3.0.tar.gz
| Download URL | smartvoice-0.3.0.tar.gz |
|---|---|
| Size | 2.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80456cf2479a9686cbddebc3b358ab377c7a9d91bc274fe94b7abf5611a3c32c
|
|
BLAKE2b-256 checksum How to use checksums |
f6ae8798d8ca2d6d6316f6c8c431ee3c72b066873129db7e2ca96e6ba0601cd4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / smartvoice-0.3.0-py3-none-win_amd64.whl
| Download URL | smartvoice-0.3.0-py3-none-win_amd64.whl |
|---|---|
| Size | 20.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e0fbd4cb3a3aa0866ecb597aa5eb1732a2e6571bf9d7566285133554a43dc276
|
|
BLAKE2b-256 checksum How to use checksums |
db618686eca2b399c21ebb276769986a52030dc05635086b7f4d84e8347ce910
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / smartvoice-0.3.0-py3-none-manylinux_2_38_x86_64.whl
| Download URL | smartvoice-0.3.0-py3-none-manylinux_2_38_x86_64.whl |
|---|---|
| Size | 14.1 MB |
| Tags | Linux glibc 2.38+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
818ddd383c46c205eefbda2f469b16832a39e011ca6a741d9adc6263ead8672d
|
|
BLAKE2b-256 checksum How to use checksums |
aa8db4a075bb1b887618d7a25e73e8d13e921e175cde75437d78659faf77e8e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency logRelease files / smartvoice-0.3.0-py3-none-macosx_11_0_arm64.whl
| Download URL | smartvoice-0.3.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8073ad5e5bcac3819dce560f9da908ac0e7993f7a742f15415bc36a7c030f58a
|
|
BLAKE2b-256 checksum How to use checksums |
06482cf39b1b2fab4aebad5b629aeb78ef8ea083f32d472a41722bb8052fd722
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.
Transparency log