Introduction¶
DSH emphasizes “everything is a plugin.” In DSH Web UI, one common approach to adding voice input to an input box is to rely directly on browser recognition capabilities. dsh-voice-funasr offers another path: transcribing first using a local FunASR int8 ONNX engine, falling back to the browser Web Speech API when the local engine is unavailable, and optionally calling the user’s own LLM endpoint for two-stage polishing.
What is this¶
dsh-voice-funasr is a local offline speech input plugin for DSH Web UI, maintained by @Zacklinkk, licensed under MIT, with version set to 0.1.2 and private set to true in package.json.
It solves the problem of: using the microphone button in DSH Web UI to “hold to speak, release to send,” and attempting to keep speech transcription local; if the local engine is unavailable, it falls back to browser recognition.
Compatibility and Runtime Environment:
- DSH:
>=0.1.0-rc.3 <0.2.0 - Node.js:
^22.19.0 || >=24.0.0 - Web profile
- The browser requires
MediaDevices/AudioWorklet, or a availableWeb Speech APIfallback
Core Features¶
Local Transcription¶
The plugin uses a local FunASR engine with the model combination paraformer-large + FSMN-VAD + ct-punc, using official int8 ONNX weights.
The default model directory is:
~/.dsh/voice-funasr/models
The directory contains three subdirectories: paraformer/, vad/, and punc/. The model is approximately 520MB.
Fallback to Browser Recognition¶
When the local engine is unavailable, the plugin automatically falls back to the browser Web Speech API. The settings panel allows handling the recognition backend, language, polish toggle and mode, engine status, re-detection, and model loading.
Optional LLM Polishing¶
The plugin supports optional two-stage LLM polishing to correct filler words or slips of the tongue.
The only potential outbound network request is the optional polishing, which goes through the user’s own LLM endpoint.
Input and Audio Flow¶
- Microphone button on the left side of the input box: hold to speak, release to send automatically.
- When polishing is enabled, it is polished before sending.
- Audio flows only in memory.
- Temporary WAV files are deleted immediately after use and are not written to disk by default.
- The plugin is automatically added to the profile via
package.json#dsh.bundle.patch.
Installation and Activation¶
First, install Python dependencies:
python3 -m pip install -U funasr-onnx modelscope
This step prepares the Python packages required for local inference.
Next, download the models:
python3 python/download_models.py --model-root ~/.dsh/voice-funasr/models
This step places the models in the default model directory.
Install development links within the plugin checkout:
dsh plugin --profile web add .
If you want to install a release package:
dsh plugin --profile web add ./dsh-voice-funasr-0.1.2.tgz
Then restart dsh web. You can warm up by loading the model in Settings -> Local Speech (FunASR) -> ‘Load Model’ before speaking for the first time.
Typical Usage¶
- Open the session input box in DSH Web UI.
- Hold the microphone button on the left side of the input box and speak.
- After releasing the button, it sends automatically; if polishing is enabled, it first calls the user-configured LLM endpoint for polishing, then sends.
- View engine status in Settings -> Local Speech (FunASR), perform re-detection or load models, and adjust the recognition backend, language, polish toggle and mode.
Configuration¶
The plugin supports the following configuration items, with default values as follows:
| Key | Default Value |
|---|---|
pythonCommands |
[python3, python] |
modelRoot |
~/.dsh/voice-funasr/models |
threads |
4 |
channelAuthority |
loopback |
maxAudioSeconds |
120 |
Use Cases and Notes¶
Suitable for users who need local speech input in DSH Web UI, wish for transcription to be as offline as possible, and are willing to use their own LLM endpoint for optional polishing.
Notes before use:
- The plugin is automatically added to the profile via
package.json#dsh.bundle.patch. Do not manually insertdsh-voice-funasrinto the profile’scordis.patch.yml, otherwise the same loader id will be duplicated. - Both
dsh-voice-chatand this plugin register theconversation.input.leftslot. Do not enable them simultaneously. - The only potential outbound network request is the optional polishing, which goes through the user’s own LLM endpoint.
- The plugin runs with the permissions of the current
dshprocess; you should check the source code and license before installing. The license for this plugin is MIT.
Uninstallation¶
Run:
dsh plugin --profile web remove dsh-voice-funasr
Then delete the ~/.dsh/voice-funasr/ directory. If local inference is no longer needed, you can uninstall the related Python packages (optional).
Links¶
- Repository: https://github.com/omdsh-dev/dsh-voice-funasr
- Directory page provided by documentation: https://www.skillhub.cn/plugins/omdsh-dev/dsh-voice-funasr