Skip to main content

Aliyun plugin for LiveKit Agents

Realtime speech-to-text, text-to-speech, and LLM support for LiveKit Agents using Aliyun DashScope.

The plugin exposes:

  • livekit.plugins.aliyun.STT
  • livekit.plugins.aliyun.TTS
  • livekit.plugins.aliyun.LLM

Installation

pip install livekit-plugins-alicloud

Pre-requisites

You'll need an API key from Aliyun. It can be set as an environment variable: DASHSCOPE_API_KEY

Quick Start

from dotenv import load_dotenv

from livekit.agents import Agent, AgentSession
from livekit.plugins import aliyun

load_dotenv()

session = AgentSession(
    llm=aliyun.LLM(),
    stt=aliyun.STT(),
    tts=aliyun.TTS(),
)

agent = Agent(instructions="Reply briefly and clearly.")

LLM

Common Options

from livekit.plugins import aliyun

llm = aliyun.LLM(
    model="qwen-plus",
    enable_thinking=False,
)
  • api_key: DashScope API key. Overrides the environment variable.
  • model: DashScope OpenAI-compatible chat model name. Defaults to qwen-plus.
  • base_url: Override the OpenAI-compatible endpoint. Defaults to https://dashscope.aliyuncs.com/compatible-mode/v1.
  • enable_thinking: Whether to enable Qwen deep-thinking mode. Defaults to False.
  • thinking_budget: Optional token budget for thinking mode. Requires enable_thinking=True.
  • max_tokens: Optional maximum output token count.
  • seed: Optional deterministic sampling seed.
  • tool_choice: Supports auto, none, and forcing a specific function tool. The required option is not supported.
  • preserve_thinking: Not supported in this version. Reasoning content is not persisted or returned as ordinary text.

STT

Common Options

from livekit.plugins import aliyun

stt = aliyun.STT(
    model="qwen3-asr-flash-realtime",
    language="zh",
    sample_rate=16000,
    interim_results=True,
)
  • api_key: DashScope API key. Overrides the environment variable.
  • model: Realtime ASR model name.
  • language: Optional language code such as zh, yue, or en.
  • sample_rate: Input sample rate. Typical value is 16000.
  • interim_results: Whether to emit interim transcripts.
  • turn_detection: Server-side VAD settings. Set it to None to use manual mode.

Manual Mode

To disable server-side turn detection and use manual mode:

from livekit.plugins import aliyun

stt = aliyun.STT(turn_detection=None)

TTS

Common Options

from livekit.plugins import aliyun

tts = aliyun.TTS(
    model="qwen3-tts-flash-realtime",
    voice="Cherry",
    language_type="Chinese",
)
  • api_key: DashScope API key. Overrides the environment variable.
  • model: Realtime TTS model name.
  • voice: Realtime TTS voice name.
  • language_type: One of Auto, Chinese, English, German, Italian, Portuguese, Spanish, Japanese, Korean, French, or Russian.
  • base_url: Override the websocket endpoint. For the international region, use wss://dashscope-intl.aliyuncs.com/api-ws/v1/realtime.

Metadata

Release files for livekit-plugins-alicloud 1.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livekit-plugins-alicloud 1.6.2
File Size Uploaded
livekit_plugins_alicloud-1.6.2.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-alicloud 1.6.2
File Interpreter ABI Platform
livekit_plugins_alicloud-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / livekit_plugins_alicloud-1.6.2.tar.gz

Download URL livekit_plugins_alicloud-1.6.2.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3772694cea707a5d5b884d1b46cdcba2c96d02963479bd574cb8d477e1c637dc
BLAKE2b-256 checksum
How to use checksums
11404b17f30101d77b92e4283ce5dd3fb9d13eae52c452645825d154364db27e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / livekit_plugins_alicloud-1.6.2-py3-none-any.whl

Download URL livekit_plugins_alicloud-1.6.2-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1213216895161e09edadf96ba37419d4c1d055f5a2ebdb106e1e3b3724942406
BLAKE2b-256 checksum
How to use checksums
544d145a31fb7a7fa2b90d2acbe3cc72b7bad1c90314eb5037f0b5f84dcc38d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page