1.4 KiB
1.4 KiB
FunASR + Dify Integration Guide
Use FunASR as a local speech-to-text backend for Dify via the OpenAI-compatible API.
Why FunASR with Dify?
- Privacy: All audio stays local, no cloud API calls
- Speed: 170x realtime (vs ~1x for cloud APIs)
- Free: No per-minute charges, no API keys needed
- Features: Speaker diarization, emotion detection, 50+ languages
Setup
1. Start FunASR Server
pip install torch torchaudio
pip install funasr vllm fastapi uvicorn python-multipart
funasr-server --device cuda --port 8000
2. Configure in Dify
In Dify Settings -> Model Provider:
- Select OpenAI-API-Compatible provider
- Set:
- API Base URL:
http://your-server:8000/v1 - API Key:
unused(any value works) - Model Name:
fun-asr-nano
- API Base URL:
3. Enable Speech-to-Text
In your Dify app settings:
- Go to Features -> Speech to Text
- Enable it
- Select the OpenAI-compatible provider you configured
Supported Models
| Model Name | Best For | Speed |
|---|---|---|
fun-asr-nano |
31 languages + Chinese dialects | 340x realtime (vLLM) |
sensevoice |
Ultra-fast, 5 languages | 170x realtime |
paraformer |
Chinese (classic, stable) | 120x realtime |