Skip to main content

wfloat

wfloat is the Python package for Wfloat's on-device model families, including TTS, STT, VAD, and LLM.

It runs inference locally in Python instead of calling a hosted inference API. The TTS model supports 20 voices with emotion and intensity control.

If you're building for the browser, use @wfloat/wfloat-web. If you're building for React Native, use @wfloat/react-native-wfloat.

Browser demo to hear how it sounds: https://wfloat.com/demo

Install

pip install wfloat

Usage

import wfloat

tts = wfloat.load_tts_model("wfloat/wfloat-tts")

result = tts.synthesize(
    text="No, no, that's not possible.",
    voice="mad_scientist_woman",
    emotion="surprise",
    intensity=0.7,
)

print(result.model_id)
print(result.timeline.chunks[0].text)

For multi-speaker dialogue:

import wfloat

tts = wfloat.load_tts_model("wfloat/wfloat-tts")

result = tts.synthesize_dialogue(
    segments=[
        {
            "voice": "wise_elder_man",
            "text": "Rain taps against the tavern shutters as you step inside.",
            "emotion": "neutral",
            "intensity": 0.5,
        },
        {
            "voice": "strong_hero_man",
            "text": "You're late. Two bandits stole the king's map over three hours ago.",
            "emotion": "fear",
            "intensity": 0.6,
        },
        {
            "voice": "strong_hero_man",
            "text": "They fled north, up into the woods.",
            "emotion": "neutral",
            "intensity": 0.5,
        },
    ],
    silence_between_segments_sec=0.35,
)

result.audio.save("dialogue.wav")

The older load(...), generate(...), and generate_dialogue(...) names are still available as compatibility aliases.

STT Usage

The shared Python entrypoint is load_stt_model(...), with load_whisper_tiny_en(...) as a convenience wrapper for offline STT:

import wfloat

stt = wfloat.load_stt_model(
    "openai/whisper-tiny-en",
)

result = stt.transcribe(audio="/path/to/audio.wav")
print(result.text)

The loader accepts canonical built-in model IDs and resolves Wfloat-hosted registry assets internally.

Streaming-capable STT families also expose a separate session path instead of overloading transcribe(...):

stt = wfloat.load_stt_model("k2-fsa/streaming-zipformer-en")
session = stt.create_session()

session.push(audio_chunk, sample_rate=16000)
partial = session.get_result()
final_result = session.finish()
session.close()

VAD Usage

Python also exposes the same one-shot VAD model shape as the web and React Native packages. It is intentionally file/buffer based for now; there is no Python live microphone/session helper. The Python VAD path uses wfloat-core, matching the TTS, STT, and LLM backend boundary.

vad = wfloat.load_vad_model(
    "snakers4/silero-vad",
    threshold=0.5,
    min_silence_duration_sec=0.5,
    min_speech_duration_sec=0.25,
    max_speech_duration_sec=20.0,
)

result = vad.detect(audio="/path/to/mono-16khz.wav")

for segment in result.segments:
    print(segment.start_sec, segment.duration_sec)

VAD currently expects mono 16 kHz audio.

LLM Usage

The Python LLM path loads local GGUF artifacts through wfloat-core:

import wfloat

llm = wfloat.load_llm_model("HuggingFaceTB/SmolLM2-360M-Instruct")
result = llm.generate("Write one calm sentence about local inference.", seed=0)
print(result.text)
llm.close()

CLI Usage

You can also generate a WAV from the command line:

wfloat generate \
  --text "Hello world!" \
  --out out.wav \
  --voice-id mad_scientist_woman \
  --emotion surprise \
  --intensity 0.7 \
  --silence-padding-sec 0

For the full CLI help:

wfloat generate --help

The first load downloads the model assets. After that, the package uses the cached local copy.

Native Backend

Python TTS, STT, VAD, and LLM use the wfloat-core native runtime. Release wheels bundle the platform-specific shared library inside the wfloat package.

Inside this monorepo, local development can point at an explicit build artifact with:

export WFLOAT_CORE_LIBRARY=/abs/path/to/libwfloat-core.so

Speaker IDs

Use voice_id string names or numeric sid values:

Speaker SID
skilled_hero_man 0
skilled_hero_woman 1
fun_hero_man 2
fun_hero_woman 3
strong_hero_man 4
strong_hero_woman 5
mad_scientist_man 6
mad_scientist_woman 7
clever_villain_man 8
clever_villain_woman 9
narrator_man 10
narrator_woman 11
wise_elder_man 12
wise_elder_woman 13
outgoing_anime_man 14
outgoing_anime_woman 15
scary_villain_man 16
scary_villain_woman 17
news_reporter_man 18
news_reporter_woman 19

Emotions

Supported emotion labels:

  • neutral
  • joy
  • sadness
  • anger
  • fear
  • surprise
  • dismissive
  • confusion

intensity must be between 0.0 and 1.0.

More

Metadata

Release files for wfloat 2.0.0

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

Built distributions (wheels)

Table of built distributions (wheels) for wfloat 2.0.0
File
wfloat-2.0.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
wfloat-2.0.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
wfloat-2.0.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
wfloat-2.0.0-py3-none-macosx_12_0_x86_64.whl Python 3 none macOS 12.0+ x86-64 Details
wfloat-2.0.0-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details

Total release size: 61.4 MB

Release files / wfloat-2.0.0-py3-none-win_amd64.whl

Download URL wfloat-2.0.0-py3-none-win_amd64.whl
Size 8.1 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d0906c2617d6f034169abe4c6598d35c1dcf81d23c1532353e5661917a353885
BLAKE2b-256 checksum
How to use checksums
7f16bfa279d6583c2b23133c2ec0e09c9984d83a7055ff271789738451894a3b
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 Aug 11, 2026.

Transparency log

Release files / wfloat-2.0.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL wfloat-2.0.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 15.1 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
569cf204f91fef841139dee2ffe445416aae5a6cd8596385ea0ed52a71cbae23
BLAKE2b-256 checksum
How to use checksums
81216d04451283b9dd4e341b18319ace345329551266a09e26a03d4c5e6cc2ce
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 Aug 11, 2026.

Transparency log

Release files / wfloat-2.0.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL wfloat-2.0.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 17.4 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0bbbc1fb2f8f4919900796b9853bc3e9fb8a09e551f91fc8e4a93e9de63725b4
BLAKE2b-256 checksum
How to use checksums
b695ee4184de3592b2bc7a5550719c9b19b3e4d0c5dbc82ff7c14f48423cecc1
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 Aug 11, 2026.

Transparency log

Release files / wfloat-2.0.0-py3-none-macosx_12_0_x86_64.whl

Download URL wfloat-2.0.0-py3-none-macosx_12_0_x86_64.whl
Size 11.0 MB
Tags Python 3 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
4f793b35cfc16f83b2a4076565e6133bc77e5521b360eea859adef3dc11d0e6a
BLAKE2b-256 checksum
How to use checksums
a1264d9c413bd25f21f796a0efa33fc6a02369c09e78cbaf682b9406acaee4d5
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 Aug 11, 2026.

Transparency log

Release files / wfloat-2.0.0-py3-none-macosx_12_0_arm64.whl

Download URL wfloat-2.0.0-py3-none-macosx_12_0_arm64.whl
Size 9.8 MB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
619962cee0ae43e4252d46ae7dc1468e40445ef4227195c12ae8ec5ae59eb7b1
BLAKE2b-256 checksum
How to use checksums
ef5b320a56b53b8462c6e190778f38c0fbb390cfb643fdd25905f111b1c228e9
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 Aug 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.0 This release

5 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 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