Introduction
"Let your XiaoAI speaker hear your voice, and unlock unlimited possibilities."
This is article #233 in the "One Open Source Project a Day" series. Today's project is Open-XiaoAI — an open-source project that takes direct control of Xiaomi's smart speaker hardware, 2,611 Stars, MIT license, by idootop (Del Wang).
Heads up: this project is archived and no longer maintained. It's still worth reading — it shows a complete engineering approach to "the manufacturer didn't give you this capability, so build it yourself," which is a useful pattern for anyone looking to hack consumer electronics.
XiaoAI speakers have sold tens of millions of units, but their functionality is locked into a fixed "command-response" loop by the manufacturer — they hear decibels but not emotion, execute commands but never think proactively. Open-XiaoAI's approach is blunt: flash custom firmware, SSH in, take direct control of the speaker's microphone input and speaker output, and forward what used to go to Xiaomi's cloud for speech recognition and dialogue logic to your own computer or server, where any large model can handle it instead.
What You'll Learn
- Open-XiaoAI's client-server architecture: the speaker only runs a "forwarder"
- Why business logic lives on the server, not the speaker itself
- Four official demos: Xiaozhi AI, custom wake words, MiGPT, Gemini Live
- The full flashing/SSH/cross-compile deployment flow
- The security boundaries and risks of this kind of hardware mod
Prerequisites
- A Xiaomi XiaoAI Speaker Pro (LX06) or Xiaomi Smart Speaker Pro (OH2P) — these models only
- Basic Linux/SSH experience
- Familiarity with Rust and/or Python/Node.js helps
Project Background
Overview
This isn't the author's first speaker hack. Their earlier project MiGPT already wired ChatGPT into the XiaoAI speaker — but that approach still relied on Xiaomi's native speech-recognition pipeline. Open-XiaoAI goes further: it takes direct control of the speaker's "ears" and "mouth," completely bypassing Xiaomi's cloud and handing full control of audio input/output over to the user.
Author / Team
- Author: idootop (Del Wang)
- Primary language: Rust (client-side patch) + Python / Node.js (server-side examples)
- License: MIT License
- Created: 2025-04-07
- Status: ⚠️ Archived, no longer maintained
Project Stats
- ⭐ GitHub Stars: 2,611+
- 🍴 Forks: 447+
- 📄 License: MIT
- 📅 Created: 2025-04-07
- 🎯 Supported devices: Only XiaoAI Speaker Pro (LX06), Xiaomi Smart Speaker Pro (OH2P)
Core Architecture: Client Forwards, Server Decides
Open-XiaoAI has two clearly separated halves:
The Client (runs on the speaker, written in Rust)
The client is a patch binary flashed into the speaker's firmware. It only forwards and passively responds — it implements zero business logic:
- Maintains a real-time bidirectional connection with the server (WebSocket)
- Forwards the microphone's captured audio stream to the server
- Forwards speaker-side events (speech recognition results, playback state, etc.) to the server
- Executes commands sent from the server (run a script, play an audio stream, perform a system upgrade, etc.)
Why doesn't business logic live on the speaker? The project's own docs are refreshingly honest: the speaker's memory, compute, and storage are extremely limited — speech recognition simply doesn't fit. And writing complex business logic in Rust is far less productive than Python/Node.js, which also have richer AI ecosystems.
The Server (runs on your computer/server, any language)
The real "brain" lives entirely on the server side — you can use Python, Node.js, hook up any LLM or agent framework, and decide how the speaker should respond. The Rust client exposes bindings that let Python/Node.js call into it bidirectionally, reusing the same networking module. If you'd rather write your server in another language, you can reimplement the WebSocket protocol yourself by reading the Rust client's source.
XiaoAI speaker (flashed) Your computer/server
┌─────────────────────┐ ┌──────────────────────┐
│ Rust client (forwarder) │ WebSocket │ Server (any language) │
│ - Mic audio stream │ ◄──────► │ - Speech recog/VAD/wake word│
│ - Speaker playback │ │ - LLM/agent dialogue logic │
│ - System events │ │ - Custom business logic │
└─────────────────────┘ └──────────────────────┘Four Official Demos
The examples/ directory ships four runnable demos, each a distinct integration path:
1. Xiaozhi AI integration (Python, examples/xiaozhi)
Hooks the speaker up to Xiaozhi AI, with continuous conversation, mid-sentence interruption, and custom wake words in Chinese or English. Under the hood it uses py-xiaozhi's speech pipeline, paired with VAD (voice activity detection) and KWS (keyword spotting) models.
docker run -it --rm -p 4399:4399 \
-v $(pwd)/config.py:/app/config.py \
idootop/open-xiaoai-xiaozhi:latestCustom wake words are configured directly:
APP_CONFIG = {
"wakeup": {
"keywords": ["豆包豆包", "你好小智", "hi siri"],
},
"xiaozhi": {
"OTA_URL": "https://api.tenclass.net/xiaozhi/ota/",
"WEBSOCKET_URL": "wss://api.tenclass.net/xiaozhi/v1/",
},
}2. Custom wake words (standalone demo)
Shows how to replace "Hey XiaoAI" with any wake word you choose — your speaker no longer has to be called "XiaoAI" at all.
3. MiGPT "perfect edition" (Node.js, examples/migpt)
Compared to the original MiGPT project, this version can perfectly interrupt the speaker's response with lower latency. Configuration is minimal — just plug in any OpenAI-compatible API:
export const kOpenXiaoAIConfig = {
openai: {
model: "gpt-4.1-mini",
baseURL: "https://api.openai.com/v1",
apiKey: "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
prompt: {
system: "You are a helpful assistant. Answer the user's question.",
},
};4. Gemini Live API integration
Shows how to wire the speaker into Google's Gemini Live multimodal real-time dialogue API for more natural voice interaction.
There's also a stereo pairing demo that lets two speakers (even different models) run as a stereo pair.
Quick Start: From Flashing to Running a Demo
[!IMPORTANT] This guide is only for the XiaoAI Speaker Pro (LX06) and Xiaomi Smart Speaker Pro (OH2P). Do not attempt this on other models.
The full flow has three steps:
Step 1: Flash + SSH
Follow the flashing guide to flash patched firmware onto the speaker, enable SSH, and connect to it. This step involves hardware-level modification and carries real risk — proceed carefully if you're unfamiliar with the process.
Step 2: Install the client on the speaker
# Create the working directory on the speaker
mkdir /data/open-xiaoai
# Set the server address (replace with your own computer's LAN IP)
echo 'ws://192.168.31.227:4399' > /data/open-xiaoai/server.txt
# Download and run the client
curl -sSfL https://gitee.com/idootop/artifacts/releases/download/open-xiaoai-client/init.sh | shTo run it on boot:
curl -L -o /data/init.sh https://gitee.com/idootop/artifacts/releases/download/open-xiaoai-client/boot.sh
rebootStep 3: Run a server-side demo on your computer
Pick any of the four demos above and follow its README.
Want to build the client yourself?
git clone https://github.com/idootop/open-xiaoai.git
cd packages/client-rust
# Cross-compile to ARMv7 (requires `cross`)
cross build --release --target armv7-unknown-linux-gnueabihfCopy the compiled binary straight onto the speaker via dd + ssh:
dd if=target/armv7-unknown-linux-gnueabihf/release/client \
| ssh -o HostKeyAlgorithms=+ssh-rsa root@your-speaker-ip \
"dd of=/data/open-xiaoai/client"Security Boundaries: An Explicit "Proof of Concept"
The project's documentation includes a notably candid risk disclosure, which deserves to be summarized faithfully: this is a basic demo with no multi-device connection management, authentication, encrypted transport, or audio compression. The default "execute arbitrary script" capability demo requires you to specify a trusted server address yourself, but running this over the public internet demands extra caution — the speaker forwards raw microphone audio out to whatever server it's pointed at, and if that server address is tampered with, your home's ambient audio is effectively exposed to an unknown third party.
The project's disclaimer is equally explicit about scope: it's for academic research or personal testing only, not for commercial deployment; it has no affiliation with Xiaomi, is not officially authorized, and all trademarks, firmware, and cloud services remain Xiaomi's property.
Resources
- 🌟 GitHub: idootop/open-xiaoai (archived)
- 📺 Demo videos: Xiaozhi AI integration · Custom wake words · MiGPT integration
- 🔗 Predecessor projects: mi-gpt, migpt-next
- 🔗 Related ecosystem: xiaogpt, xiaomusic
- 📖 Flashing technical references: open-lx01, xiaoai-patch
Summary
Even though Open-XiaoAI is no longer maintained, the engineering approach it leaves behind is still worth learning from: when a hardware vendor locks a device's capabilities into fixed logic, "flash the firmware to take over the low-level hardware interface, then move all intelligence to a server you control" is a workable and relatively restrained way to modify it.
Three things worth noting:
The client's "forward only, no decisions" split is disciplined restraint. Many hardware hacking projects try to cram all logic into the device itself and quickly hit a wall on compute and development productivity. Open-XiaoAI keeps the client as thin as possible — forwarding audio and executing commands — while all AI capability runs server-side, where compute and ecosystem are both stronger. That's a reusable architectural pattern for embedded hacking in general.
Four demos represent four distinct integration philosophies, not one product being sold four ways. Xiaozhi AI leans on the open-source voice-assistant ecosystem, MiGPT plugs straight into an OpenAI-compatible endpoint, Gemini Live uses Google's real-time multimodal API — the project never locks itself to one AI vendor; it demonstrates that once the forwarding layer is solid, anything can sit above it.
Honest risk disclosure is the right posture for a hardware-hacking open-source project. The project repeatedly stresses "for learning only," "don't run this over the public internet," "be careful about security" — it never dresses up a genuinely risky operation as a polished, ready-to-use product. That restraint is worth more to anyone actually planning to try this than flashy marketing copy would be.
If you happen to have an LX06 or OH2P XiaoAI speaker and want to know what it feels like to fully control your own smart speaker, Open-XiaoAI's code and docs remain a complete, readable reference — even though the project itself has stopped shipping updates.
Explore PrimeSkills — a curated marketplace of AI agents and skills, each validated against real enterprise workflows. No hype, just what actually works.
Visit my personal site for more insights and interesting products.