Fun-ASR-Nano-API

Fun-ASR-Nano-API

Docker app from hsiang's Repository

Overview

OpenAI-compatible Speech-to-Text API powered by Fun-ASR-Nano (800M, FunAudioLLM). 31 languages, Chinese dialects, hotwords, streaming-capable. Switch between Fun-ASR-Nano (full features) and Fun-ASR-MLT (31 languages including European) via MODEL_ID. First start downloads model from HuggingFace. China users: set HF_ENDPOINT to https://hf-mirror.com. Requires NVIDIA GPU with driver 550+.

Fun-ASR-Nano-API

中文文档

OpenAI-compatible Speech-to-Text API powered by Fun-ASR-Nano (Alibaba FunAudioLLM).

800M parameters. 31 languages. Chinese dialects. Hotwords. VAD. Punctuation. Speaker diarization. One container.

Features

  • OpenAI-compatible /v1/audio/transcriptions endpoint
  • 31 languages (Chinese, English, Japanese, Korean, Vietnamese, Arabic, and more)
  • Chinese dialects: Wu, Cantonese, Min, Hakka, Gan, Xiang, Jin + 26 regional accents
  • Hotword boosting (improve recognition of domain-specific terms)
  • VAD (Voice Activity Detection) — auto-segments long audio
  • Automatic punctuation restoration
  • Speaker diarization (who said what)
  • Switchable models via MODEL_ID:
    • Fun-ASR-Nano-2512 (default) — full features, dialects, hotwords
    • Fun-ASR-MLT-Nano-2512 — 31 languages including European

Quick Start

# Default: Fun-ASR-Nano (Chinese dialects, hotwords, full features)
docker run -d --gpus all \
  -p 8080:8080 \
  -v /mnt/user/appdata/fun-asr-nano-api/models:/root/.cache/huggingface \
  -e MODEL_ID=FunAudioLLM/Fun-ASR-Nano-2512 \
  --shm-size=4g \
  --name fun-asr-nano-api \
  ghcr.io/hsiang-han/fun-asr-nano-api:latest

# With speaker diarization enabled
docker run -d --gpus all \
  -p 8080:8080 \
  -v /mnt/user/appdata/fun-asr-nano-api/models:/root/.cache/huggingface \
  -e MODEL_ID=FunAudioLLM/Fun-ASR-Nano-2512 \
  -e ENABLE_SPK=true \
  --shm-size=4g \
  --name fun-asr-nano-api \
  ghcr.io/hsiang-han/fun-asr-nano-api:latest

# Alternative: Fun-ASR-MLT (31 languages including European)
docker run -d --gpus all \
  -p 8080:8080 \
  -v /mnt/user/appdata/fun-asr-nano-api/models:/root/.cache/huggingface \
  -e MODEL_ID=FunAudioLLM/Fun-ASR-MLT-Nano-2512 \
  --shm-size=4g \
  --name fun-asr-nano-api \
  ghcr.io/hsiang-han/fun-asr-nano-api:latest

China users: add -e HF_ENDPOINT=https://hf-mirror.com.

Usage Examples

# Basic transcription (OpenAI-compatible)
curl -X POST http://localhost:8080/v1/audio/transcriptions \
  -F "file=@audio.wav"

# Specify language
curl -X POST http://localhost:8080/v1/audio/transcriptions \
  -F "file=@audio.wav" \
  -F "language=中文"

# With hotwords (boost domain-specific terms)
curl -X POST http://localhost:8080/v1/audio/transcriptions \
  -F "file=@audio.wav" \
  -F "hotwords=人工智能,大语言模型,通义千问"

# Verbose output (timestamps + speaker info if enabled)
curl -X POST http://localhost:8080/v1/audio/transcriptions \
  -F "file=@audio.wav" \
  -F "response_format=verbose_json"

Response Examples

Standard (json):

{"text": "今天天气真好,我们出去玩吧。"}

Verbose (verbose_json, with speaker diarization):

{
  "text": "今天天气真好,我们出去玩吧。",
  "language": "中文",
  "segments": [
    {"start": 0.0, "end": 2.5, "text": "今天天气真好,", "speaker": 0},
    {"start": 2.5, "end": 4.8, "text": "我们出去玩吧。", "speaker": 1}
  ]
}

