Give Your AI Agent Local Speech: OpenAI-Compatible API + MCP #2862
LauraGPT
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Give Your AI Agent Local Speech
FunASR provides two self-hosted ways to add speech transcription to agents and applications:
Both paths run locally. Start with CPU for the simplest smoke test, then switch to CUDA when your environment is ready.
Option 1: OpenAI-compatible API
Install and start the server:
Transcribe a file:
Or reuse the OpenAI Python SDK:
The example server supports model aliases including
sensevoice,paraformer,paraformer-en, andfun-asr-nano. QueryGET /v1/modelsfor the source of truth on a running server. Useresponse_format=verbose_jsonwhen your client needs returned segments.Option 2: MCP for Claude and Cursor
Clone FunASR and install the Python package:
git clone https://github.com/modelscope/FunASR.git cd FunASR pip install -U funasrAdd the server to your MCP configuration. Replace the path below with the absolute path to your clone:
{ "mcpServers": { "funasr": { "command": "python", "args": [ "/absolute/path/FunASR/examples/mcp_server/funasr_mcp.py" ], "env": { "FUNASR_DEVICE": "cpu", "FUNASR_MODEL": "iic/SenseVoiceSmall" } } } }Then ask your assistant to transcribe a local file, for example:
What the default MCP path provides
zh,yue,en,ja, andkohints.FUNASR_MODELandFUNASR_DEVICE.Capabilities are model- and interface-specific. The default MCP path focuses on clean transcription: it does not advertise speaker diarization, and its cleaned text removes SenseVoice special tags. For emotion, audio-event, or speaker metadata, use a model and interface that explicitly returns those fields.
Documentation
If you try either path, share the client or framework, audio language, and CPU/GPU environment you used. Reproducible integration feedback is especially useful.
Beta Was this translation helpful? Give feedback.
All reactions