Skip to main content

Overview

FunASRSTTService provides offline speech recognition using FunASR’s SenseVoice models running locally on CPU or GPU. SenseVoice is a multilingual model with strong Chinese accuracy, supporting Chinese, Cantonese, English, Japanese, Korean, and other languages. The non-autoregressive architecture enables fast inference, making it a strong fully-local STT option for voice agents. No API key needed - models download once on first use and are cached locally for privacy-focused transcription.

FunASR STT API Reference

Pipecat’s API methods for FunASR STT integration

FunASR Example

Complete example with FunASR STT

FunASR Documentation

FunASR model details and research

SenseVoice Model

SenseVoice multilingual ASR model

Installation

uv add "pipecat-ai[funasr]"

Prerequisites

Local Model Setup

Before using FunASR STT service, you need:
  1. Model Selection: Choose an appropriate FunASR model (default: iic/SenseVoiceSmall)
  2. Storage Space: Ensure sufficient disk space for model downloads (models are cached after first use)
  3. CPU or GPU Resources: FunASR can run on CPU or GPU (CUDA)

Configuration Options

  • Model Selection: Default is iic/SenseVoiceSmall, but other FunASR models are supported
  • Language Support: SenseVoice natively supports Chinese (zh), Cantonese (yue), English (en), Japanese (ja), and Korean (ko) with automatic language detection for other languages
  • Device Selection: Choose "cpu" or "cuda" based on your hardware
  • No API Key: Runs entirely locally for complete privacy
No API keys required - FunASR runs entirely locally for complete privacy. Can run on CPU or GPU.

Configuration

device
str
default:"\"cpu\""
Inference device. Use "cpu" or "cuda" for GPU acceleration.
settings
FunASRSTTService.Settings
default:"None"
Runtime-configurable settings for the STT service. See FunASRSTTSettings below.

FunASRSTTSettings

Runtime-configurable settings passed via the settings constructor argument using FunASRSTTService.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame. See Service Settings for details.
ParameterTypeDefaultDescription
modelstr"iic/SenseVoiceSmall"FunASR model identifier. Default is SenseVoiceSmall. (Inherited from base STT settings.)
languageLanguage | strLanguage.ENLanguage for transcription. Natively supports Chinese (zh), Cantonese (yue), English (en), Japanese (ja), and Korean (ko). Falls back to auto-detection for other languages. (Inherited from base STT settings.)
use_itnboolTrueApply inverse text normalization (e.g., converts spoken numbers like “nine” to numerals “9”).

Usage

Basic Setup

from pipecat.services.funasr.stt import FunASRSTTService

stt = FunASRSTTService()

With GPU Acceleration

from pipecat.services.funasr.stt import FunASRSTTService

stt = FunASRSTTService(device="cuda")

With Custom Language

from pipecat.services.funasr.stt import FunASRSTTService
from pipecat.transcriptions.language import Language

stt = FunASRSTTService(
    settings=FunASRSTTService.Settings(
        language=Language.ZH,  # Chinese
    ),
)

With Inverse Text Normalization Disabled

from pipecat.services.funasr.stt import FunASRSTTService

stt = FunASRSTTService(
    settings=FunASRSTTService.Settings(
        use_itn=False,
    ),
)

With Custom Model

from pipecat.services.funasr.stt import FunASRSTTService

stt = FunASRSTTService(
    settings=FunASRSTTService.Settings(
        model="iic/SenseVoiceSmall",  # or another FunASR model identifier
    ),
)

Notes

  • First run downloads: The selected model downloads from the ModelScope hub on first use and is cached locally. Later runs load it from the cache.
  • Segmented transcription: FunASRSTTService extends SegmentedSTTService, meaning it processes complete audio segments after VAD detects the user has stopped speaking.
  • CPU and GPU support: FunASR can run on CPU or GPU (CUDA). Use the device parameter to choose.
  • Audio format: Expects 16-bit mono PCM audio at 16 kHz sample rate.
  • Multilingual support: SenseVoice natively supports Chinese, Cantonese, English, Japanese, and Korean. For other languages, it falls back to automatic language detection.
  • No external dependencies: Unlike API-based STT services, FunASR requires no API keys or network connectivity after the initial model download.
  • Inverse text normalization: By default, use_itn=True converts spoken numbers to numerals (e.g., “nine” → “9”). Disable this with use_itn=False if you need the raw transcription.
  • Non-autoregressive inference: SenseVoice uses non-autoregressive architecture for fast inference, making it suitable for real-time voice agents.