Skip to main content
SmartVoice logo

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?

  • One local service for speech: Transcribe audio and synthesize speech through the same API, without sending media to a cloud provider.
  • Choose models by language automatically: Use SmartVoice's virtual model IDs to route each request to an installed model configured for that language.
  • Works offline after setup: Install model files once, then run inference locally on CPU with no per-request API fee.

Capabilities

Area Capability
Platforms Windows x64 and macOS Apple Silicon, run from source
Inference sherpa-onnx on Windows x64 and macOS Apple Silicon; native C INT8 Qwen3-TTS on macOS Apple Silicon and Windows x64
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/Android, remote access, 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:

  1. Chinese: Qwen3-TTS → Matcha → Kokoro
  2. German, French, Spanish, Japanese, Korean: Supertonic → Qwen3-TTS
  3. English: Supertonic → Qwen3-TTS → Kokoro
  4. Portuguese, Russian, Italian: Supertonic → Qwen3-TTS
  5. 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

Models use the inference adapter identified in the catalog. Language availability describes catalog capability, not comparative quality; model and voice licenses may differ from SmartVoice's license. The recommended STT models are SenseVoice and Qwen3-ASR. TTS recommendations are reflected in the Smart routing priorities. Supertonic 3 does not support Chinese. Benchmark coverage varies by language, and TTS listening quality has not been rated with MOS.

Model ID Task Languages / voices Estimated model files Recommendation
stt-whisper-base-multilingual-int8 STT Auto detection; English, Chinese, Japanese, Korean, French, German ~0.16 GB —
stt-sensevoice-small-int8 STT Chinese, English, Cantonese, Japanese, Korean ~0.24 GB Recommended
stt-qwen3-asr-600m-int8 STT 30 language codes including Cantonese; automatic detection ~0.99 GB Recommended
tts-kokoro-multilingual-v1-1-zh-en TTS Chinese, English; 103 speakers ~0.41 GB Chinese / English fallback
tts-matcha-zh-baker TTS Chinese; one voice ~0.13 GB Chinese fallback
tts-supertonic-v3-multilingual-int8 TTS 31 languages; no Chinese ~0.15 GB Recommended for its supported languages
tts-qwen3-0-6b-customvoice TTS 10 languages; 9 preset voices ~2.50 GB Recommended for Chinese and measured multilingual routes

Catalog model sizes are estimates of the unpacked model files, rounded to two decimal places in decimal GB; actual disk use can vary slightly. The web test page shows the recorded on-disk size when available and otherwise labels the catalog estimate. Installation may need additional temporary space. Qwen3-TTS 0.6B needs at least 6 GiB free disk space during installation. See catalog/models.json for the byte estimates, exact language codes, sources, and model details.

Melo TTS has been removed from the supported catalog, and Supertonic 3 does not support Chinese. Existing model files are left on disk. If an older <data_dir>/router.json references the removed Melo model or routes Supertonic for Chinese, SmartVoice rejects that saved routing table, uses the built-in router, and reports a warning. Remove those stale entries and run python -m smartvoice router reload to clear the warning.

For routed STT requests with language=auto, SmartVoice uses the Whisper Tiny spoken-language detector when it is installed, then routes to an STT model for the detected language. python -m smartvoice models install all installs this detector by default. Without it, SmartVoice falls back to an installed STT model that supports automatic language detection. The detector is not downloaded during service startup. Its availability is reported by /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

From a source checkout, create a virtual environment and install the inference dependencies. Windows x64 source builds include the Qwen native runtime, so install the MSYS2 UCRT64 build tools described below before running pip install.

macOS:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[inference]"

Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[inference]"

Run these commands from the repository root. You do not need to activate the virtual environment. In the model and server commands below, replace python with .\.venv\Scripts\python.exe in Windows PowerShell.

On macOS Apple Silicon, the source install builds the native INT8 Qwen3-TTS runtime using Xcode Command Line Tools. On Windows x64, build the native runtime from the source checkout as described below.

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.

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 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 macOS Apple Silicon and Windows x64 after building its native runtime, install Qwen3-TTS to use the configured Chinese and multilingual routes:

python -m smartvoice models install tts-qwen3-0-6b-customvoice

On Windows, first build the native runtime as described in Build the Qwen3-TTS runtime on Windows. Then install the model as above. Without that runtime, the model will be 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

Start SmartVoice:

python -m smartvoice --host 127.0.0.1 --port 8000

Open the test page to verify basic STT and TTS functionality with your installed models. Open API docs for endpoint details. 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.wav

TTS returns mono WAV audio. Requests support up to 4,000 characters; generated audio is limited to 180 seconds or 32 MiB by default. See /docs or the API specification for available parameters, language behavior, and error codes.

Manage models

The CLI supports models list, 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. 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 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 and macOS Apple Silicon. Qwen3-TTS uses the native C INT8 adapter on both platforms; Windows x64 source deployments build its runtime with MSYS2 as described above. GPU providers, streaming, Linux 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 ".[inference,dev]"
python scripts/test.py ci

Run python scripts/test.py regression to execute the full functional suite including real STT/TTS inference. It directly smoke-tests each catalog model installed and available on the current runtime, using one representative language per model; unavailable models are skipped individually. The existing route integration scenarios also run when their optional models and language-ID assets are installed. See doc/testing.md for details and benchmarks/README.md for model quality, latency, and concurrency comparisons. 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.2.0

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

Source distribution (sdist)

Source distribution for smartvoice 0.2.0
File Size Uploaded
smartvoice-0.2.0.tar.gz 2.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for smartvoice 0.2.0
File Interpreter ABI Platform
smartvoice-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
smartvoice-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 23.9 MB

Release files / smartvoice-0.2.0.tar.gz

Download URL smartvoice-0.2.0.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
b622a4672014b423567d50633688b3d9f7abec088386c587f75af2baee7515bc
BLAKE2b-256 checksum
How to use checksums
0176d41dede172cf846f1feda129d531877e0e0d2f22020f88c5da41256f94a8
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 1, 2026.

Transparency log

Release files / smartvoice-0.2.0-py3-none-win_amd64.whl

Download URL smartvoice-0.2.0-py3-none-win_amd64.whl
Size 20.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
85affae2a828939b4184746b096c6daede3b96f94eb9fe64cc798e4d084d4d7a
BLAKE2b-256 checksum
How to use checksums
8f7fad6cce74fcba5dd843e1daa4470c125331bb152b5350f4c07d72beaa2a9d
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 1, 2026.

Transparency log

Release files / smartvoice-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL smartvoice-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 1.9 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ebd1df62cc5b657af3cf7ae8642eb3d2642a80b378e258d04a0e29e241b31f2b
BLAKE2b-256 checksum
How to use checksums
036723164c732818b6cc7eb296b33af1af84630f874d79cdd0fb46551f2e26ea
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.1

4 release files

This release

0.2.0 This release

3 release files

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