FireRedAudio README

The project's README from github.com/FireRedTeam/FireRedAudio. As one markdown file: README.md.

FireRedAudio

Official PyTorch code for
FireRedAudio: A General-Purpose Audio Language Model with Decoupled Continuous Representations for Understanding and Generation

technical report FireRedAudio Demo Page HF-model ModelScope-model Apache-2.0

Overview

One model to listen, understand, reason, speak, and edit.

FireRedAudio is a general-purpose audio language model built on a shared 9B-parameter LLM with decoupled continuous representations: an Audio Encoder handles understanding, while a RedAE pathway handles generation. A single model supports ASR, audio understanding, zero-shot TTS, instruct TTS, semantic/acoustic speech editing, and accurate temporal grounding over recordings up to one hour long.

FireRedAudio Logo

Highlights ✨

Long-Audio Understanding: Time–Content Alignment Demo

News

Contents

Quick Start 🚀

Installation

Requires Python 3.10 and uv. System prerequisites: a CUDA toolkit (GPU inference + compiling the causal-conv1d / flash-attn kernels) and ffmpeg (audio decoding via torchaudio/torchcodec).

Wheels target CUDA 12.8 (cu128) by default. For a different CUDA version, change the pytorch-cu128 index URL in pyproject.toml (e.g. cu126 / cu129) and re-run uv sync.

uv sync --extra accel --extra accel-build --group tools   # + compile causal-conv1d, flash-attn

Model Download

Download the pretrained model from Hugging Face with the hf CLI:

uv run hf download FireRedTeam/FireRedAudio --local-dir pretrained_models/

Alternatively, download the pretrained model using modelscope CLI:

uv pip install modelscope
uv run modelscope download --model FireRedTeam/FireRedAudio --local_dir pretrained_models/

Python API

import torch
import torchaudio
from inference import FireRedAudioInference

# Init the model. Understanding tasks need only --model; generation tasks
# additionally need the RedAE decoder weights.
engine = FireRedAudioInference(
    model_path="pretrained_models/FireRedAudio",
    vae_decoder_path="pretrained_models/RedAE_decoder/model.pt",   # only for tts / edit / voice_design
    device="cuda:0",
)

# ---- 1) Speech recognition (ASR) -----------------------------------------
res = engine.understand("assets/examples/asr_zh_fleurs.wav", "Transcribe speech to text.", task="asr")
print(res.answer)

# ---- 2) Audio understanding (with optional chain-of-thought) --------------
res = engine.understand(
    "assets/examples/assets_mmau_test.wav",
    "What illness did Second speaker's friend suffer from?\n(A) Progressive arthritis (B) Progressive cancer (C) Acute pneumonia (D) Chronic heart disease",
    task="understand", enable_thinking=True, max_new_tokens=10240,
)
print("CoT:")
print(res.reasoning)   # CoT reasoning, or None
print("Answer")
print(res.answer)

# ---- 3) Zero-shot TTS (ICL voice cloning) ---------------------------------
res = engine.tts(
    prompt_text="同时,他强调微调要科学有序。",
    prompt_audio="assets/examples/tts_zh_prompt.wav",
    target_text="安徽淮南秦师傅发现,停在小区的爱车右前驾驶窗玻璃被砸。",
    language="zh",
)
torchaudio.save("tts.wav", res.audio.cpu(), sample_rate=24000)

# ---- 4) Speech editing -----------------------------------------------------
# semantic: rewrite / substitute / insert / delete content. The model first writes
#          <|sot|>{rewritten text}<|eot|> then renders the audio.
res = engine.edit("assets/examples/edit_semantic_zh_ref.wav", "delete '比普通的茶叶要'", edit_type="semantic")
print(res.text)
torchaudio.save("edit_semantic.wav", res.audio.cpu(), sample_rate=24000)

