Xiaozhi AI
An open-source AI voice assistant you build on a cheap ESP32 board: talk to it like a smart speaker, and choose which AI model answers.
01 · Introduction
What Xiaozhi AI is
Xiaozhi AI (小智 AI, "little smart") is an open-source project that turns an ESP32 board into a talking AI assistant. You say "你好小智" (or a wake word you choose), ask a question, and it answers out loud.
It has two halves:
- The firmware (xiaozhi-esp32) runs on the board. It wakes up when it hears the wake word, records your voice, sends it over Wi-Fi, and plays back the answer.
- The server does the thinking. It turns your voice into text (ASR, speech recognition), asks a language model for an answer (LLM), and turns the answer into speech (TTS, text to speech).
You can use the free public server the project provides, or run your own with xiaozhi-esp32-server. Your own server lets you pick every part: which speech recognition, which voice, and which AI model answers.
02 · When to use it
When it fits
- A desk or bedside assistant that answers questions, tells the weather, sets reminders and plays music.
- A toy or companion for kids, with a custom character, voice and rules about what it will talk about.
- A voice remote for your smart home, when the server is connected to Home Assistant.
- Learning how voice AI works: every stage (wake word, speech recognition, model, speech synthesis) is visible and replaceable.
If you just want a smart speaker that works out of the box, a commercial one is simpler. Xiaozhi is for people who want to choose and change the parts.
03 · Setup
How to set it up
- Get a supported board. The firmware repository lists the boards it supports. Ones with a microphone, speaker and screen on board need no wiring.
- Flash the firmware. Use the project's web flasher or the release files for your exact board.
- Connect it to Wi-Fi. On first boot it opens a hotspot. Join it from your phone and enter your Wi-Fi details.
- Bind it. By default the board talks to the official public server. It reads out a code; enter it in the console website to bind the board to your account. There you choose the character, voice and model.
- Optional: run your own server. Deploy xiaozhi-esp32-server on a computer at home (from source or with Docker), then point the board's OTA address at it, for example
http://<your computer's IP>:8003/xiaozhi/ota/. From then on the board uses your server.
04 · How to use it
Day-to-day use
- Talk to it. Say the wake word, then speak normally. Follow-up questions keep the context of the conversation.
- Tools. The server can let the model call functions: check the weather, play music, read the news, control devices. In the server config this is the
function_callintent plus a list of plugins. - Change the model. On your own server, the LLM is one line in
data/.config.yaml. You can switch between cloud APIs, a local model, or even the Claude and Codex command-line tools you are already signed in to. - Read the logs. When an answer is wrong or slow, the server log shows what was heard, what the model returned and how long each step took.
05 · Pitfalls
Things to watch out for
- Every answer goes over the network to whichever server you use. On the public server, your voice and questions pass through someone else's machines.
- Latency adds up. Speech recognition, the model and speech synthesis each take time. Short answers and a fast model keep it feeling natural.
- Keep the character prompt short and spoken. Ask for one or two sentences. Long, formatted answers sound bad read aloud.
- Firmware must match the board. Flashing a build for another board can leave the screen or audio dead. Reflash the right one to fix it.
06 · Resources
