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.STTlivekit.plugins.aliyun.TTSlivekit.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 toqwen-plus.base_url: Override the OpenAI-compatible endpoint. Defaults tohttps://dashscope.aliyuncs.com/compatible-mode/v1.enable_thinking: Whether to enable Qwen deep-thinking mode. Defaults toFalse.thinking_budget: Optional token budget for thinking mode. Requiresenable_thinking=True.max_tokens: Optional maximum output token count.seed: Optional deterministic sampling seed.tool_choice: Supportsauto,none, and forcing a specific function tool. Therequiredoption 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 aszh,yue, oren.sample_rate: Input sample rate. Typical value is16000.interim_results: Whether to emit interim transcripts.turn_detection: Server-side VAD settings. Set it toNoneto 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 ofAuto,Chinese,English,German,Italian,Portuguese,Spanish,Japanese,Korean,French, orRussian.base_url: Override the websocket endpoint. For the international region, usewss://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)
| File | Size | Uploaded | |
|---|---|---|---|
| livekit_plugins_alicloud-1.6.2.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|