Skip to content

feat(asr): add experimental Whistle community model - #824

Merged
0xShug0 merged 5 commits into
0xShug0:mainfrom
BumpyClock:feat/whistle-asr
Oct 8, 2026
Merged

0xShug0 merged 5 commits into
0xShug0:mainfrom
BumpyClock:feat/whistle-asr

Conversation

@BumpyClock

@BumpyClock BumpyClock commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add experimental whistle_asr as a community ASR family, following Welcoming Community Models && Using Model Spec v1 for New Models #54
  • implement offline recognition using the published FP32 checkpoint: NemoMelFrontend mel features, the encoder as one GGML graph on framework modules (CPU and Metal), and a host-side autoregressive decoder
  • use model spec v1 and the generic spec-backed loader; keep the family identifier whistle_asr
  • add local conversion to a self-contained GGUF with the model spec, configuration, tokenizer, mel filterbank, Hadamard permutations, and upstream LICENSE
  • add frontend, tokenizer, and opt-in integration tests, community listings, and model-specific documentation/licensing records
  • keep model packages empty; do not publish weights or commit generated models, audio, or logs

The port lives under src/community_models/whistle_asr/ and include/engine/community_models/whistle_asr/.
There are no framework or GGML changes. Recognition does not require Python or the Cactus engine.
Input is 16 kHz mono audio up to 30 seconds. Supported language codes are en, de, fr, es, it, nl, and pl.

Model setup and tested paths

The converter pins Cactus-Compute/whistle revision b358ddadd89b7a713b5aa131f23032d3cca1b251.
The source directory contains whistle.safetensors, config.json, and the upstream LICENSE.
The official whistle.cact remains outside it and supplies the tokenizer, filterbank, and permutations.
The converter verifies input sizes/hashes and preserves FP32 weights with --type orig.

Exact local preparation/conversion commands:

New-Item -ItemType Directory -Force build/whistle/pr-prep/source,build/whistle/pr-prep/model,build/whistle/pr-prep/standalone
Copy-Item -LiteralPath C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/source/whistle.safetensors,C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/source/config.json,C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/source/LICENSE -Destination build/whistle/pr-prep/source
python tools/community_models/whistle_asr/convert.py --source build/whistle/pr-prep/source --cact C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/whistle.cact --converter build/whistle/bin/audiocpp_gguf.exe --output build/whistle/pr-prep/model/whistle-f32.gguf
build/whistle/bin/audiocpp_gguf.exe --inspect build/whistle/pr-prep/model/whistle-f32.gguf

Conversion passed. Inspection reported 116 tensors, six embedded sidecars, an embedded spec, and model_spec_family=whistle_asr.
The tested GGUF is build/whistle/pr-prep/model/whistle-f32.gguf, 220831648 bytes.
There is no downloadable model-manager package. The extracted Safetensors directory also loaded through the production CLI and produced the expected English transcript.

Exact build commands

Windows CPU. Commands ran from the repository root with an existing Ninja configuration:

  • MSVC Release, CPU AVX2, GGML_NATIVE=OFF, OpenMP enabled
  • AUDIOCPP_MODEL_SET=custom, AUDIOCPP_MODELS=whistle_asr
  • AUDIOCPP_DEPLOYMENT_BUILD=ON, ENGINE_BUILD_TESTS=ON
  • CUDA, Vulkan, Metal, and HIP disabled

Initial CLI/converter/test build and opt-in model configuration:

& 'C:/Program Files/Microsoft Visual Studio/18/Enterprise/Common7/Tools/Launch-VsDevShell.ps1' -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
cmake --build build/whistle --target audiocpp_cli audiocpp_gguf whistle_frontend_test whistle_assets_test --parallel 16
cmake -S . -B build/whistle -DAUDIOCPP_WHISTLE_TEST_MODEL=C:/Users/adityasharma/Projects/audio.cpp/build/whistle/pr-prep/model/whistle-f32.gguf
cmake --build build/whistle --target audiocpp_cli audiocpp_gguf whistle_frontend_test whistle_assets_test --parallel 16

Final build and tests after the tokenizer correction:

