# XiaoZhi AI Chatbot

Firmware for building a voice-controlled AI chatbot on ESP32 hardware, using large language models for conversation and the Model Context Protocol for both device-side and cloud-side tool control.

The firmware turns a supported ESP32 board into a voice assistant: it wakes on a customizable wake word using on-device offline detection, streams Opus-encoded audio through a pipeline of speech recognition, a language model such as Qwen or DeepSeek, and text-to-speech, or uses a realtime end-to-end voice model on hardware with echo cancellation for full-duplex conversation. It supports speaker recognition to identify who is talking, and connects over Wi-Fi, wired Ethernet, USB RNDIS or 4G modules, with 39 interface languages.

Device-side MCP lets the chatbot control local peripherals such as a speaker, LED, servo or GPIO pin, while cloud-side MCP extends it with capabilities like smart-home control, PC desktop operation, knowledge search and email. It supports 138 board directories and 171 release variants across the ESP32, ESP32-C3/C5/C6, ESP32-S3 and ESP32-P4 chip families, and its firmware connects by default to an official server offering free access to a realtime model for personal use.

It is written in C++ and licensed under the MIT license.

Website: https://xiaozhi.me
