背景
目前 coordinator.rs 只路由两条 ASR:
volcengine — 火山 SAUC bigmodel,自建 WebSocket(asr/volcengine.rs)
whisper — WhisperBatchASR(asr/whisper.rs),任意 OpenAI 兼容 POST /audio/transcriptions,凭据走 asr.api_key / asr.endpoint / asr.model
设置页 Settings.tsx:279 的 ASR_PRESETS 也只列了这两项。Issue #58 中曾尝试加入 SiliconFlow,因后端未路由被回退(注释见 Settings.tsx:277)。
目标
把以下 ASR 服务商作为新的可选项接入,复用 OpenAI 兼容批处理通道 ,让用户在「设置 → 服务商 → ASR」中通过下拉切换、自动预填 baseURL/model:
服务商
端点
推荐模型
兼容性
通义千问(阿里 DashScope)
https://dashscope.aliyuncs.com/compatible-mode/v1
qwen3-asr-flash
OpenAI 兼容(待复核)
硅基流动 SiliconFlow
https://api.siliconflow.cn/v1
FunAudioLLM/SenseVoiceSmall
OpenAI 兼容 ✅
智谱 GLM
https://open.bigmodel.cn/api/paas/v4
glm-asr-2512
OpenAI 兼容 ✅
OpenAI Whisper
https://api.openai.com/v1
whisper-1 / gpt-4o-transcribe
已支持(现有 whisper preset)
Groq
https://api.groq.com/openai/v1
whisper-large-v3-turbo
OpenAI 兼容 ✅
设计原则
后端零侵入或最小侵入 :能用现有 WhisperBatchASR 通道的,就不新增 Rust 模块——「采用标准接口形式」即 OpenAI /audio/transcriptions。
凭据隔离 :用现有 asr.api_key / asr.endpoint / asr.model 三个 CredentialAccount,切换 preset 时由前端把 asr.endpoint 和 asr.model 默认值填上(参考 LLM preset 切换逻辑)。
失败保护沿用既有契约 :CLAUDE.md 明确 ASR fallback 是静默的——凭据缺失走 mock 占位,不抛硬错。新 preset 必须遵循。
不引入流式实现 :通义/SiliconFlow/GLM 等的批处理已能满足 OpenLess 的 hold-to-talk 模型;如果未来要 Aliyun NLS Paraformer 的真流式 / Deepgram / AssemblyAI(非 OpenAI 兼容),单独开 issue。
V1 实施清单(本 issue 范围)
Frontend(openless-all/app/src/pages/Settings.tsx)
Backend(仅扩枚举,不新增 ASR 客户端 )
验证(CLAUDE.md 要求逐项实测)
待复核风险
DashScope 是否真的对 Qwen3-ASR-Flash 暴露 OpenAI /audio/transcriptions :阿里 help 中心 JS 渲染,curl 抓不到正文;实施前需先 curl 一发 16 kHz mono WAV 验证,若不兼容则 Qwen 这一项落到 V2(单独客户端)。
采样率 :WhisperBatchASR 固定写 16 kHz mono PCM → WAV,理论上各家都接受,但 DashScope/SiliconFlow 个别模型可能需要 16 kHz 以上;先按 16 kHz 试,失败再加配置。
不在范围(V2 候选,单独提 issue)
Aliyun NLS Paraformer 真流式(WebSocket)—— 需要新 Rust 模块,工作量与 volcengine 客户端相当
Deepgram /v1/listen、AssemblyAI 上传+轮询 —— 非 OpenAI 兼容,需独立客户端
与 Issue feat(ASR): 增加对本地 ASR AI 的支持 #211 (本地 ASR)协调统一抽象层
背景
目前
coordinator.rs只路由两条 ASR:volcengine— 火山 SAUC bigmodel,自建 WebSocket(asr/volcengine.rs)whisper—WhisperBatchASR(asr/whisper.rs),任意 OpenAI 兼容POST /audio/transcriptions,凭据走asr.api_key/asr.endpoint/asr.model设置页
Settings.tsx:279的ASR_PRESETS也只列了这两项。Issue #58 中曾尝试加入 SiliconFlow,因后端未路由被回退(注释见Settings.tsx:277)。目标
把以下 ASR 服务商作为新的可选项接入,复用 OpenAI 兼容批处理通道,让用户在「设置 → 服务商 → ASR」中通过下拉切换、自动预填 baseURL/model:
https://dashscope.aliyuncs.com/compatible-mode/v1qwen3-asr-flashhttps://api.siliconflow.cn/v1FunAudioLLM/SenseVoiceSmallhttps://open.bigmodel.cn/api/paas/v4glm-asr-2512https://api.openai.com/v1whisper-1/gpt-4o-transcribehttps://api.groq.com/openai/v1whisper-large-v3-turbo设计原则
WhisperBatchASR通道的,就不新增 Rust 模块——「采用标准接口形式」即 OpenAI/audio/transcriptions。asr.api_key/asr.endpoint/asr.model三个CredentialAccount,切换 preset 时由前端把asr.endpoint和asr.model默认值填上(参考 LLM preset 切换逻辑)。V1 实施清单(本 issue 范围)
Frontend(
openless-all/app/src/pages/Settings.tsx)ASR_PRESETS:新增qwen/siliconflow/zhipu/groq四项;保留whisper(OpenAI 原生)。asr.endpoint与asr.model默认值(onAsrProviderChange中加 preset 表)。i18n/zh-CN.ts与i18n/en.ts的settings.providers.presets.*节点补对应文案。Backend(仅扩枚举,不新增 ASR 客户端)
coordinator.rs:906的if active_asr == \"whisper\"分支扩成 "任意非 volcengine 都走 WhisperBatchASR";或显式列入qwen/siliconflow/zhipu/groq。read_whisper_credentials的modelfallback 保留whisper-1,但当 base_url 是非 OpenAI 时不强制——前端 preset 已经塞入正确 model。验证(CLAUDE.md 要求逐项实测)
待复核风险
/audio/transcriptions:阿里 help 中心 JS 渲染,curl 抓不到正文;实施前需先curl一发 16 kHz mono WAV 验证,若不兼容则 Qwen 这一项落到 V2(单独客户端)。WhisperBatchASR固定写 16 kHz mono PCM → WAV,理论上各家都接受,但 DashScope/SiliconFlow 个别模型可能需要 16 kHz 以上;先按 16 kHz 试,失败再加配置。不在范围(V2 候选,单独提 issue)
/v1/listen、AssemblyAI 上传+轮询 —— 非 OpenAI 兼容,需独立客户端