# FunASR

> Industrial speech toolkit: ASR, VAD, punctuation and speaker pipelines

- Category: Multimodal Generation / Audio, Music & Voice
- Language: Python
- Licence: MIT
- Repository: https://github.com/modelscope/FunASR
- Website: https://www.funasr.com/
- Canonical page: https://ai-tldr.dev/tools/funasr/

## In short

FunASR is an end-to-end speech recognition toolkit maintained by ModelScope. It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed MIT. To get started: install FunASR.

## Overview

FunASR is an end-to-end speech recognition toolkit maintained by ModelScope. Rather than shipping a single model, it is a framework in which you pick a task, a checkpoint and a runtime separately — so the same Python API covers offline file transcription, streaming recognition and edge deployment.

Around plain transcription it bundles the pieces a production pipeline normally needs: voice-activity detection (FSMN-VAD), punctuation restoration, speaker models such as CAM++ for speaker-aware segmentation, and checkpoints that also emit emotion and audio-event tags. The AutoModel class composes these into one call, returning VAD segments with timestamps and speaker indices rather than a flat block of text.

The model zoo spans several families. Fun-ASR-Nano covers Chinese, English, Japanese plus Chinese dialect groups and regional accents, with a separate Fun-ASR-MLT-Nano checkpoint for 31 languages; SenseVoiceSmall is a five-language CPU-first option that adds emotion and audio-event tags, and ships a GGUF build for edge devices. For serving, FunASR offers an OpenAI-compatible API path, an MCP server, and vLLM-accelerated batch inference.

## What it does

- One AutoModel API composing ASR with VAD, punctuation, speaker and emotion models into a single pipeline call
- Offline, streaming and edge deployment paths from the same toolkit, with a published deployment matrix per checkpoint
- Model zoo including Fun-ASR-Nano, the 31-language Fun-ASR-MLT-Nano, and the CPU-first SenseVoiceSmall with emotion and audio-event tags
- Speaker-aware output: CAM++ speaker embeddings are clustered and assigned to VAD segments with per-recording speaker indices
- vLLM-accelerated batch inference via AutoModelVLLM for high-throughput transcription jobs
- Agent-facing serving options — an MCP server and an OpenAI-compatible API — alongside a GGUF edge checkpoint

## Getting started

FunASR installs from PyPI on top of PyTorch. CPU-only installs can use the default PyPI wheels; for GPU, install the torch and torchaudio wheels matching your NVIDIA driver from pytorch.org first, and only pass device="cuda" once torch.cuda.is_available() prints True.

1. Install FunASR

   Install PyTorch and torchaudio, then the toolkit itself.

```bash
# CPU-only installs can use the default PyPI wheels.
pip install torch torchaudio
pip install funasr
```

2. Transcribe a file with Fun-ASR-Nano

   Load a checkpoint through AutoModel and call generate on an audio path or URL.

```python
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"])
```

3. Add VAD and speaker segmentation on CPU

   SenseVoiceSmall covers five languages and emits emotion and audio-event tags. Combining it with FSMN-VAD and CAM++ returns segments carrying start times and speaker indices; the indices are local to the recording, not known identities.

```python
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'])}")
```

4. Scale up with vLLM

   For batch throughput, run the flagship checkpoint through the vLLM-backed entrypoint.

```python
from funasr.auto.auto_model_vllm import AutoModelVLLM

model = AutoModelVLLM(model="FunAudioLLM/Fun-ASR-Nano-2512", tensor_parallel_size=1)
results = model.generate(["audio1.wav", "audio2.wav"], language="auto")
```

## When to use it

- Transcribe Chinese, English and Japanese audio — including dialects and regional accents — with one toolkit rather than a per-language stack
- Build a speaker-aware transcription pipeline where VAD, punctuation and speaker clustering are composed in a single call
- Run five-language ASR with emotion and audio-event tags on CPU, or on edge hardware via the GGUF checkpoint
- Expose transcription to agents through FunASR's MCP server or its OpenAI-compatible API endpoint
