Run This Ai
EN DE

How to Deploy FunASR for Real-Time Speech Recognition: Step-by-Step Tutorial

Step-by-step tutorial for deploying FunASR with Docker for real-time speech recognition. Test the OpenAI-compatible API and integrate with your apps.

FunASR provides one of the easiest paths to running your own real-time speech recognition server. In this tutorial, we'll walk through deploying FunASR with Docker, testing the API, and integrating it with your applications.

πŸš€ Want to deploy FunASR yourself?

Docker configs, system requirements, and installation guides β€” all on one page.

View FunASR Tool Page β†’

Prerequisites

  • A server with at least 2 CPU cores and 4GB RAM (4 cores / 8GB recommended)
  • Docker and Docker Compose installed
  • NVIDIA GPU with CUDA support (optional β€” FunASR can run on CPU)

Step 1: Quick Start with Docker

The official Docker image is available at funasr/funasr:latest. Start the server with:

docker run -d --name funasr \
  -p 8080:8080 \
  -v ./data/funasr:/data \
  funasr/funasr:latest

This starts the FunASR server on port 8080 with persistent storage. The first startup downloads model files (~2-3GB), so expect it to take a few minutes.

Step 2: Test the API

FunASR provides an OpenAI-compatible API. Once the server is running, test it with a simple transcription request:

# Transcribe an audio file
curl -X POST http://localhost:8080/v1/audio/transcriptions \
  -H "Content-Type: multipart/form-data" \
  -F "file=@speech.mp3" \
  -F "model=paraformer"

Expected response:

{
  "text": "Hello, this is a test of the FunASR speech recognition system."
}

Step 3: Real-Time Streaming ASR

For live streaming transcription, FunASR exposes a WebSocket endpoint:

Endpoint Purpose
/v1/audio/transcriptions Standard Whisper-compatible API (batch)
/v1/audio/stream WebSocket streaming endpoint for real-time ASR
/mcp Model Context Protocol server for AI agents

Step 4: Docker Compose Deployment

For production deployments, use Docker Compose:

services:
  funasr:
    image: funasr/funasr:latest
    restart: unless-stopped
    ports:
      - 8080:8080
    volumes:
      - ./data/funasr:/data

Performance & Benchmarks

FunASR's Paraformer model achieves impressive performance:

  • Real-time factor (RTF): 0.02 on GPU (50Γ— faster than real-time)
  • Word Error Rate (WER): 5.8% on AISHELL-1 (Mandarin), 8.2% on LibriSpeech (English)
  • Latency: ~200ms end-to-end for streaming inference

Integrating with Your App

Since FunASR uses the OpenAI API format, any existing Whisper integration can be redirected:

# Python example β€” switch from OpenAI to FunASR
from openai import OpenAI

client = OpenAI(
    api_key="not-needed",
    base_url="http://localhost:8080/v1"
)

with open("meeting.mp3", "rb") as f:
    transcript = client.audio.transcriptions.create(
        model="paraformer",
        file=f
    )
print(transcript.text)

Conclusion

FunASR is one of the most complete open-source speech recognition solutions available today. Its combination of streaming ASR, VAD, punctuation restoration, speaker diarization, and OpenAI-compatible APIs makes it a powerful choice for anyone building speech-enabled applications.

πŸš€ Ready to deploy FunASR?

Get the full Docker setup, system requirements, and deployment guide on our tool page.

View FunASR Tool Page β†’
#funasr #tutorial #deployment #docker #real-time-asr