Goal
Let NextChat voice input use a self-hosted FunASR/SenseVoice transcription service without bundling a Python or model runtime into the NextChat application.
Proposed first milestone
Reuse the OpenAI-compatible multipart contract:
POST <configurable-base-url>/v1/audio/transcriptions
Content-Type: multipart/form-data
The initial integration should:
- keep the existing transcription behavior as the default;
- allow a configurable transcription base URL, model name, and optional bearer token;
- send the recorded audio using the existing multipart flow and consume the standard
{ "text": "..." } response;
- keep credentials on the existing server-side/configuration boundary and avoid leaking them into logs or shareable settings;
- work with any compatible endpoint rather than adding a hard dependency on the
funasr Python package.
This contract can point to a local FunASR deployment while remaining useful for other self-hosted transcription servers.
Capability and license scope
- FunASR is a toolkit; capabilities depend on the selected model and runtime.
- SenseVoiceSmall supports Chinese, Cantonese, English, Japanese, and Korean, plus speech-event and emotion tags. Its model card links the applicable model license.
- Fun-ASR-Nano-2512 is a separate model with Apache-2.0 weights.
- The FunASR and SenseVoice repository source code is MIT. Model weights must be evaluated under each model card license.
Performance should be documented for the exact checkpoint, hardware, dtype, audio set, and concurrency used; this issue intentionally makes no universal speed or language-count claim.
Example request
curl -X POST "${TRANSCRIPTION_BASE_URL}/v1/audio/transcriptions" \
-H "Authorization: Bearer ${TRANSCRIPTION_API_KEY}" \
-F "file=@voice.webm" \
-F "model=${TRANSCRIPTION_MODEL}"
The requested product change is therefore a configurable compatible endpoint, not a FunASR-only runtime embedded in NextChat.
Implementation Status: 2026-09-22
PR #6860 is open at 4fd2ab76508367bba254b5dda307fe36f0538264 and has not completed the requirements above. In particular, the proposed server-held credential boundary remains a requirement: the current implementation stores the optional token in the client's persisted access store and sends it, along with the configured endpoint, from the browser to a same-origin proxy. A same-origin URL does not mean server-only credentials. Earlier PR comments implying otherwise were inaccurate.
The web service endpoint must be reachable from the NextChat server/container; web-mode localhost does not refer to a remote browser user's machine. Desktop requests use the desktop device's network context.
Fresh focused tests pass (4 suites, 19 tests), but an additional injected-recorder probe reproduces missing stream-track cleanup when recording terminates before the caller invokes stop(). The PR body records these open gaps and clearly separates historical builds from current evidence. No fix, merge, or release is claimed; this issue remains open.
Goal
Let NextChat voice input use a self-hosted FunASR/SenseVoice transcription service without bundling a Python or model runtime into the NextChat application.
Proposed first milestone
Reuse the OpenAI-compatible multipart contract:
The initial integration should:
{ "text": "..." }response;funasrPython package.This contract can point to a local FunASR deployment while remaining useful for other self-hosted transcription servers.
Capability and license scope
Performance should be documented for the exact checkpoint, hardware, dtype, audio set, and concurrency used; this issue intentionally makes no universal speed or language-count claim.
Example request
The requested product change is therefore a configurable compatible endpoint, not a FunASR-only runtime embedded in NextChat.
Implementation Status: 2026-09-22
PR #6860 is open at
4fd2ab76508367bba254b5dda307fe36f0538264and has not completed the requirements above. In particular, the proposed server-held credential boundary remains a requirement: the current implementation stores the optional token in the client's persisted access store and sends it, along with the configured endpoint, from the browser to a same-origin proxy. A same-origin URL does not mean server-only credentials. Earlier PR comments implying otherwise were inaccurate.The web service endpoint must be reachable from the NextChat server/container; web-mode
localhostdoes not refer to a remote browser user's machine. Desktop requests use the desktop device's network context.Fresh focused tests pass (4 suites, 19 tests), but an additional injected-recorder probe reproduces missing stream-track cleanup when recording terminates before the caller invokes
stop(). The PR body records these open gaps and clearly separates historical builds from current evidence. No fix, merge, or release is claimed; this issue remains open.