cmake -S . -B build/whistle
cmake --build build/whistle --target whistle_tokenizer_test whistle_frontend_test whistle_assets_test audiocpp_cli --config Release -j 4
build/whistle/bin/whistle_tokenizer_test.exe
ctest --test-dir build/whistle -R whistle_ --output-on-failure
python tools/check_loader_catalog_sync.py --self-test
python tools/check_loader_catalog_sync.py

Builds passed. The final CTest run passed 4/4 in 3.93 seconds. Catalog self-tests passed 2/2; synchronization passed with 115 loaders and 113 specs.
An initial configure without the MSVC environment failed to find kernel32.lib; repeating in the developer shell passed.
Existing unrelated Safetensors catalog warnings remain unchanged.

Exact standalone run commands

English and German through the actual ASR CLI:

build/whistle/bin/audiocpp_cli.exe --task asr --family whistle_asr --backend cpu --threads 4 --model build/whistle/pr-prep/model/whistle-f32.gguf --audio assets/resources/sample_16k.wav --language en --metrics --log
build/whistle/bin/audiocpp_cli.exe --task asr --family whistle_asr --backend cpu --threads 4 --model build/whistle/pr-prep/model/whistle-f32.gguf --audio C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/german_16k.wav --language de --metrics --log

Standalone loading also passed with only the GGUF in its model directory, a fresh asset cache, and working directory C:/Windows:

$env:TEMP='C:/Users/adityasharma/Projects/audio.cpp/build/whistle/pr-prep/standalone'
$env:TMP=$env:TEMP
& C:/Users/adityasharma/Projects/audio.cpp/build/whistle/bin/audiocpp_cli.exe --task asr --family whistle_asr --backend cpu --threads 4 --model C:/Users/adityasharma/Projects/audio.cpp/build/whistle/pr-prep/model/whistle-f32.gguf --audio C:/Users/adityasharma/Projects/audio.cpp/assets/resources/sample_16k.wav --language en --metrics --log

No adjacent sidecars or working-directory model_specs tree were used. All six extracted sidecars matched source hashes.
The embedded v1 spec takes precedence over workspace/builtin fallback; the GGUF metadata contains the updated community documentation path.

Repeated requests in one loaded CLI session:

$batch = @(@{id='cold';audio='C:/Users/adityasharma/Projects/audio.cpp/assets/resources/sample_16k.wav'},@{id='repeat';audio='C:/Users/adityasharma/Projects/audio.cpp/assets/resources/sample_16k.wav'})
$batch | ConvertTo-Json | Set-Content build/whistle/pr-prep/batch.json
build/whistle/bin/audiocpp_cli.exe --task asr --family whistle_asr --backend cpu --threads 4 --model build/whistle/pr-prep/model/whistle-f32.gguf --request-sequence build/whistle/pr-prep/batch.json --metrics

Both requests produced identical transcripts. cold names the first request in the session; it does not mean OS-cache-cold.

Path tests and transcript comparison

Check Observed result
Frontend Independent fixed feature vectors pass
Tokenizer Literal byte-fallback UTF-8, metaspace, special-token, invalid-hex, and ID-bound regressions pass
Three-second/full English integration Expected transcripts pass, including quiet/constant-RMS speech and decoder reuse
Digital silence Empty text and language in runtime integration; CLI emits text_output=
Input over 30 seconds Runtime and CLI reject it
Non-finite samples Rejected in frontend/runtime tests
Streaming request CLI rejects it as unsupported
Post-fix synthetic CLI regressions All ten automatic/forced-language runs exit 0 with unchanged transcripts

A fresh adversarial review identified invalid UTF-8 and byte-composed metaspace handling in detokenization.
The model-local decoder now joins visible token bytes, applies UTF-8 replacement decoding, and replaces metaspace globally.
The focused re-review found no remaining Critical or Important issue. This does not establish full-model numerical parity.

English FP32 output, using the complete 14.0719-second repository WAV:

Some call me Nature. Others call me Mother Nature. I've been here for over 4.5 billion years, twenty two thousand five hundred times longer than you.

The quantized official reference used 22,500 instead of twenty two thousand five hundred.
Both paths produced this transcript for the existing 2.11594-second German WAV:

Guten Morgen, wie wird das Wetter heute?

The cached reference ran with automatic language selection, four threads, and default/full decoder depth:

& C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/needle.exe --model C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/whistle.cact --audio assets/resources/sample_16k.wav --threads 4
& C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/needle.exe --model C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/whistle.cact --audio C:/Users/adityasharma/Projects/ansible-windows/.runtime/whistle/reference/german_16k.wav --threads 4

The .cact hash matches the pinned converter input. The reference executable's source revision is unknown; its hash is recorded in the validation report.
audio.cpp uses greedy decoding, no sampling, and a 320-text-token ceiling.
These are transcript comparisons with quantized official weights, not exact FP32 numerical parity. No pinned FP32 reference runtime was available.

Five-language synthetic checks

ElevenLabs CLI 1.4.0 generated one clip each for French, Spanish, Italian, Dutch, and Polish.
Generation used eleven_multilingual_v2, voice JBFqnCBsd6RMkjVDRZzb, seed 42, and raw pcm_16000.
Python's standard-library wave wrapped the PCM as mono signed-16 WAV without resampling.
The generation commands, settings, prompts, WAV hashes, durations, and exact transcripts are in the linked five-language report.

Each clip passed automatic and forced-language CLI runs. All ten transcripts match the synthesis prompts after NFKC/case/punctuation normalization, preserving accents.
The CLI does not expose the returned transcript language field, so no measured internal language-tag claim is made.
The quantized reference matches four clips exactly. For Polish, audio.cpp produces niebo; the reference produces nie bo.
This difference is retained. One voice and one short clip per language are synthetic spot checks, not independent human annotations or a general accuracy corpus.

Performance per request

Measured on AMD Ryzen AI MAX+ 395, 16 cores/32 logical processors, Windows 11 Enterprise Insider Preview build 26704.
Build tools were MSVC 19.51.36257.0, CMake 4.4, and Ninja 1.13.2. The CLI used four CPU threads.
CLI wall timing excludes model/session creation and input loading; it includes preparation and inference.
RTF is inference seconds divided by input-audio seconds.

Request Audio duration CLI wall RTF Peak process working set
English standalone 14.0719 s 319.928 ms 0.0227352 446 MiB
German standalone 2.11594 s 78.3542 ms 0.0370305 432 MiB
English first request, loaded session 14.0719 s 467.397 ms 0.0332149 447 MiB
English repeated request, same session 14.0719 s 479.373 ms 0.0340659 448 MiB

The five-language synthetic runs measured RTF 0.0392522–0.0570413 and peak working set 432–434 MiB.
All recorded RTFs are below the community guidance's 1.0 target. These are single local observations, not performance guarantees or leak testing.

A separate one-thread scratch probe measured asset loading at 23.7752 ms and runtime initialization at 150.822 ms.
Its first/repeated inference took 640.984/661.587 ms, RTF 0.0455505/0.0470146, with peak working set 467447808 bytes.
Those load timings use a different one-thread harness and are not included in the four-thread CLI inference figures.
The recorded timing samples precede the tokenizer correction; subsequent CLI checks verify unchanged transcripts, not a before/after performance claim.
CPU process memory is reported, not VRAM.

Generated artifacts

Local artifact paths:

  • build/whistle/pr-prep/model/whistle-f32.gguf
  • build/whistle/pr-prep/{convert,inspect,cli-en,cli-de,batch,standalone-nonrepo}.log
  • build/whistle/pr-prep/multilingual/{fr,es,it,nl,pl}.wav
  • build/whistle/pr-prep/multilingual/generation-manifest.json
  • build/whistle/pr-prep/multilingual/multilingual-validation.json
  • build/whistle/pr-prep/multilingual/runs3/
  • build/whistle/pr-prep/multilingual/reference-runs/
  • build/whistle/pr-prep/tokenizer-fix/ctest.log
  • build/whistle/pr-prep/tokenizer-fix/cli-runs/

These are ignored local validation artifacts, not uploaded PR attachments or committed model/audio files.
Exact local input paths, hashes, commands, and output details are preserved in the committed validation reports.
The German clip's original recording provenance remains unestablished.

Backend coverage

