autogen - 💡(How to fix) Fix [Feature] FunASR as self-hosted speech-to-text tool for voice agents

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

For voice-enabled multi-agent systems, agents need a reliable STT backend. FunASR (16K+ stars) now offers an OpenAI-compatible transcription API that AutoGen agents can use directly.

Root Cause

For voice-enabled multi-agent systems, agents need a reliable STT backend. FunASR (16K+ stars) now offers an OpenAI-compatible transcription API that AutoGen agents can use directly.

Code Example

from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="x")

# Use in agent tool
def transcribe_audio(file_path: str) -> str:
    result = client.audio.transcriptions.create(
        model="sensevoice", file=open(file_path, "rb")
    )
    return result.text

---

pip install funasr fastapi uvicorn python-multipart
python examples/openai_api/server.py --device cuda
RAW_BUFFERClick to expand / collapse

Summary

For voice-enabled multi-agent systems, agents need a reliable STT backend. FunASR (16K+ stars) now offers an OpenAI-compatible transcription API that AutoGen agents can use directly.

Proposed Integration

FunASR provides examples/openai_api/server.py — a FastAPI server that exposes /v1/audio/transcriptions (same format as OpenAI). Any AutoGen agent using OpenAI audio can switch to FunASR by changing the base_url:

from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="x")

# Use in agent tool
def transcribe_audio(file_path: str) -> str:
    result = client.audio.transcriptions.create(
        model="sensevoice", file=open(file_path, "rb")
    )
    return result.text

Advantages over OpenAI Whisper API

FunASROpenAI Whisper API
Speed170x realtime~1x realtime
CostFree (self-hosted)$0.006/min
PrivacyLocal, no data leavesCloud
Speaker IDBuilt-inNo
Languages50+57

Setup

pip install funasr fastapi uvicorn python-multipart
python examples/openai_api/server.py --device cuda

Repo: https://github.com/modelscope/FunASR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING