Skip to content

feat(voice): support April Pocket model bundles - #3303

Draft
johnmatthewtennant wants to merge 1 commit into
jt/buzz-voice-refactorfrom
jtennant/pocket-tts-april-runtime
Draft

feat(voice): support April Pocket model bundles#3303
johnmatthewtennant wants to merge 1 commit into
jt/buzz-voice-refactorfrom
jtennant/pocket-tts-april-runtime

Conversation

@johnmatthewtennant

Copy link
Copy Markdown
Contributor

Context

Pocket's April 2026 ONNX release changes the tokenizer and native inference loop. Buzz Voice needs a reusable, caller-provided model-bundle layer before Desktop and Mobile can adopt the release independently.

This PR is stacked directly on #2467 and intentionally excludes model acquisition, cache migration, platform packaging, UI, and playback policy.

Summary

Adds a platform-neutral April Pocket runtime with pinned FP32 and INT8 bundle metadata, deterministic validation, tokenizer-aware 50-token chunking, and callback-compatible synthesis.

Changes

  • Add the April tokenizer, BOS handling, recurrent inference loop, and PCM synthesis path.
  • Add explicit PocketPrecision, PocketModelSelection, and PocketLoadOptions APIs while preserving the existing loader and synthesis APIs.
  • Expose immutable model information: revision, precision, artifact names, SHA-256 checksums, byte sizes, maximum token count, sample rate, and quantized graph names.
  • Validate complete caller-provided bundles and return deterministic errors for missing or mismatched variants.
  • Add resident-engine token-aware chunking and transparently handle synthesis input over the model's exact 50-token limit.
  • Add a raw, untrimmed onset-stress example for reviewer reproduction.

Related issue

N/A

Testing

  • just ci
    • Rust formatting, workspace checks, and lint
    • Desktop checks, 1,801 core tests, 3 audio mixer diagnostics, web tests/build
    • Mobile formatting, analysis, and full Flutter test suite
  • cargo test --locked -p buzz-voice
    • 18 passed, 6 model-dependent tests ignored by default
  • With January and April model directories configured, all 6 model-dependent tests passed:
    • unknown-word tokenizer behavior
    • exact token splitting
    • callback cancellation
    • FP32 and INT8 non-silent output
    • oversized public synthesis
    • January source compatibility
  • Release onset synthesis completed for FP32 and INT8.
  • macOS linkage inspection found one system C++ runtime and no duplicate ONNX Runtime image.
  • Full review fanout completed cleanly: BuilderBot, Kalvin, diff minimization, NCMB, dead code, timeless comments, and Stacksmith placement against the exact stack.

Screenshots

N/A — runtime-only Rust change with no UI.

Reviewer-reproducible examples

Canonical base:

91eaee8804ec0c139a53782212df44a70aa994c1

Upstream bundle contract:

Model: KevinAHM/pocket-tts-onnx
Revision: 58a6d00cf13d239b6748cb0769f35c580a8f606c
Bundle: english_2026-04
License: CC-BY-4.0
FP32 bytes: 439555904
Hybrid INT8 bytes: 165232420
INT8 graphs: flow_lm_main, flow_lm_flow, mimi_decoder

Exact artifact names, byte sizes, and SHA-256 checksums are defined in crates/buzz-voice/src/pocket_models.rs.

Run the unit suite:

cargo test --locked -p buzz-voice

Run the model-backed gates:

BUZZ_POCKET_JANUARY_MODEL_DIR="$HOME/.buzz/models/pocket-tts" \
BUZZ_POCKET_APRIL_MODEL_DIR="/path/to/english_2026-04-fp32" \
BUZZ_POCKET_APRIL_INT8_MODEL_DIR="/path/to/english_2026-04-int8" \
cargo test --locked -p buzz-voice -- --ignored

Generate the raw, untrimmed onset-stress clip:

BUZZ_POCKET_APRIL_MODEL_DIR="/path/to/english_2026-04-fp32" \
cargo run --release -p buzz-voice --example pocket_april_onset -- \
  "/path/to/reference.wav" "/tmp/pocket-april-onset-raw.wav"

Locally generated FP32 evidence:

SHA-256: e2b8e7219f75a4924eca39e4b679500da4ecd824e14f6ea096f9965e8665511e
PCM: 24 kHz mono, 353280 samples, 14.720 seconds
Post-processing: none

Listening checklist:

  • Is the first phoneme of every synthesis unit present and undistorted?
  • Are phrase starts free of bursts, dropouts, or other onset artifacts?
  • Are inserted unit boundaries free of clicks?
  • Is speech intelligible and stable through the final unit?

@johnmatthewtennant
johnmatthewtennant force-pushed the jtennant/pocket-tts-april-runtime branch from 394b4b4 to d9193ad Compare July 28, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant