dsh-deepseek-asr
norwinyu/dsh-deepseek-asr
为内置 Voice input bundle 提供的 DeepSeek ASR 识别器:麦克风录制 16 kHz 单声道 WAV,经付费的 /v1/tools/asr 接口转写,无需下载本地模型,转写结果作为可编辑草稿插入输入框。
安装
dsh plugin --profile web add github:norwinyu/dsh-deepseek-asrREADME
DeepSeek ASR for DeepSeek Harness
Speak into DSH and let DeepSeek's hosted ASR transcribe it — no local model download.
DSH's Voice input bundle ships one recognizer: a local SenseVoice model that must be downloaded (239 MB INT8, 938 MB FP32) and run on the Host CPU before the first recording. This bundle keeps the microphone button, the recording bar, the language and input-device settings, and the editable draft insertion — and replaces the recognizer with a call to DeepSeek's hosted ASR endpoint.
One POST /v1/tools/asr, one transcript, no model to download or keep.
Table of Contents
- Why
- How it works
- Requirements
- Install
- Usage
- Configuration
- Privacy and billing
- Uninstall
- Troubleshooting
- Development
- Contributing
- License
Why
- Nothing to download. No model weights, no native runtime, no first-run preparation dialog. The recognizer is ready as soon as the Host loads it.
- No CPU inference. Recognition latency no longer competes with the agent or the rest of the machine.
- Same interface. The bundle contributes a provider, not a UI: the stock microphone, settings page, and draft flow all stay as they are.
- Pay per use. Billing is per hour of audio on your own DeepSeek account (rates); a few seconds of dictation is a fraction of a fen, and the key may be one you already use for chat.
How it works
The bundle is a patch layer over the built-in Voice input bundle. It addresses the rows that bundle already inserts and swaps only the recognizer (simplified; the shipped patch also names each module):
- id: speech-to-text # point the shared registry at the cloud provider
config:
defaultProvider: deepseek-asr
- id: speech-to-text-sensevoice # stop offering the local model download
disabled: true
- insert:
- id: speech-to-text-deepseek # the provider shipped in lib/provider.mjs
name: ./lib/provider.mjs
The provider:
- registers on
ctx.speechToTextwithlocation: 'cloud', so the UI shows no install prompt and no download estimate; - declares no
preparation, so it is ready the moment the service exists; - resolves
DEEPSEEK_API_KEYper request through the credentials service, falling back to the launching environment; - forwards the browser's 16 kHz mono PCM16 WAV as
multipart/form-dataand returns{ text, audioSeconds, inferenceSeconds }.
Audio is held in memory for the request only. It never becomes a Session attachment; only the transcript enters the conversation, after the user sends it.
Requirements
- DSH
>=0.2.2-rc.1 <0.3.0. - The built-in Voice input bundle enabled
(
@deepseek-ai/dsh-experimental-voice-input-bundle). It provides the speech service, thespeechRemote, and the microphone; this bundle only swaps the recognizer. Enable it first — see Troubleshooting. - A DeepSeek API key from https://platform.deepseek.com, stored under
Settings → Models as
DEEPSEEK_API_KEYor exported with that name. The ASR endpoint is a paid API: transcriptions are billed to that account, so it needs an available balance.
Install
From the plugin index (recommended):
- Enable Custom plugin indexes in the plugin manager.
- Open Discover → Add index source and paste
https://norwinyu.github.io/dsh-deepseek-asr/index.json. - Open DeepSeek ASR and install the listed version, then reload.
From npm:
dsh plugin --profile <name> add dsh-deepseek-asr@0.1.3
From a pinned Git release:
dsh plugin --profile <name> add git+https://github.com/NorwinYu/dsh-deepseek-asr.git#v0.1.3
The index serves the current version from npm; older versions stay pinned to their commits.
Usage
The microphone sits between the model selector and the send button.
- Click it and allow microphone access when asked.
- Speak; the recording bar shows the live level.
- Click stop. The transcript lands in the composer as editable text — review it before sending, or discard it.
Language and input device are chosen in the voice settings; the endpoint detects
the language itself, so auto is the default.
Configuration
Every field is optional. Override them on the speech-to-text-deepseek row in
the profile's cordis.patch.yml:
- id: speech-to-text-deepseek
config:
apiKeyEnv: DEEPSEEK_API_KEY
requestTimeoutMs: 120000
| Field | Default | Meaning |
|---|---|---|
providerId | deepseek-asr | Registry id; must match defaultProvider on the speech-to-text row |
displayName | DeepSeek ASR | Name shown in the voice settings |
endpoint | https://api.deepseek.com/v1/tools/asr | Accepts 16-bit PCM WAV or Ogg Opus, up to 8 MiB and 120 s. Must be https:, or http: on loopback |
apiKeyEnv | DEEPSEEK_API_KEY | Credential name, resolved through the credentials service then the process environment |
apiKey | none | Literal key; not recommended, it would land in a config file |
requestTimeoutMs | 120000 | Per-request timeout |
statusPath | none | Optional diagnostics file; omit to disable |
The upstream endpoint accepts 21 languages and detects them automatically. DSH itself caps a recording at 120 seconds and 4 MiB, which fits inside the endpoint's 8 MiB limit.
Privacy and billing
This is a paid DeepSeek API, not a free service. Every recording that reaches the endpoint is billed to the DeepSeek account that owns the key, per hour of audio, at the rate published in the ASR documentation. Metering is to the second, with sub-second audio rounded up to one second; one account may run at most 50 concurrent requests, and calls fail once the balance is exhausted. Quote prices from that page rather than from this README, since published rates and promotions change.
- The recording leaves the machine and is sent to DeepSeek. There is no local transcription, offline mode, or fallback.
- The key is never bundled, logged, or written by this package.
- Audio is transient: held in memory for the request, never attached to a Session event.
If you need offline transcription, keep the built-in SenseVoice recognizer; both
can coexist in one profile if you point defaultProvider at one of them.
Uninstall
Remove the bundle from the profile (Discover, or
dsh plugin --profile <name> remove dsh-deepseek-asr). The built-in Voice input
bundle then owns the recognizer again: its SenseVoice row is re-enabled, and the
next first recording offers the model download.
Nothing of this plugin persists — no model cache, no stored key, no audio. If you
set statusPath, delete that file yourself.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| No microphone button | Voice input bundle not enabled, or the provider failed to load. Both rows should be active in the plugin manager. |
| Prompt to install a SenseVoice model | Voice input was enabled after this bundle, so its patch layer ran last and restored defaultProvider: sensevoice-local. Enable Voice input first, then this bundle, or move dsh-deepseek-asr after it in dsh.profile.bundles. |
No DEEPSEEK_API_KEY configured | Store the key under Settings → Models, or export it in the launching environment. |
| HTTP 400 | Audio format rejected: the endpoint wants 16-bit PCM WAV or Ogg Opus. |
| HTTP 401 / 403 | The key is missing, invalid, expired, or not allowed to call ASR. |
| HTTP 429 | More than 50 concurrent requests on the account. |
| HTTP 503 / 504 | Service side; retry. |
| No transcript, no error | Set statusPath and check phase: registered, ok (with requestId), failed, disposed. |
The diagnostics file never contains the key or the audio — only the phase, the HTTP status, and the transcript length.
Development
The repository is the package; there is no build step.
git clone https://github.com/NorwinYu/dsh-deepseek-asr
cd dsh-deepseek-asr
node test/manifest.mjs # structural checks, no network
End-to-end smoke test against the live endpoint (needs a stored key):
say -v Ting-Ting "Shanghai weather today" -o /tmp/t.aiff
afconvert -f WAVE -d LEI16@16000 -c 1 /tmp/t.aiff /tmp/t.wav
node test/smoke.mjs /tmp/t.wav
It stubs the plugin context, resolves the key the same way the Host does, and prints the transcript result. Publishing and index maintenance are documented in PUBLISHING.md.
Contributing
Issues and pull requests are welcome. Please keep the surface small: this bundle owns one recognizer and nothing else. See CONTRIBUTING.md for the checks a change has to pass, and never commit an API key or a recording.
License
Disclaimer
A third-party plugin, not affiliated with DeepSeek. "DeepSeek" refers to the API this plugin calls; any trademarks belong to their owners.