Voxtral TTS

Voxtral 4B TTS 2603 fonctionne localement sur Apple Silicon via le module VoxtralTTS : 20 voix prédéfinies, neuf langues et une sortie mono à 24 kHz.

Ligne de commande

speech speak "Hello, welcome to Voxtral." --engine voxtral --voxtral-voice casual_male --stream --voxtral-chunk-frames 3 -o hello.wav
speech speak --engine voxtral --list-speakers
speech speak "Bonjour." --engine voxtral --voxtral-voice fr_female --voxtral-max-frames 500 --voxtral-seed 0 -o bonjour.wav

API Swift

import VoxtralTTS

let model = try await VoxtralTTSModel.fromPretrained()
for try await chunk in model.generateStream(text: "Hello, welcome to Voxtral.", voice: "casual_male") {
    print(chunk.frameIndex, chunk.samples.count, chunk.isFinal)
}

API du serveur

curl http://localhost:8080/v1/audio/speech \
  -H 'Content-Type: application/json' \
  -d '{"model":"voxtral-tts","input":"Hello, welcome to Voxtral.","voice":"casual_male","response_format":"wav"}' \
  -o hello.wav

/v1/realtime: session.update → {"model":"voxtral-tts","voice":"casual_male"}; response.create → {"instructions":"Hello, welcome to Voxtral."}.

curl http://localhost:8080/v1/audio/speech \
  -H 'Content-Type: application/json' \
  -d '{"model":"voxtral-tts","input":"Hello, welcome to Voxtral.","voice":"casual_male","stream":true,"response_format":"pcm"}' \
  -o hello.pcm

Voix prédéfinies

encasual_male, casual_female, cheerful_female, neutral_male, neutral_female
frfr_male, fr_female
eses_male, es_female
dede_male, de_female
itit_male, it_female
ptpt_male, pt_female
nlnl_male, nl_female
arar_male
hihi_male, hi_female

Limites et gestion de l’état

Voix prédéfinies uniquement ; le clonage à partir d’un audio de référence est indisponible. Le SDK, la CLI, WebSocket et HTTP PCM émettent l’audio pendant la génération. Le texte complet doit être fourni au départ. Les poids sont sous licence CC BY-NC 4.0.

Chaque requête possède son cache de modèle de langage, son historique de codec et sa graine aléatoire. Le rappel attend le traitement du consommateur. Un bloc contient par défaut 3 trames (240 ms d’audio), avec une limite de 500 trames (40 secondes). Une erreur peut survenir après l’émission d’audio ; seule une fin normale produit le marqueur final.

VoxtralTTSOptions(streamingChunkFrames: 3) · generateStreaming(onChunk:) · AudioChunk.isFinal.

MLX 4-bit · Mistral · VoxtralTTS