dsh-tts-live: DeepSeek Harness Sentence-level Real-time TTS Branch

Introduction

When adding speech to agent replies in DeepSeek Harness (DSH), the common practice is to synthesize after the entire assistant message has “landed.” The upstream @goodandready/dsh-tts’s speakAsItGoes is also message-granular: in a multi-step turn each step is a single message, and local models often must wait for the first step’s entire output (including reasoning) to finish before the browser hears the first audio segment—subjectively, it feels like “speech is always half a beat behind.”

YevheniiMiachyn/dsh-tts-live is a fork based on upstream 0.4.16 that retains the original TTS capabilities and provider chain, additionally provides an optional sentence-level live path, and includes several fixes for local OpenAI-compatible TTS. Below we describe what it is, what it can do, and how to install and configure it.

What is this

  • Name: dsh-tts-live in the community catalog, repository YevheniiMiachyn/dsh-tts-live, with the npm package name still @goodandready/dsh-tts (same as upstream, but this fork is not published to npm).
  • Maintainer: YevheniiMiachyn; SkillHub categorizes it as “model inference.”
  • Positioning: Synthesizes speech for agent replies in the DSH Web UI; this fork’s core additions are real-time sentence-level broadcasting, an ordered streaming queue, host-side barge-in cancellation, and local deployment fixes (e.g., WAV) for the custom provider.
  • Relationship with upstream: Issues regarding the base plugin’s provider chain, settings UI, cloud backends, localization, etc. should go to GooDAnDReaDY/dsh-tts; issues related to live sentence-level streaming should be filed in this fork’s repository. License: MIT, retaining upstream copyright notices.

Why a sentence-level live path is needed

Upstream only reads after the assistant message settles; on local GPU stacks, “waiting for the entire message” is often the main source of speech delay. This fork drives true sentence-level TTS via the in-process agent/assistant-stream event: as soon as the model finishes writing a sentence it can enter the synthesis queue, and the first sentence can even begin synthesis before assistant/message settles, so users can hear the preceding sentences while the model is still producing output.

The design is conservative: the live path is disabled by default and must be explicitly enabled; the settled-message path remains the authoritative source; streamingEnabled (upstream SSE / AudioWorklet path) and live mode are independent of each other and do not require each other.

Core capabilities of this fork

Sentence-level streaming and queue

  1. Listen to agent/assistant-stream, split into sentences, and queue synthesis.
  2. Ordered sentence queue: one segment per sentence, published in order, with stable IDs to avoid duplicate or out-of-order playback on the client.
  3. Each queued item and settled segment carries session / turn / step attribution.
  4. Settlement reconciliation: after the settle message arrives, already-read text is aligned with the message, and only the unread tail is published.
  5. Multi-step and tool calls: reasoning and tool-call JSON are not read; steps already broadcast during the live phase are not re-read.
  6. Configurable minimum character counts for the first/subsequent sentences, per-segment upper limits, polling interval, and whether to flush the unread remainder before tool calls.

Barge-in and late-settle

  • The host provides POST /dsh-tts/bargein: discards pending audio and aborts ongoing synthesis (per session).
  • Late-settle suppression: audio already discarded by barge-in will not be “resurrected” by retries or re-settling.
  • The custom provider requests response_format: 'wav' and returns audio/wav accordingly.
  • Fixes abort not being properly hooked, which prevented canceling ongoing synthesis.
  • Prevents the browser’s SpeechSynthesis from using OS voices to “mask” provider errors.
  • Provider timeout raised to 120 s to accommodate local TTS cold starts.
  • Fixes duplicate publishing of the live tail (accurate claiming of text ranges based on claimedEnd).

For a more detailed patch list see the repository’s PATCHES.md; design notes are in LIVE-SENTENCE.md.

Capabilities inherited from upstream (briefly)

This fork is still a complete DSH TTS plugin: when Speak agent replies is enabled in the Web UI, the host backend synthesizes and pushes audio to the browser, so API keys never reach the client. It supports multi-provider fallback chains (OpenAI, ElevenLabs, Edge, Piper, eSpeak, custom OpenAI-compatible endpoints, etc.), as well as text cleaning, an IT dictionary, per-sub-agent voices, caching, and several HTTP routes (e.g., GET /dsh-tts/stream, POST /dsh-tts/speak). These capabilities match upstream; use this repository when you need sentence-level live, and use @goodandready/dsh-tts when you need the official npm package (without this fork’s live features).

