Skip to content

Commit 3502433

Browse files
localai-botmudler
andauthored
feat(crispasr): add F5-TTS support and gallery model (#10753)
Link the f5-tts library into the crispasr backend so CrispASR's native F5-TTS runtime (SWivid F5-TTS, 22-layer DiT flow-matching + built-in Vocos vocoder) is compiled in. The single self-contained GGUF auto-detects as f5-tts through the session router, so no explicit backend selector is needed. Add the f5-tts-crispasr gallery entry (cstr/f5-tts-GGUF) and an env-gated e2e synthesis spec. F5-TTS is voice-cloning only and has no baked speaker: it clones from a reference WAV plus its transcript, supplied via the voice/voice_text options. The gallery description documents this bring-your-own-reference requirement. Verified e2e on the pinned engine (278fb79): the GGUF auto-detects as f5-tts, the reference voice loads, and synthesis produces a valid 24 kHz mono WAV. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent b987f39 commit 3502433

3 files changed

Lines changed: 56 additions & 1 deletion

File tree

backend/go/crispasr/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ target_link_libraries(gocrispasr PRIVATE
1717
crispasr-lib
1818
parakeet canary canary_ctc cohere granite_speech granite_nle
1919
voxtral voxtral4b qwen3_asr qwen3_tts orpheus chatterbox indextts
20-
kokoro voxcpm2_tts m2m100 t5_translate wav2vec2-ggml vibevoice
20+
kokoro voxcpm2_tts m2m100 t5_translate wav2vec2-ggml vibevoice f5-tts
2121
silero-lid pyannote-seg funasr paraformer sensevoice
2222
crisp_audio
2323
ggml)

backend/go/crispasr/gocrispasr_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,32 @@ var _ = Describe("CrispASR", func() {
189189
Expect(info.Size()).To(BeNumerically(">", 1024),
190190
"expected a non-trivial WAV, got %d bytes", info.Size())
191191
})
192+
193+
It("synthesizes with F5-TTS voice cloning (reference WAV + transcript)", func() {
194+
// F5-TTS has no baked speaker: it clones from a reference WAV and
195+
// its transcript, supplied via the voice/voice_text options. The
196+
// spec skips unless all three fixtures are provided.
197+
model := os.Getenv("CRISPASR_F5_MODEL_PATH")
198+
refWav := os.Getenv("CRISPASR_F5_REF_WAV")
199+
refText := os.Getenv("CRISPASR_F5_REF_TEXT")
200+
if model == "" || refWav == "" || refText == "" {
201+
Skip("set CRISPASR_F5_MODEL_PATH, CRISPASR_F5_REF_WAV and CRISPASR_F5_REF_TEXT to run this spec")
202+
}
203+
ensureLibLoaded()
204+
205+
w := &CrispASR{}
206+
Expect(w.Load(&pb.ModelOptions{
207+
ModelFile: model,
208+
Options: []string{"voice:" + refWav, "voice_text:" + refText},
209+
})).To(Succeed())
210+
211+
dst := filepath.Join(GinkgoT().TempDir(), "f5.wav")
212+
Expect(w.TTS(&pb.TTSRequest{Text: "Hello from LocalAI running F5 text to speech.", Dst: dst})).To(Succeed())
213+
214+
info, err := os.Stat(dst)
215+
Expect(err).ToNot(HaveOccurred(), "synthesized WAV should exist at %q", dst)
216+
Expect(info.Size()).To(BeNumerically(">", 1024),
217+
"expected a non-trivial WAV, got %d bytes", info.Size())
218+
})
192219
})
193220
})

gallery/index.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36811,6 +36811,34 @@
3681136811
- filename: snac-24khz.gguf
3681236812
uri: huggingface://cstr/snac-24khz-GGUF/snac-24khz.gguf
3681336813
sha256: b4b044631df62ececa86ab080516b3e619cd8f93caabd5f6758c7eae14981bd8
36814+
- name: f5-tts-crispasr
36815+
url: github:mudler/LocalAI/gallery/virtual.yaml@master
36816+
urls:
36817+
- https://huggingface.co/SWivid/F5-TTS
36818+
- https://huggingface.co/cstr/f5-tts-GGUF
36819+
description: |
36820+
F5-TTS v1 Base (SWivid, MIT) text-to-speech synthesized through the CrispASR backend. A 22-layer DiT flow-matching model with a built-in Vocos vocoder in a single self-contained GGUF (no separate codec). Auto-detected by CrispASR and runs end-to-end on CPU, producing 24 kHz mono audio.
36821+
36822+
F5-TTS is a voice-cloning model with no built-in speaker: you must supply a reference clip and its transcript. Add `voice:<reference.wav>` and `voice_text:<transcript of the reference>` to the model's `options` (paths resolve against the model directory) before synthesizing; without a reference the model cannot generate audio.
36823+
36824+
Default GGUF size ~945 MB (f16). Quantization below f16 is not recommended for flow-matching models. Synthesis runs a 32-step ODE solver and is compute-heavy on CPU (expect long generation times without a GPU-enabled CrispASR build).
36825+
tags:
36826+
- crispasr
36827+
- tts
36828+
- text-to-speech
36829+
- gguf
36830+
- voice-cloning
36831+
overrides:
36832+
backend: crispasr
36833+
known_usecases:
36834+
- tts
36835+
name: f5-tts-crispasr
36836+
parameters:
36837+
model: f5-tts-v1-base-f16.gguf
36838+
files:
36839+
- filename: f5-tts-v1-base-f16.gguf
36840+
uri: huggingface://cstr/f5-tts-GGUF/f5-tts-v1-base-f16.gguf
36841+
sha256: fdd6ba8baa9e1224072cd0bea795f7962daf00e89b5d8c736fb06b3155c8d1f1
3681436842
- name: piper-it_IT-riccardo-x_low-crispasr
3681536843
url: github:mudler/LocalAI/gallery/virtual.yaml@master
3681636844
urls:

0 commit comments

Comments
 (0)