# acoustic: change pitch / speed / volume. The instruction must follow the exact
#           templates below (the model is trained on these, not free-form phrasing):
#   pitch   ->  "shift the pitch by N step(s)"       N in {-6, ..., -1, 1, ..., +6}
#   speed   ->  "adjust the speed to X"              X in [0.5, 2.0], step 0.1
#   volume  ->  "adjust the volume to X"             X in [0.3, 2.0], step 0.1
res = engine.edit("assets/examples/edit_acoustic_zh_ref.wav", "shift the pitch by 3 steps", edit_type="acoustic")
torchaudio.save("edit_acoustic.wav", res.audio.cpu(), sample_rate=24000)

# ---- 5) Voice design (synthesis from a timbre description) -----------------
res = engine.voice_design(
    instruction="以女性高音区的清亮音色,表现出青年阶段的特质,音量略强,语速适中稍快,语调带有解释意味和急切的情感流露,确保语音流畅自然。",
    text="是我请他来的,可他什么也不知道,他来只是想打听一下,你们厂是不是有旧锅炉?",
)
torchaudio.save("voice_design.wav", res.audio.cpu(), sample_rate=24000)

Command Line Inference

# speech recognition
uv run inference.py --task asr --model pretrained_models/FireRedAudio --audio assets/examples/asr_zh_fleurs.wav

# audio understanding and QA; pass multiple files after one --audio
# (e.g. --audio a.wav b.wav for speaker verification).
# --enable-thinking to let the model reason first
uv run inference.py --task understand --model pretrained_models/FireRedAudio --audio assets/examples/assets_mmau_test.wav \
    --prompt "What illness did Second speaker's friend suffer from?\n(A) Progressive arthritis (B) Progressive cancer (C) Acute pneumonia (D) Chronic heart disease" --enable-thinking --max-new-tokens 4096


# ICL voice cloning from a reference audio and its transcript
uv run inference.py --task tts --model pretrained_models/FireRedAudio --vae-decoder pretrained_models/RedAE_decoder/model.pt \
    --prompt-audio assets/examples/tts_zh_prompt.wav --prompt-text "同时,他强调微调要科学有序。" \
    --target-text "安徽淮南秦师傅发现,停在小区的爱车右前驾驶窗玻璃被砸。" --language zh --output tts.wav

# speech editing; semantic rewrites content, acoustic changes pitch / speed / volume.
uv run inference.py --task edit --model pretrained_models/FireRedAudio --vae-decoder pretrained_models/RedAE_decoder/model.pt \
    --audio assets/examples/edit_semantic_zh_ref.wav --instruction "delete '比普通的茶叶要'" --edit-type semantic \
    --output edit_semantic.wav

# acoustic: instructions must use the exact trained templates, e.g.
#   "shift the pitch by N step(s)"  in  -6..6 steps        (pitch)
#   "adjust the speed to X"         in  [0.5, 2.0], step .1 (speed)
#   "adjust the volume to X"        in  [0.3, 2.0], step .1 (volume)
uv run inference.py --task edit --model pretrained_models/FireRedAudio --vae-decoder pretrained_models/RedAE_decoder/model.pt \
    --audio assets/examples/edit_acoustic_zh_ref.wav --instruction "shift the pitch by 3 steps" --edit-type acoustic \
    --output edit_acoustic.wav

# voice design
uv run inference.py --task voice_design --model pretrained_models/FireRedAudio --vae-decoder pretrained_models/RedAE_decoder/model.pt \
    --instruction "以女性高音区的清亮音色,表现出青年阶段的特质,音量略强,语速适中稍快,语调带有解释意味和急切的情感流露,确保语音流畅自然。" \
    --text "是我请他来的,可他什么也不知道,他来只是想打听一下,你们厂是不是有旧锅炉?" --output voice_design.wav

Web Demo (Gradio)

FireRedAudio Gradio Web Demo

A single-file Gradio app at app.py wraps all four tasks (zero-shot TTS · instruct TTS · speech editing · listen & understand) with the same weights and prompt templates as the CLI. Gradio is the only extra dep on top of the base install:

uv pip install gradio

uv run app.py \
    --model_path       pretrained_models/FireRedAudio \
    --vae_decoder_path pretrained_models/RedAE_decoder/model.pt \
    --host 0.0.0.0 --port 7860

