本地语音转文字(Qwen ASR),转录任务在 Apple Silicon 设备集群中分配,支持会议、语音笔记、播客等本地内容。
本地语音对文本 Transcription是一项面向实际任务的技能,主要用于您正在帮助某人在音频文件中使用语音对文本的转录—— 会议、语音备忘录、播客节目、电话录音—— 而不发送任何信息。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
您正在帮助他人对音频文件(如会议录音、语音备忘录、播客单集、电话录音等)执行语音转文字转录,全程无需上传至云端。所有音频文件均保留在用户本地设备中。系统集群会自动为每次语音转文字任务选择最优节点进行处理。
云端语音转文字 API 按分钟计费,且需将您的音频上传至第三方服务器。会议录音包含敏感的商业讨论,语音笔记承载个人思考,播客访谈则可能涉及尚未发布的原创内容——这些数据都不应离开您的内网。本地转录确保全程私密可控。
本能力将语音转文字请求智能调度至您的设备集群中。若某台机器正忙于处理一个 3 小时长的转录任务,后续语音转文字请求将自动路由至其他空闲设备。转录队列管理、节点健康监控与仪表盘可视化等功能,均基于您自有硬件实现——功能完备性媲美云端语音转文字 API,但完全运行于本地基础设施之上。
pip install ollama-herd herd # 启动转录路由服务(监听端口 11435) herd-node # 在每台转录设备上运行 uv tool install "mlx-qwen3-asr[serve]" --python 3.14 # 安装语音转文字模型
启用语音转文字转录功能:
curl -X POST http://localhost:11435/dashboard/api/settings
-H "Content-Type: application/json"
-d '{"transcription": true}'
软件包:ollama-herd | 仓库地址:github.com/geeks-accelerator/ollama-herd
# 对会议录音执行语音转文字转录 curl -s http://localhost:11435/api/transcribe -F "audio=@meeting-recording.wav" | python3 -m json.tool
import httpx
def speech_to_text_transcription(audio_path):
"""对音频文件执行语音转文字转录。"""
with open(audio_path, "rb") as f:
transcription_resp = httpx.post(
"http://localhost:11435/api/transcribe",
files={"audio": (audio_path, f)},
timeout=300.0,
)
transcription_resp.raise_for_status()
transcription_result = transcription_resp.json()
return transcription_result["text"]
# 执行语音转文字转录
transcription_text = speech_to_text_transcription("meeting.wav")
print(transcription_text)
def transcription_with_timestamps(audio_path):
"""执行语音转文字转录,并返回带时间戳的分段结果。"""
with open(audio_path, "rb") as f:
transcription_resp = httpx.post(
"http://localhost:11435/api/transcribe",
files={"audio": (audio_path, f)},
timeout=300.0,
)
transcription_resp.raise_for_status()
transcription_result = transcription_resp.json()
for transcription_chunk in transcription_result.get("chunks", []):
print(f"[{transcription_chunk['start']:.1f}s - {transcription_chunk['end']:.1f}s] {transcription_chunk['text']}")
return transcription_result
{
"transcription_text": "Hello, this is a test of the speech-to-text transcription system.",
"language": "English",
"transcription_chunks": [
{
"text": "Hello, this is a test of the speech-to-text transcription system.",
"start": 0.0,
"end": 3.2,
"chunk_index": 0,
"language": "English"
}
]
}
WAV、MP3、M4A、FLAC、MP4、OGG —— 即 FFmpeg 支持的所有格式。WAV 文件可通过原生快速路径获得约 25% 的转录速度提升。
| Header | 说明 |
|---|---|
X-Fleet-Node |
执行本次语音转文字转录的设备标识 |
X-Fleet-Model |
所用转录模型(qwen3-asr) |
X-Transcription-Time |
转录处理耗时(毫秒) |
Qwen3-ASR —— 2026 年最先进的开源语音转文字模型。词错误率(WER)约为 5%,原生支持 Apple Silicon(通过 MLX 运行)。该 0.6B 参数量模型仅占用约 1.2GB 内存,实时因子为 0.08x(即 10 分钟音频可在约 48 秒内完成转录)。
同一套路由服务除语音转文字外,还统一调度其余三类 AI 任务。所有接口均位于 http://localhost:11435:
curl http://localhost:11435/v1/chat/completions
-H "Content-Type: application/json"
-d '{"model":"gpt-oss:120b","messages":[{"role":"user","content":"Hello"}]}'
curl -o image.png http://localhost:11435/api/generate-image
-H "Content-Type: application/json"
-d '{"model":"z-image-turbo","prompt":"a sunset","width":1024,"height":1024,"steps":4}'
curl http://localhost:11435/api/embeddings
-d '{"model":"nomic-embed-text","prompt":"search query"}'
# 转录统计信息(最近 24 小时) curl -s http://localhost:11435/dashboard/api/transcription-stats | python3 -m json.tool # 集群健康状态(含语音转文字活动信息) curl -s http://localhost:11435/dashboard/api/health | python3 -m json.tool
仪表盘地址:http://localhost:11435/dashboard —— 语音转文字队列在界面上以 [STT] 标签显示,与 LLM 和图像队列并列呈现。
Agent Setup Guide —— 全面涵盖全部 4 类模型(含语音转文字)的参考指南,提供 Python、JavaScript 及 curl 示例代码。
~/.fleet-manager/ 目录下的任何文件。tail ~/.fleet-manager/logs/herd.jsonl。uv tool install "mlx-qwen3-asr[serve]" --python 3.14。相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习