API Endpoints

Endpoint Method Description
/v1/audio/transcriptions POST Speech-to-text (OpenAI-compatible)
/v1/models GET List models
/health GET Health check (shows enabled features)
/docs GET Swagger documentation

Environment Variables

Variable Default Description
MODEL_ID FunAudioLLM/Fun-ASR-Nano-2512 Model to load
DEVICE cuda:0 Compute device (cuda:0, cpu)
LANGUAGE auto Default language (auto, 中文, English, 日文, etc.)
ENABLE_VAD true Voice Activity Detection (segments long audio)
ENABLE_PUNC true Auto punctuation restoration
ENABLE_SPK false Speaker diarization (who said what)
PORT 8080 API server port
HF_ENDPOINT https://huggingface.co HuggingFace mirror

Available Models

Model ID Languages Features
FunAudioLLM/Fun-ASR-Nano-2512 Chinese+dialects, English, Japanese, Korean, + more Hotwords, dialects, accents, lyrics
FunAudioLLM/Fun-ASR-MLT-Nano-2512 31 languages (including European) Broader language coverage

Pipeline Components

Component Model Size Enabled by
ASR Fun-ASR-Nano-2512 800M always
VAD fsmn-vad 0.4M ENABLE_VAD=true
Punctuation ct-punc 290M ENABLE_PUNC=true
Speaker cam++ 7.2M ENABLE_SPK=true

Hardware Requirements

  • NVIDIA GPU with 2GB+ VRAM (ASR only) or 3GB+ (with all components)
  • NVIDIA driver 550+
  • Docker with NVIDIA Container Toolkit

Credits

License

Apache-2.0

Install Fun-ASR-Nano-API on Unraid in a few clicks.

Find Fun-ASR-Nano-API in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Fun-ASR-Nano-API Review the template variables and paths Click Install

Related apps

Details

Repository
ghcr.io/hsiang-han/fun-asr-nano-api:latest
Last Updated2026-07-06
First Seen2026-06-10

Runtime arguments

Web UI
http://[IP]:[PORT:8080]/docs
Network
bridge
Shell
bash
Privileged
false
Extra Params
--gpus all --shm-size=4g

Template configuration

API PortPorttcp

OpenAI-compatible STT API port. Swagger docs at /docs

Target
8080
Default
8080
Value
8080
Model CachePathrw

Model download cache. Persists across container recreates.

Target
/root/.cache/huggingface
Default
/mnt/user/appdata/fun-asr-nano-api/models
Value
/mnt/user/appdata/fun-asr-nano-api/models
Model IDVariable

Fun-ASR-Nano-2512 (full features, dialects, hotwords) or FunAudioLLM/Fun-ASR-MLT-Nano-2512 (31 languages including European).

Target
MODEL_ID
Default
FunAudioLLM/Fun-ASR-Nano-2512
Value
FunAudioLLM/Fun-ASR-Nano-2512
LanguageVariable

Default language: auto, 中文, English, 日文, etc. Per-request override via API parameter.

Target
LANGUAGE
Default
auto
Value
auto
Enable VADVariable

Voice Activity Detection. Segments long audio into utterances. Recommended for files longer than 30s.

Target
ENABLE_VAD
Default
true
Value
true
Enable PunctuationVariable

Auto-add punctuation to transcription output.

Target
ENABLE_PUNC
Default
true
Value
true
Enable Speaker DiarizationVariable

Identify who is speaking. Adds ~7MB speaker model. Results in verbose_json format.

Target
ENABLE_SPK
Default
false
Value
false
HuggingFace EndpointVariable

HuggingFace download endpoint. China users: change to https://hf-mirror.com for faster downloads.

Target
HF_ENDPOINT
Default
https://huggingface.co
Value
https://huggingface.co
NVIDIA Visible DevicesVariable

GPU selection (all, 0, 1, etc.)

Target
NVIDIA_VISIBLE_DEVICES
Default
all
Value
all
NVIDIA Driver CapabilitiesVariable

NVIDIA driver capabilities

Target
NVIDIA_DRIVER_CAPABILITIES
Default
compute,utility
Value
compute,utility