FunASR
Frameworkmodelscope/FunASR
Industrial-grade speech recognition toolkit with 170x realtime speed.
Overview
FunASR is an end-to-end speech recognition toolkit supporting over 50 languages, speaker diarization, emotion detection, streaming, and an OpenAI-compatible API. It achieves 170x realtime speed and offers pre-trained models like SenseVoice and Paraformer.
README Preview
([简体中文](./README_zh.md)|English|[日本語](./README_ja.md)|[한국어](./README_ko.md))\n\n\n\n\n\n\n Industrial speech recognition. 170x faster than Whisper. 50+ languages.\n Speaker diarization · Emotion detection · Streaming · One API call\n\n\n\n \n \n \n \n\n\n\n\n\n\n\n Quick Start · Colab · Benchmark · Model selection · Migration guide · Use cases · Deployment matrix · Models · Agent Integration · Docs · Contribute\n\n\n---\n\n## Quick Start\n\n[](https://colab.research.google.com/github/modelscope/FunASR/blob/main/examples/colab/funasr_quickstart.ipynb)\n\nNo local setup? Open the [Colab quickstart](./examples/colab/) to transcribe a public sample or upload your own audio in a browser.\n\n```bash\npip install torch torchaudio\npip install funasr\n```\n\n```python\nfrom funasr import AutoModel\n\nmodel = AutoModel(model="iic/SenseVoiceSmall", vad_model="fsmn-vad", spk_model="cam++", device="cuda")\nresult = model.generate(input="meeting.wav")\n```\n\n**Output** — structured text with speaker labels, timestamps, and punctuation:\n```\n[00:00.4 → 00:03.8] Speaker 0: Let's discuss the Q3 plan.\n[00:04.2 → 00:07.1] Speaker 1: Sounds good. I have three points.\n[00:07.5 → 00:12.3] Speaker 0: Go ahead. We have 30 minutes.\n```\n\nThat's it. **One model, one call** — VAD segmentation, speech recognition, punctuation, speaker diarization all happen automatically.\n\n### LLM-powered ASR: Fun-ASR-Nano\n\nFor highest accuracy across 31 languages (including Chinese dialects), use [Fun-ASR-Nano](https://github.com/FunAudioLLM/Fun-ASR) — an LLM-based ASR combining SenseVoice encoder with Qwen3-0.6B decoder:\n\n```python\nfrom funasr import AutoModel\n\nmodel = AutoModel(model="FunAudioLLM/Fun-ASR-Nano-2512", vad_model="fsmn-vad", device="cuda")\nresult = model.generate(input="meeting.wav")\n```\n\nWith vLLM acceleration (16x faster, batch processing):\n\n```python\nfrom funasr.auto.auto_model_vllm import AutoModelVLLM\n\nmodel = AutoModelVLLM(model="FunAudioLLM/Fun-ASR-Na
FAQ (4)
TroubleshootingHow to fix slow pip install of funasr due to building from source?
Upgrade to funasr v1.3.9 or later, which includes a pre-built universal wheel (py3-none-any). This avoids the source build step. Use: pip install funasr>=1.3.9. For older versions, the source build was a no-op, but the wheel eliminates any build overhead.
TroubleshootingHow to fix CUDA error 'device-side assert triggered' when using repetition_penalty in FunASR 1.3.7 with vLLM?
This is caused by incompatibility between repetition_penalty and enable_prompt_embeds=True in vLLM. Remove repetition_penalty=1.3 from vllm_engine.generate() call. As workaround, split audio into ≤25-second chunks for inference and use a truncate_repetition() post-processing function to suppress repeats. Example truncation logic: def truncate_repetition(text, min_repeat_len=5, max_repeats=3): ... . The next FunASR version will adopt chunking and post-processing officially.
TroubleshootingHow to perform real-time speech recognition via WebSocket when Qwen3-ASR only supports offline mode?
Qwen3-ASR does not support WebSocket real-time streaming (offline only via AutoModel). For WebSocket streaming, use the Fun-ASR-Nano model with FunASR's real-time server. Install: pip install funasr>=1.3.5 vllm>=0.12.0 (version 1.3.5 fixes ModuleNotFoundError for dynamic_vad and vllm.inputs.data import issues). Start server: python examples/industrial_data_pretraining/fun_asr_nano/serve_realtime_ws.py --port 10095 --language 中文. Client: open client_mic.html in browser or use client_python.py. Docs: https://github.com/modelscope/FunASR/blob/main/docs/vllm_guide.md
TroubleshootingHow to fix FunASR real-time serve download failure with unauthenticated Hugging Face requests?
Set a Hugging Face token to avoid rate limits and download issues. Export HF_TOKEN='your_token' before running the server, or use huggingface-cli login to cache credentials. If download still fails, manually download the model from https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512 and point --model to the local path.