Installation and enabling

The README requires installing from this repository’s checkout, using file: dependencies to pin tested artifacts; avoid link: in production. The SkillHub page marks the current version as v0.4.16-local.14 (consistent with package.json).

  1. In this repository, prepare the dsh-tts-<version>.tgz package per the release notes (replace paths with your actual directory and version).
  2. Run the official installation command:
dsh plugin --profile web add file:/path/to/dsh-tts-<version>.tgz

If you only need the upstream npm version (without live sentence-level streaming), you can use:

dsh plugin --profile web add @goodandready/dsh-tts
  1. After installation, restart the DSH Web UI (README example: systemctl --user restart dsh-web) and refresh the browser tab.

Runtime environment: the README specifies Node 20+. The plugin executes synthesis and network access on the host side with the current DSH process’s privileges; read the source code and the MIT license before installing, and assess provider and local engine configurations yourself.

Typical configuration: enabling live sentence-level streaming

Add or modify the following keys under the dsh-tts: section in settings.yaml (all from the README documentation):

Key Default Meaning
liveSentenceStreaming false Master switch for the live sentence-level path
liveMinCharsFirst 12 Minimum characters before the first sentence is allowed to flush
liveMinChars 48 Minimum characters for subsequent sentence flushes
liveMaxChars 0 Per-segment hard upper limit; falls back to sentenceChars when 0
livePollMs 150 Polling interval (ms) for the pending queue during live
liveFlushOnToolCall true Whether to flush the unread remainder before tool calls

Example (the validated production-oriented config from the README: streamingEnabled kept independent and may be false):

dsh-tts:
  speakReplies: true
  liveSentenceStreaming: true
  liveMinCharsFirst: 12
  liveMinChars: 48
  liveMaxChars: 0
  livePollMs: 150
  liveFlushOnToolCall: true
  streamingEnabled: false

In the Web UI, most user-facing items can be adjusted under Settings → Plugins → Plugin settings; provider API keys are written to the DSH credential store via the chain editor (PUT /dsh-tts/credential), not stored as plaintext in plugin settings.

To interrupt the current session’s broadcast, the integrator calls POST /dsh-tts/bargein (the specific request body is subject to the repository’s current implementation).

Suitable scenarios and limitations

More suitable

  • Local or self-hosted DSH + local/compatible TTS, wanting to generate and read simultaneously to shorten the wait for “first sentence audible.”
  • Multi-step agents (including tool calls) that need not to read reasoning/JSON and avoid duplicate reading of the same step.
  • Using a custom OpenAI-compatible TTS and needing WAV and longer synthesis timeouts.

Points to note

  • GPU contention: when the LLM and local TTS share a GPU, live only improves scheduling (earlier reading); it does not speed up the model or TTS itself.
  • Does not solve TTFT: first-token time still depends on the model and hardware; live eliminates the wait for full settlement after “the first sentence already exists.”
  • When skipCode: true, inline code is stripped; sentences composed of code snippets may read in a fragmented way—this is more noticeable in live mode because there are more sentences.
  • Performance varies with model, TTS engine, and GPU configuration; the numbers in the release notes come from a specific local environment and should not be extrapolated as general benchmarks.

The DSH ecosystem emphasizes “everything is a plugin”; SkillHub is a community catalog with no official affiliation with DeepSeek / 幻方 (Higgsfield).

Conclusion

On top of a mature TTS plugin, dsh-tts-live adds an optional, default-disabled sentence-level live path that changes “wait for the whole message then read” into “queue by sentence, reconcilable, barge-in capable,” and makes production-oriented fixes for local custom WAV and cancellation/timeouts. If you are building voice agents in DSH and the bottleneck is message-level broadcasting, you can enter the repository from the SkillHub page, install via file: packages per the README, and enable liveSentenceStreaming to verify.

  • Catalog page: https://www.skillhub.cn/plugins/YevheniiMiachyn/dsh-tts-live
  • GitHub: https://github.com/YevheniiMiachyn/dsh-tts-live
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye