Skip to main content

Modules required for conversation, released as a Python SDK.

Project description

respeak

Provides the modules required for conversation and is released as a Python SDK.

Install

pip install respeak

# local development
pip install -e .

Optional extras:

pip install "respeak[vad]"
pip install "respeak[tts]"
pip install "respeak[llm]"
pip install "respeak[dev]"

Usage

from respeak import StreamingParaformerAsr, CosyVoice3Tts, SileroVad, Qwen3LLM

# ASR
asr = StreamingParaformerAsr.from_pretrained(asr="path/or/model_id", punc_model="path/or/model_id")
text = asr.generate(input=audio_chunk, is_final=False, cache={})

# CosyVoice3 TTS (vLLM)
tts = CosyVoice3Tts.from_pretrained(
    model_dir="path/to/TTS_Model",
    prompt_text="...",
    prompt_wav="path/to/prompt.wav",
    load_vllm=True,
)
for wav in tts.generate("你好,欢迎使用本系统。", stream=True):
    ...

# VAD
vad = SileroVad.from_pretrained()
speech_prob = vad.generate(audio_chunk)

# LLM sentence-level streaming
llm = Qwen3LLM.from_pretrained(
    "path/to/LLM_Model_ft",
    base_prompt_file="path/to/base_prompt.md",
    persona_setting="你叫小睿,是一个温和的中文助手。",
    strategy_prompt="回答要简洁自然。",
)
for sentence in llm.generate("你好,介绍一下你自己。", stream=True):
    ...

New model types should live under src/respeak/models/<name>/ (subclass BaseModel, expose from_pretrained / generate). Add matching tests under tests/models/<name>/.

Examples

# ASR
python examples/paraformer_asr_streaming.py \
  --asr path/to/ASR_Model \
  --punc path/to/PUNC_Model \
  --audio path/to/test.wav

# TTS (requires .[tts])
python examples/cosyvoice3_tts_streaming.py \
  --model-dir path/to/Fun-CosyVoice3 \
  --prompt-wav path/to/prompt.wav \
  --prompt-text "..." \
  --text "你好,欢迎使用本系统。" \
  --output output.wav

# VAD (requires .[vad])
python examples/silerovad_real_inference.py \
  --audio path/to/test.wav \
  --threshold 0.5

# LLM (requires .[llm])
python examples/qwen3_llm_streaming.py \
  --model-path path/to/LLM_Model_ft \
  --base-prompt path/to/base_prompt.md \
  --text "你好,介绍一下你自己。"

Tests

pip install -e ".[dev]"
pytest tests/models -q

Publish to PyPI

CI runs on every push/PR to main. Publishing is triggered by pushing a version tag.

One-time PyPI setup

  1. Create a project on PyPI named respeak.
  2. In PyPI → PublishingAdd a new pending publisher:
    • Owner: shanguanma
    • Repository: respeak
    • Workflow: publish-pypi.yml
    • Environment: pypi

Release flow

# 1. Bump version in pyproject.toml
# 2. Commit and tag
git tag v0.1.1
git push origin main
git push origin v0.1.1

The tag must match pyproject.toml (v0.1.1version = "0.1.1").

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respeak_ai-0.1.3.tar.gz (235.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

respeak_ai-0.1.3-py3-none-any.whl (255.3 kB view details)

Uploaded Python 3

File details

Details for the file respeak_ai-0.1.3.tar.gz.

File metadata

  • Download URL: respeak_ai-0.1.3.tar.gz
  • Upload date:
  • Size: 235.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for respeak_ai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a3c074259845f3bb84fd53d95eccea9b9dd6cf6e541de3f8107b5d52eae43952
MD5 234032c09c9bf771baf67234ea026297
BLAKE2b-256 7f124f93cd7a60a1e7d9c997792ee60ec937313984c9bc8b6dd26f38a527d5de

See more details on using hashes here.

Provenance

The following attestation bundles were made for respeak_ai-0.1.3.tar.gz:

Publisher: publish-pypi.yml on shanguanma/respeak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file respeak_ai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: respeak_ai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 255.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for respeak_ai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0949d2bb029487445a5e4f32d3fa4c862f0d8cb754795daa1feeff56df025086
MD5 29655e02150fe7d8310ba93c50d84dd2
BLAKE2b-256 0365244dda4aa9e7d3af2d327ac301f16614f11a13113ca6f1245aa282a4e4ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for respeak_ai-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on shanguanma/respeak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page