Guide · Open source
How to use FunASR: install, transcribe audio and get speaker segments
Updated · written with AI from the project's own documentation and checked against our catalogue data
FunASR is an open-source speech recognition toolkit from ModelScope. It turns spoken audio into text and includes helpers for voice activity detection, punctuation and speaker grouping. This guide shows you how to install it with pip, run a pretrained model from Python, and get speaker-labelled segments from a recording.
Quick start
- 1Check prerequisites. Confirm you have Python and pip. If you plan to use a GPU, install a PyTorch and torchaudio build that matches your NVIDIA driver.
- 2Install PyTorch and torchaudio. Run pip install torch torchaudio for a CPU-only setup, as the README shows.
- 3Install FunASR. Run pip install funasr.
- 4Verify the device. Run the short Python check for torch.cuda.is_available(). Use device="cuda" only if it prints True.
- 5Load a model with AutoModel. Create AutoModel with a checkpoint name such as FunAudioLLM/Fun-ASR-Nano-2512 or iic/SenseVoiceSmall, and set the device.
- 6Transcribe audio. Call generate with a URL or file path and print result[0]["text"].
- 7Add VAD and speakers if needed. Pass vad_model and spk_model to AutoModel to get segments with anonymous speaker indices.
What you need before installing FunASR
FunASR is a Python toolkit installed with pip. Its README lists Python, pip, PyTorch and torchaudio as prerequisites. CPU-only installs can use the default PyPI wheels. For GPU use, install PyTorch and torchaudio wheels that match your NVIDIA driver before installing FunASR.
- Python and pip
- PyTorch and torchaudio (CPU-only, or matched to your NVIDIA driver for GPU)
- Licence: MIT
Install FunASR with pip
Install PyTorch and torchaudio first, then FunASR. The CPU-only route uses the default PyPI wheels.
After installing for GPU, check that PyTorch can see the GPU before you pass device="cuda". Use device="cpu" if it prints False.
pip install torch torchaudio
pip install funasr
python - <<'PY'
import torch
print(torch.cuda.is_available())
PYTranscribe an audio file with AutoModel
The main entry point is AutoModel. You pass it a model name and a device, then call generate with an audio input. The README example uses the Fun-ASR-Nano checkpoint on a GPU. The input can be a URL or a local file path. The result is a list, and the text is in the text field of the first item.
Use device="cpu" if you do not have a verified CUDA setup. The Fun-ASR-Nano checkpoint is one option; the README also describes SenseVoiceSmall as a CPU-first choice.
- Fun-ASR-Nano (zh, en, ja and Chinese dialect groups) is the README's GPU example
- Fun-ASR-MLT-Nano-2512 is a separate 31-language checkpoint
- SenseVoiceSmall covers five languages and adds emotion and audio-event tags
from funasr import AutoModel
model = AutoModel(model="FunAudioLLM/Fun-ASR-Nano-2512", device="cuda")
result = model.generate(input="https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav")
print(result[0]["text"])Get speaker-labelled segments from a recording
For multi-speaker recordings, the README shows a pipeline built from SenseVoiceSmall, the FSMN-VAD voice activity model and the CAM++ speaker model. AutoModel uses VAD to split the audio, clusters speaker embeddings, and returns segments with start times and speaker indices.
The speaker values are anonymous indices inside one recording. They are not names, and the labels do not carry across different recordings. The README also notes that these speaker outputs come from the pipeline, not from the SenseVoiceSmall checkpoint alone.
- Each segment has a start time in milliseconds in the source data, which the example converts to seconds
- Speaker ids are local to one recording
- Tags are removed with rich_transcription_postprocess
from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
model = AutoModel(model="iic/SenseVoiceSmall", vad_model="fsmn-vad", spk_model="cam++", device="cpu")
result = model.generate(
input="https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav",
batch_size_s=300,
)
for seg in result[0]["sentence_info"]:
print(f"[{seg['start']/1000:.1f}s] Speaker {seg['spk']}: {rich_transcription_postprocess(seg['sentence'])}")Choose a model and runtime for your use case
FunASR separates the task, checkpoint and runtime. Support for a feature in one model does not mean every serving backend supports it. Language coverage is specific to each checkpoint, so check the model you pick against your audio.
The README points to a model selection guide, a deployment matrix and a migration guide for teams moving from Whisper or a cloud ASR provider. Benchmark on your own audio and hardware before you commit.
- Chunked live transcription uses Paraformer-zh-streaming with a streaming SDK or runtime WebSocket service
- Native CPU or edge use can use GGUF checkpoints with llama.cpp, which are not Python AutoModel checkpoints
- Serving: the README mentions an OpenAI-compatible API example and an MCP server example
Troubleshoot GPU and checkpoint errors
The most common setup problem is a PyTorch build that does not match your NVIDIA driver. Run the GPU check first. If it prints False, switch to device="cpu" or reinstall PyTorch with the correct CUDA wheel.
If a language is not transcribed well, confirm that your chosen checkpoint covers it. Base Fun-ASR-Nano covers zh, en and ja plus Chinese dialects, not the full 31 languages of the MLT checkpoint.
- Check torch.cuda.is_available() before using device="cuda"
- Confirm the checkpoint's language coverage
- Remember that speaker labels are not names
What people use it for
- Transcribing recorded meetings or interviews in Python with a pretrained checkpoint
- Building live transcription with the streaming Paraformer checkpoint
- Splitting a multi-speaker recording into time-stamped segments with anonymous speaker labels
- Comparing FunASR with Whisper or a cloud ASR provider on your own audio before switching
- Exposing transcription through an OpenAI-compatible API for tools such as LangChain or Dify
Frequently asked questions
Is FunASR free to use?
FunASR is licensed under the MIT licence, as listed on its project page. Individual model checkpoints may have their own terms, so check the model card and the deployment matrix before commercial use.
What do I need to install FunASR?
You need Python, pip, PyTorch and torchaudio. Install PyTorch and torchaudio first, using CPU-only wheels or wheels that match your NVIDIA driver, then run pip install funasr.
Does FunASR support GPU?
Yes. The README's GPU example uses device="cuda". Confirm with torch.cuda.is_available() that the GPU is visible first, and use device="cpu" otherwise.
Can FunASR do real-time or streaming transcription?
The README lists a streaming option using the Paraformer-zh-streaming checkpoint through a streaming SDK or runtime WebSocket service. It notes you should use the streaming checkpoint with a per-session cache, not an offline checkpoint.
Does FunASR identify speakers by name?
No. Speaker labels are anonymous indices within a single recording. The README says they are not known-person identities, so you cannot use them to recognise who is speaking across files.
How does FunASR compare with Whisper, faster-whisper, WhisperX or Vosk?
Those are comparable projects. The README recommends benchmarking FunASR on your own audio and hardware and provides a migration guide from Whisper. It does not publish a head-to-head ranking, so test your own recordings before choosing.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
FunASR suits Python developers who want pretrained speech recognition, live transcription or speaker-aware segments and are comfortable with a command-line and code setup. If you need a point-and-click transcription app, or need named speaker identification, pick a different tool.
Install options & downloads