Skip to content
HardwareLab

py-xiaozhi

py-xiaozhi is a lightweight, cross-platform multi-modal AI interaction framework built on Python’s async architecture.

Hardware:
PC or Raspberry Pi, mic/speaker
Difficulty:
Beginner · Our suggestion
License:
MIT
Creator:
huangjunsen0406

Python XiaoZhi client for Windows, macOS, Linux and ARM boards

py-xiaozhi
No photo in the source; GitHub repository card, served from HardwareLab.The README’s demo video is on Bilibili; we only embed YouTube, X, Reddit or Vimeo.

By huangjunsen0406

Posted

What it does

py-xiaozhi is a lightweight, cross-platform multi-modal AI interaction framework built on Python’s async architecture. It supports real-time voice streaming, vision-language tasks and IoT device control, on Windows, macOS and Linux desktops and ARM embedded platforms (Raspberry Pi, Horizon Robotics RDK, Jetson Nano).

  • Real-time voice AI: Opus codec with auto frame detection, async streaming, sub-20ms latency.
  • Camera capture plus vision-language model integration for image understanding and scene perception.
  • A modular JSON-RPC 2.0 MCP tool server: music player, camera, screenshot, app management, weather, volume control.
  • Offline wake word: Sherpa-ONNX on-device keyword spotting with custom wake word support.
  • A GPIO interface for robotics control, hardware actuation and sensor integration.

What you need

Difficulty
Beginner · Our suggestion
License
MIT (source)

Parts

  • Computer: Windows 10+ / macOS 10.15+ / Linux (x86_64 & ARM)
  • Microphone and speaker devices
  • Camera device [optional]
AI model or service
Sherpa-ONNX offline wake word, vision-language model integration, MCP tool server

Prices, notes and sources: Parts and requirements

Parts and requirements

PartSpec / notesNeededPrice
Computer: Windows 10+ / macOS 10.15+ / Linux (x86_64 & ARM) Optimized for Raspberry Pi and edge boardsRequired
Microphone and speaker devices Required
Camera device For camera features, with OpenCV supportOptional
  • Computer for setup: Python 3.10 - 3.12 on Windows 10+, macOS 10.15+ or Linux; at least 4GB RAM (8GB+ recommended)
  • A stable internet connection (for AI services and online features)

Full build guide

Steps

Difficulty
Beginner · Our suggestion
  1. Clone the project
  2. uv sync (add --extra gui for the GUI)
  3. python main.py, or python main.py --mode cli

Full instructions: View original

See it working

How it works

A Python app in GUI, CLI or GPIO mode handles real-time voice with the Opus codec, talks over WebSocket or MQTT, spots an offline wake word with Sherpa-ONNX and exposes MCP tools through a JSON-RPC 2.0 tool server.

LayerComponentRuns on
Clientpy-xiaozhi (PySide6 + QML GUI / CLI / GPIO) Windows, macOS, Linux desktops, and ARM embedded platforms (Raspberry Pi, Horizon Robotics RDK, Jetson Nano)
Wake wordSherpa-ONNX keyword spotting On-device

Setup effort

Clone the repo, install with uv (or pip), then run main.py in GUI or CLI mode.

Limits and caveats

  • Needs a stable internet connection (for AI services and online features).
  • Manually reinstall pip dependencies after each update to get new dependencies.

Like this build? Get the weekly builds

Every Thursday: the 5 best gadget hacks you can copy. Free.

Built something? Submit a build

The creator's config

Copied word for word from the creator's repository, at the commit linked in each source.

  • Run modes and protocol

    # Run program - GUI mode (default; requires gui extra)
    python main.py
    
    # Run program - CLI mode (base install is enough)
    python main.py --mode cli
    
    # Specify communication protocol
    python main.py --protocol websocket  # WebSocket (default)
    python main.py --protocol mqtt       # MQTT protocol

Use-case ideas

  • Robotics control, hardware actuation and sensor integration over GPIO.

Why it's interesting

py-xiaozhi is a lightweight, cross-platform multi-modal AI interaction framework built on Python’s async architecture, and it evolved from the xiaozhi-esp32 firmware project. The README says it is deployable across Windows, macOS and Linux desktops and ARM embedded platforms such as the Raspberry Pi, Horizon Robotics RDK and Jetson Nano. Voice uses the Opus codec with async streaming, a camera can feed a vision-language model for image understanding, and a modular JSON-RPC 2.0 MCP tool server covers a music player, camera, screenshots, app management, weather and volume control. It runs as a PySide6 + QML GUI, a CLI or a GPIO interface, with Sherpa-ONNX on-device keyword spotting for an offline wake word. D-Robotics (xiaozhi-in-rdk) officially adopted it as an upstream dependency, and there is a separate Electron desktop client, xiaozhi-desktop, with AEC echo cancellation. The original XiaoZhi ESP32 firmware is also on HardwareLab.

Source: github.com/huangjunsen0406/py-xiaozhi#readme

Hardware

  • PC or Raspberry Pi
  • mic/speaker

More Raspberry Pi builds

Credits and links

This page is a short summary written by HardwareLab. Build steps, code and photos belong to the creator; follow “View original” for the full project.

Featured? Add this badge

Built this? Paste the badge into your README. It links back to this page.

Featured on HardwareLab

Markdown

[![Featured on HardwareLab](https://hardwarelab.dev/badge.svg)](https://hardwarelab.dev/projects/py-xiaozhi/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w)

HTML

<a href="https://hardwarelab.dev/projects/py-xiaozhi/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w"><img src="https://hardwarelab.dev/badge.svg" alt="Featured on HardwareLab" width="188" height="20"></a>