Skip to content

feat(backend): add SpiritLM backend for text, TTS, and ASR#8589

Open
MkDev11 wants to merge 6 commits intomudler:masterfrom
MkDev11:feat/spiritlm-backend
Open

feat(backend): add SpiritLM backend for text, TTS, and ASR#8589
MkDev11 wants to merge 6 commits intomudler:masterfrom
MkDev11:feat/spiritlm-backend

Conversation

@MkDev11
Copy link

@MkDev11 MkDev11 commented Feb 17, 2026

Description

Fixes #3966

Adds a new LocalAI backend for Meta Spirit LM: an interleaved text and speech model that supports text generation, text-to-speech (TTS), and automatic speech recognition (ASR) in a single 7B model.

Changes:

  • backend/python/spiritlm/ – New Python gRPC backend implementing:
    • LoadModel: loads spirit-lm-base-7b or spirit-lm-expressive-7b
    • Predict / PredictStream: text generation via OutputModality.TEXT
    • TTS / TTSStream: text → speech via OutputModality.SPEECH (float32 → 16 kHz WAV)
    • AudioTranscription: speech → text via OutputModality.TEXT from audio path (request.dst)
    • Health, options parsing (sample_rate, etc.)
  • backend/index.yaml – New &spiritlm meta with description, tags (text-to-text, TTS, ASR, LLM, multimodal), capabilities (cpu-spiritlm, cuda12-spiritlm).

Notes for Reviewers

  • SpiritLM is not on PyPI; requirements-install.txt installs from git+https://github.com/facebookresearch/spiritlm.git. Checkpoints must be set up separately per the SpiritLM repo.
  • Backend follows the same pattern as other Python backends (nemo, kokoro): libbackend.sh, protogen, Makefile, run.sh, install.sh. Docker builds copy backend.proto into the backend dir per existing Dockerfile.python.
  • License noted in index as fair-noncommercial (Meta FAIR Noncommercial Research License).

Signed commits

  • Yes, I signed my commits.

Implements LocalAI backend for Meta Spirit LM (interleaved text and speech).
- backend/python/spiritlm: gRPC servicer with LoadModel, Predict,
  PredictStream, TTS, TTSStream, AudioTranscription, Health
- Supports spirit-lm-base-7b and spirit-lm-expressive-7b
- Options: sample_rate (default 16000)
- backend/index.yaml: add spiritlm meta and capabilities

Ref: mudler#3966
Signed-off-by: mkdev11 <MkDev11@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit bc4a68e
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69984d35e441b30008b7f933
😎 Deploy Preview https://deploy-preview-8589--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@MkDev11
Copy link
Author

MkDev11 commented Feb 17, 2026

@mudler could you please review the PR and let me know your feedback?

@richiejp
Copy link
Collaborator

Can you add an entry in gallery/index.yaml similar to Qwen-ASR?

Add spirit-lm-base-7b and spirit-lm-expressive-7b to model gallery,
following the same pattern as Qwen-ASR (per PR mudler#8589 review).

Signed-off-by: mkdev11 <MkDev11@users.noreply.github.com>
@MkDev11
Copy link
Author

MkDev11 commented Feb 18, 2026

Can you add an entry in gallery/index.yaml similar to Qwen-ASR?

@richiejp Thanks for your feedback. I added SpiritLM to gallery/index.yaml following the Qwen-ASR pattern.

@richiejp
Copy link
Collaborator

Thanks, the bottleneck on our end is testing. If you provide e2e tests then we can verify these and get it merged faster.

@MkDev11
Copy link
Author

MkDev11 commented Feb 19, 2026

Thanks, the bottleneck on our end is testing. If you provide e2e tests then we can verify these and get it merged faster.

@richiejp I added e2e tests, please review the update again and let me know your feedback.

@MkDev11
Copy link
Author

MkDev11 commented Feb 20, 2026

any update for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for SpiritLM

2 participants

Comments