feat(services/qwen): add Qwen3STTService for local speech-to-text - #5723
Open
RoKenobi wants to merge 4 commits into
Open
feat(services/qwen): add Qwen3STTService for local speech-to-text#5723RoKenobi wants to merge 4 commits into
RoKenobi wants to merge 4 commits into
Conversation
Adds Qwen3STTService, a SegmentedSTTService backed by the Qwen3-ASR model family (0.6B / 1.7B / 8B). The service loads the model once at construction via the qwen-asr package and transcribes VAD-segmented 16 kHz PCM in an asyncio thread, following the same patterns as FunASRSTTService and WhisperSTTService. qwen-asr is excluded from the docs environment alongside the other heavy ML extras: it depends on torch, which conf.py already mocks.
qwen-asr depends on accelerate==1.12.0, while the moondream extra constrains accelerate to ~=1.10.0. uv resolves one universal lockfile across every extra, so the two pins are unsatisfiable together and `uv lock` fails outright - regardless of which extras a given install selects. Neither extra needs the other: a local Qwen3-ASR model and Moondream vision are not run in the same environment. Declaring the pair conflicting lets uv resolve them in separate forks and produce a universal lock, and makes activating both together an explicit error at install time rather than a resolution failure for everyone.
The qwen-asr extra is excluded from the docs environment, so autodoc cannot import pipecat.services.qwen.stt and the module's page would be skipped. Mock the package the same way funasr and pocket_tts are; torch, its other import, is already mocked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
Qwen3STTService— a local speech-to-text service backed by the Qwen3-ASR model family via theqwen-asrpackage.SegmentedSTTService, followingFunASRSTTService/WhisperSTTService/MoonshineSTTServiceQwen/Qwen3-ASR-0.6B,Qwen/Qwen3-ASR-1.7B(default),Qwen/Qwen3-ASR-8Btorch.bfloat16; transcription dispatched withasyncio.to_threadqwen-asr, following the FunASR/Moonshine test patternsReplaces #5415, which was opened against a three-week-old
mainand had drifted far enough that rebasing in place was messier than starting clean.Packaging: conflicting extras
qwen-asrdepends onaccelerate==1.12.0, while themoondreamextra constrains the same package to~=1.10.0. uv resolves a single universal lockfile across all extras, so the two pins are unsatisfiable together anduv lockfails outright — regardless of which extras a given install actually selects. That is what broke the docs build on #5415.Since nobody runs a local Qwen3-ASR model and Moondream vision in one environment, the two are declared conflicting:
uv then resolves them in separate forks, and activating both together becomes an explicit install-time error rather than a resolution failure for everyone.
qwen-asris also excluded indocs/api/install-deps.shalongside the other heavy ML extras (it pulls in torch), andqwen_asris added toautodoc_mock_importsso the service's API page still generates.Usage
Install:
uv add "pipecat-ai[qwen-asr]"Not done here
uv.lockis not regenerated — this branch carriesmain's lockfile, which predates theqwen-asrextra. Read the Docs re-resolves duringuv sync, so the docs build exercises theconflictschange, butuv lockhas not been run against it directly.Test plan
run_stttranscription, missing-model error, inference-exception error, empty-transcript skipuv lockregenerated and committedNotes
qwen/llm.pyorqwen/__init__.py; theqwen = []extra (DashScope LLM) is untouched andqwen-asris separateQwen3ASRModelacross pipeline sessions.