Backend/platform Coverage
Windows CPU Host-only revision (6e0a40c): CLI/converter/test builds; GGUF and extracted-Safetensors loading; runtime/CLI/integration/repeated-session checks; timing and process memory
macOS CPU (Apple M3 Ultra) GGML encoder revision: builds, CTest 4/4, encoder parity against the host code within 4.5e-6 of scale, sample and seven 20-26 s multilingual clips, five-request session memory
macOS Metal GGML encoder revision: encoder parity within 2.6e-3 of scale, identical transcripts, CTest full-sample integration, five-request session memory
Linux CPU No local build or model-runtime validation claimed
CUDA, Vulkan, HIP Not validated; rejected at session creation

No HTTP server runtime test is claimed. This PR does not modify server, framework, or GGML code.

Known limitations

  • experimental offline ASR, FP32 tensors only; encoder on CPU or Metal, decoder on the host CPU
  • 16 kHz mono input, at most 30 seconds; no resampling or long-form recognition
  • no streaming, timestamps, keyword biasing, or speech embeddings
  • no packaged download; local conversion only
  • short inputs below 40 ms and digital silence return empty transcripts; no speech-activity detector
  • noise-only audio may produce words
  • non-terminating decoding fails at the 320-text-token limit; forced decode-exhaustion regression is still missing
  • only the specific English/German inputs and five synthetic clips are checked; broad real-recording coverage remains open
  • no exact FP32 numerical-parity claim or identified reference executable source revision

Licensing and provenance

The pinned upstream model card and LICENSE declare Apache-2.0. The converter verifies and embeds that upstream LICENSE.
audio.cpp's repository license is not used as a substitute for model-weight or asset licensing.
Independent tokenizer/filterbank/permutation generation provenance remains unverified in the pinned release.
The contributor reports no copied/adapted reference code; no reference engine or reconstructed code is bundled.
No downloadable package, independently audited redistribution permission, or maintainer approval is claimed.

Documentation

Revision 2: framework modules and a GGML encoder graph

In response to the maintainer review, the frontend now reuses NemoMelFrontend with Whistle's gain normalization kept local, and the encoder runs as one GGML graph built from Conv2dModule, DepthwiseConv2dModule, DepthwiseConv1dModule, LinearModule, RMSNormModule, GemmaRMSNormModule, RoPEModule, SiluModule, SigmoidModule, SoftmaxModule, and GLUModule. Whistle-specific math (mHC lane mixing with Sinkhorn normalization, the Kronecker-factored Hadamard MLP, 48/64-wide grouped-query attention) stays in encoder.cpp. Sessions accept the CPU and Metal backends. The decoder still runs on the host. The converter and GGUF layout are unchanged, and no framework or GGML code is modified.

Encoder parity against the host-only revision on the full sample: CPU within 4.5e-6 of each tensor's largest magnitude, Metal within 2.6e-3; transcripts byte-identical on CPU 1 thread, CPU 4 threads, and Metal for the sample and seven 20-26 s synthetic clips. Sample CLI wall on an Apple M3 Ultra, three runs each: host code 505-517 ms (1 thread) and 253-259 ms (4 threads); this revision 482-516 ms, 237-238 ms, and 157-164 ms on Metal. See tests/whistle_asr/VALIDATION.md and MULTILINGUAL_VALIDATION.md.

@BumpyClock
BumpyClock marked this pull request as ready for review October 7, 2026 06:32
@0xShug0

0xShug0 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

@BumpyClock Thank you for contributing a new model! Please reuse the existing framework modules (e.g., LinearModule and GemmaRMSNormModule) and GGML graphs where possible, while keeping model-specific logic local and preserving the original math. This should reduce duplicated code and enable backend acceleration. The frontend can reuse NemoMelFrontend, with Whistle’s gain normalization kept locally. Reusing framework makes it easier to support other backends and reduces the risk of implementation errors.

I did a quick test by rewriting only the first encoder layer’s attention as a GGML graph, and it showed a substantial performance gain while keeping the outputs numerically close.

(avg of 20 warmed runs)

Audio length Original CPU, 1 thread GGML CPU, 1 thread GGML Metal Metal speedup
3.5 s 2.40 ms 1.77 ms 0.66 ms 3.7×
14.1 s 12.03 ms 8.13 ms 0.81 ms 14.9×
30 s 34.13 ms 21.19 ms 2.28 ms 15.0×

Aditya Sharma added 4 commits October 7, 2026 12:42
…odules