Defaults to http://0.0.0.0:7860. The understanding tab exposes the full Qwen3 sampling controls (temperature, top_p, top_k, min_p, repetition_penalty, do_sample) with a think-preset toggle that swaps in Qwen3's recommended (temperature, top_p) for reasoning / non-reasoning modes. If you're serving behind a reverse proxy, add --root-path <prefix>.

Performance

Audio Understanding

Model
MMAU test-mini
MMAU test
MMSU
Step-Audio-R1.177.7–75.9
Step-Audio 278.0––
MiMo-Audio-7B-Instruct74.9–61.7
Kimi-Audio65.2––
LongCat-Next76.4––
Qwen3-Omni-30B-A3B-Instruct77.5–69.0
Gemini 3.1 Pro80.7*78.8*82.7*
Qwen3.5-Omni-Plus81.4*79.9*80.7*
FireRedAudio82.080.983.3

ASR

Model
AISHELL‑1
AISHELL‑2
test‑ios
WenetSpeech
Net ⁠|⁠ Meeting
LibriSpeech
clean ⁠|⁠ other
FLEURS
en ⁠|⁠ zh
FLEURS‑102
avg
KeSpeech
Opencpop
Step‑Audio 20.632.104.67 ⁠|⁠ 4.751.17 ⁠|⁠ 2.423.03 ⁠|⁠ 2.68–3.63–
MiMo‑Audio‑7B‑Instruct1.65––3.50 ⁠|⁠ –––––
Ming‑UniAudio‑16B‑A3B–2.84–1.62 ⁠|⁠ –––––
Kimi‑Audio0.602.565.37 ⁠|⁠ 6.281.28 ⁠|⁠ 2.424.44 ⁠|⁠ 2.69–––

FireRedAudio (FireRedTeam/FireRedAudio)

Searching Database…

这是什么?FireRedAudio 是一个通用音频语言模型,构建在一个共享的 9B 参数 LLM 之上,可以进行语音转写(ASR)、理解音频、零样本和指令式语音合成以及语音编辑,全部由同一个模型完成。
这是托管 API,还是我自己运行的代码?它是官方 PyTorch 研究代码加可下载的检查点:你需要自己通过 Python API、CLI 或捆绑的 Gradio 网页演示(app.py)来运行,而不是托管服务。
怎么把它跑起来?用 Python 3.10 和 uv 安装,然后用 hf CLI(或通过 modelscope CLI)从 Hugging Face 下载预训练权重,再通过 Python API、CLI 或单文件的 app.py Gradio 演示进行推理。
除了 Python 包我还需要装什么?你需要 CUDA 工具包来进行 GPU 推理并编译 causal-conv1d 和 flash-attn 内核,还需要 ffmpeg,供 torchaudio/torchcodec 解码音频使用。
安装上有什么我该注意的坑吗?如果你系统的 CUDA 版本不是 12.8,就需要手动修改 pyproject.toml 里的 pytorch-cu128 索引 URL 并重新运行 uv sync,这一步可能会让一次看似顺利的安装卡住。
这一个模型究竟能做哪些任务?它能处理 ASR、广泛和细粒度的音频理解、零样本 TTS、指令式 TTS、自由形式的语义/声学语音编辑,还支持对长录音的时间定位。
有不写代码就能试用它的方法吗?有,app.py 是一个单文件的 Gradio 网页演示,封装了零样本 TTS、指令式 TTS、语音编辑和听音理解任务,使用的权重和提示词与 CLI 相同。
它的架构与典型的 TTS/ASR 模型有何不同?它在共享骨干上使用专门设计的解耦表示:一条用于理解的 Audio Encoder 通路和一条独立的 RedAE 生成通路,两者都通过同一个 9B 参数的 LLM 骨干进行推理。
它能理解多长的音频文件?它可以处理长达一小时的录音,把内容整理成带时间戳的结构,生成有依据的摘要,并支持按时间检索内容或按内容检索时间。
Size
4 MB
Stars
2K
Updated
CommitSep 08
Age
1mo
Commits · 90 Days