Address maintainer review on 0xShug0#824: reuse framework modules and GGML graphs
instead of model-specific CPU kernels.

- Frontend reuses NemoMelFrontend (512-point FFT, 400-sample symmetric Hann,
  constant padding, natural-log mel, per-bin F64 normalization); Whistle's
  percentile gain normalization stays local.
- The encoder (stem, eight mHC layers, final norm, positional table, and the
  decoder's cross-attention key/value projections) is one GGML graph built
  from Conv2d/DepthwiseConv2d/DepthwiseConv1d, Linear, GemmaRMSNorm, RoPE,
  Silu, and GLU modules. Model-local graph code covers mHC lane mixing with
  Sinkhorn normalization, the Kronecker-factored Hadamard MLP with its fixed
  permutations, and 48/64-wide grouped-query attention.
- JAX [in, out] kernels are transposed once into the backend weight store;
  the converter and GGUF layout are unchanged.
- Sessions accept the CPU and Metal backends; the host decoder no longer
  rejects builds without OpenMP.
- whistle_assets_test gains --backend, --threads, --full, and a --reference
  mode that compares mel, encoder memory, and cross K/V against dumps and
  reports the error as a fraction of each tensor's largest magnitude.

Against the previous host implementation on the full sample: CPU within
1.7e-06 of scale, Metal within 1.2e-03, identical transcripts on CPU 1/4
threads and Metal for the sample and seven 20-26 s multilingual clips.
Sample CLI wall on M3 Ultra: 580 -> 479 ms (1 thread), 281 -> 224 ms
(4 threads), 145 ms on Metal. Validation details in tests/whistle_asr/.
Resolve the README community-model table conflict by keeping main's VibeASR
row wording and the Whistle row from this branch.
- Sinkhorn: subtract each row's exact log-sum-exp, recovered from the
  clamped softmax as sum(p * (x - log p)), instead of log(clamp(softmax)).
  The earlier form discarded differences between underflowed entries that a
  later column pass can amplify.
- Use RMSNormModule, SiluModule, SigmoidModule, and SoftmaxModule in place of
  raw ggml calls, and a 1x1 Conv2dModule for the stem pointwise projections.
- Remove the duplicate encoder.cpp entry from whistle_assets_test.
- whistle_assets_test: reject non-finite reference values and add --dump so
  the current implementation can produce reference tensors.
- Docs: explain the Metal drift (half-precision operand staging in
  kernel_mul_mm_f32_f32), record the reference-dump recipe, state the
  remaining host/graph math duplication and the ReLU-only subsampling
  module, and replace the headline timings with logged three-run
  measurements of commit 6e0a40c and this revision on the same machine.
@BumpyClock

Copy link
Copy Markdown
Contributor Author

Thanks for the review and the measurements. The branch now has a revision that moves the frontend and the whole encoder onto framework modules and a GGML graph.

What changed

  • Frontend: NemoMelFrontend (512 FFT, 400 symmetric Hann, hop 160, constant padding, ln-mel, per-bin F64 normalization). Whistle's 99th-percentile block-RMS gain stays local.
  • Encoder: one GGML graph (encoder.cpp) built from Conv2dModule, DepthwiseConv2dModule, DepthwiseConv1dModule, LinearModule, RMSNormModule, GemmaRMSNormModule, RoPEModule, SiluModule, SigmoidModule, SoftmaxModule, GLUModule. Model-local graph code: mHC lane mixing with Sinkhorn normalization, the Kronecker-factored Hadamard MLP with its fixed permutations, and the 48/64-wide grouped-query attention (the shared attention modules assume one head size for Q, K, and V). The stem does not use DepthwiseConvSubsamplingModule because it hardcodes ReLU and Whistle's stem is SiLU. The decoder's cross-attention K/V projections run in the same graph.
  • Loader transposes the JAX [in, out] kernels once into a BackendWeightStore; converter and GGUF layout are unchanged, so existing GGUFs keep working. No files under src/framework or include/engine/framework are touched.
  • Sessions now accept cpu and metal. CUDA/HIP/Vulkan are still rejected because I cannot validate them here.
  • The autoregressive decoder (one token per step, engram lookups, three-tap Q/K/V mixing) still runs on the host, so runtime.cpp keeps its own host versions of the linear/RMS-norm/Hadamard/Sinkhorn/mHC/RoPE math that the graph now also expresses. On Metal it is the dominant cost (encoder about 37 ms of a 160 ms sample request). Would you prefer that port (step graph on TransformerKVCache) in this PR or as a follow-up?

Numerical check against the previous host implementation (full 14.07 s sample, 176 encoder frames; largest |diff| as a fraction of each tensor's largest magnitude, via the new whistle_assets_test --reference mode):

Tensor CPU Metal
encoder memory 1.2e-06 6.8e-04
cross K layer 0 / 7 4.5e-06 / 1.2e-06 2.6e-03 / 1.1e-03
cross V layer 0 / 7 1.1e-06 / 9.6e-07 5.2e-04 / 4.3e-04

One caveat on reproducibility: the reference dumps came from the old runtime.cpp at 6e0a40c4 through a temporary hook (that commit has no exporter). VALIDATION.md records exactly which vectors and layouts it wrote, and the test now has a --dump mode so the current implementation can serve as the oracle for later refactors. The Metal drift is consistent with ggml's kernel_mul_mm_f32_f32 staging its operands in half precision; it appears right after the stem and stays at 1e-4 to 4e-4 of scale through the layers, and it changes no transcript.

Transcripts are byte-identical across CPU 1 thread, CPU 4 threads, and Metal for the sample and for seven new 20-26 s synthetic clips (one per language, 45 CLI runs). The old host code was not run on those clips; they compare the new backends against each other. CTest 4/4 on macOS; the full-sample integration checks also pass on --backend metal.

Timing (Apple M3 Ultra, macOS 27.0.1, Release, GGML_METAL=ON; CLI metrics.wall_ms = preparation + inference, 3 runs each; the old code was rebuilt from 6e0a40c4 with the same script; encoder-only from the test's --reference mode, second call)

Measurement Previous host code This revision
Sample 14.07 s, CLI wall, CPU 1 thread 505-517 ms 482-516 ms
Sample, CLI wall, CPU 4 threads 253-259 ms 237-238 ms
Sample, CLI wall, Metal n/a 157-164 ms
Encoder only, CPU 1 thread n/a 295 ms
Encoder only, CPU 4 threads n/a 90 ms
Encoder only, Metal n/a 37 ms (143 ms first call)
Sample, peak RSS 605-609 MiB 758-767 MiB
20.4 s clip x5 in one session, CPU 4 threads n/a 379-393 ms/request, footprint 537-541 MiB
20.4 s clip x5 in one session, Metal n/a 252-276 ms/request, footprint 802-803 MiB

So: single-thread CPU is unchanged within noise (the GGML F32 path is not faster than the hand loops at one thread, and the exact Sinkhorn adds about 1300 small nodes), four threads are modestly faster, Metal is about 1.6x faster than four CPU threads, and peak RSS is up about 150 MiB because encoder weights now live in the backend store while the decoder keeps host copies. Details, exact commands, and the per-language table are in tests/whistle_asr/VALIDATION.md and MULTILINGUAL_VALIDATION.md.

@0xShug0

0xShug0 commented Oct 8, 2026

Copy link
Copy Markdown
Owner
  • Would you prefer that port (step graph on TransformerKVCache) in this PR or as a follow-up?

Hi @BumpyClock Thanks for the quick turnaround. I'm happy to merge the PR as it stands, and a follow-up PR for the decoder would be much appreciated.

@0xShug0
0xShug0 merged commit 16eee39 into 0xShug0:main Oct 8, 2026
6 checks passed
@BumpyClock

Copy link
Copy Markdown
Contributor Author

I'll submit the follow up in the next day or so.

@BumpyClock

Copy link
Copy Markdown
Contributor Author

The decoder follow-up is up as #843. The decoder now runs as a GGML step graph on TransformerKVCache built from the framework modules, the host decoder code is gone, and transcripts match the previous implementation on CPU and Metal. Timing and the one trade-off (the step graph runs on one CPU thread; details and numbers in the PR) are in its description.

0xShug0 pushed a commit that referenced this pull request Oct 10, 2026
* webui: let a studio panel run the page's request

Model panels are registered per family, and the page always builds and
sends the request itself. A conversation view has to send its own
request and show the reply as it streams in, while it keeps the page's
Run button, Ctrl+Enter, Cancel, elapsed time and status line.

This adds that hook without changing what any existing panel does:

- A panel entry may list the tasks it covers, such as tasks: ['s2s'].
  An entry without the list covers every task of its family, as before.
- With requestMode 'panel', run() hands the request to the runner the
  panel registers through the page's registerPanelRunner, which the
  next commit passes to panels as setPanelRunner; registering returns
  the function that removes it. It passes the source audio, the
  resolved seed, Max tokens, Language, the request options and the
  abort signal that Cancel uses. The hand-off comes before anything is
  awaited, so the panel can start audio inside the Run click or key
  press. The reply the panel returns is shown in the Result column;
  these runs are not added to Run history. Missing source audio, a
  recording still running, or Run from a tab other than Studio is
  reported as a warning, like the page's other checks before a run.
- With UI management the panel can ask for the entry in a given mode.
  This uses the page's ensureLoadedMode unchanged, after reloading an
  entry that is resident with another package or with imported
  settings that differ, as ensureLoaded does for the other runs.
- api.ts gets taskStreamEvents, a reader for /v1/tasks/stream with
  "stream_format": "sse". It yields each event and then the result,
  throws the server's error message, and throws TaskStreamClosedError
  when the stream ends before task.stream.done. The done message
  carries the whole reply again and comes over many reads, so the
  reader keeps its pieces and joins them once, when the message ends.

No panel uses requestMode 'panel' yet.

* webui: LFM2.5-Audio conversation panel for speech-to-speech

The LFM2.5-Audio speech-to-speech entries ran one question per Run, as a
new conversation each time, and showed the reply only when it was done.
The server can now carry a conversation (earlier turns sent as request
artifacts) and stream a reply as server-sent events, so this gives the
two S2S entries a page of their own, as asked on #828.

The panel covers only the S2S entries; ASR and TTS keep the generic
controls. It adds a conversation above the page's own Language, Seed,
Max tokens, Source audio and Model parameters, which it uses as they
are. Each Run:

- uploads the recorded or chosen question, and sends it to
  /v1/tasks/stream with "stream_format": "sse" and return_codes, with
  each earlier turn as its question's upload path and the reply
  artifact that turn returned;
- plays the reply as it streams in, its 80 ms chunks scheduled back to
  back on one Web Audio clock, and shows the reply text as it arrives;
- adds the turn to a list with the question, the reply text and the
  reply audio, and clears the source picker for the next question.

New conversation starts over, and Leave out drops an old turn from the
next request, which is what the server asks for past its 8192-step
limit. A failed or stopped turn, or one whose stream closed before its
result, is never sent as history; the next Run takes its place.
Starting a turn stops the previous reply, and Stop audio stops a reply
that is still playing. If the browser does not let live audio start,
the panel says so and the reply is in its player when it finishes.
Finished turns are kept when the user opens another tab or entry and
comes back (leaving the panel stops a turn still running), and a turn
on the other checkpoint starts a new conversation. With UI management
the entry is loaded in streaming mode when needed; on a server with a
config file, an entry in offline mode is run through /v1/tasks/run and
its reply shows when it is done. An S2S entry configured under an id
that is not the catalog's gets the family's ASR parameters in Model
parameters; turns leave those out and send the page's Max tokens.

Each turn's players and its Leave out button are named with the turn
number for screen readers, and its state badge is a polite live
region.

The page passes panels three more props for this: modelId,
setPanelRunner, which is its registerPanelRunner, and clearSource, its
own clearSourceFile. The other panels do not declare them and ignore
them. model_params.json gets text_temperature and text_top_k for the
two S2S entries, with the server's defaults, and the S2S hints and the
model docs describe the conversation.

* webui: rebuild the page

Rebuilt from this branch's source with the lockfile (node 24.19.0,
npm 11.17.0):

  cd webui/native
  npm ci
  npm run build

The page on main was built from an older tree. It lacks changes to the
model specs or the page from #824, #829, #830, #833, #834, #835, #846,
#851, #853 and #854, so this rebuild also brings those into the page.
Rebuilding main's own source the same way gives a page that differs
from this one only in this branch's changes.
@0xShug0 0xShug0 added the new model Request for new model support label Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new model Request for new model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants