Open-source project
xinnan-tech/xiaozhi-esp32-server avatar
xinnan-tech/xiaozhi-esp32-server

xiaozhi-esp32-server: A Backend for ESP32 Voice Devices, with Trade-Offs

xiaozhi-esp32 ESP32 Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.

10,571 stars3,607 forksJavaScriptMIT

At a glance

What is it?
xiaozhi-esp32-server is a JavaScript backend that turns ESP32 hardware into voice-controlled assistants. It supports MQTT+UDP, WebSocket, voiceprint recognition, and knowledge bases, but the README warns it is not production-ready and lacks security testing.
Who is it for?
Adopt xiaozhi-esp32-server if you already own ESP32 hardware, have successfully connected to the public xiaozhi backend, and want to run your own server for learning or personal use. Avoid it for any production or public-facing deployment, as the README explicitly states it has not passed network security testing and is incomplete.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 14, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What This Backend Actually Does

The project solves a specific problem: it provides a self-hosted server for the open-source xiaozhi-esp32 hardware project. If you have an ESP32-based voice assistant device, this backend handles the heavy lifting of speech recognition, language model inference, speech synthesis, and device control. The target user is someone who has already used the public xiaozhi backend and now wants to run their own instance. The README is clear that this is not for beginners without ESP32 experience. It is for hobbyists and tinkerers who want independence from a hosted service. The backend is written in JavaScript, though the README mentions Python and Java components in the overall system, so the repository is part of a larger multi-language stack.

Architecture: MQTT, UDP, WebSocket, and More

The core architecture, according to the README, is built around an MQTT+UDP gateway, a WebSocket server, and an HTTP server. The MQTT protocol is used for command dispatch from a control console to ESP32 devices. WebSocket handles real-time audio streaming for voice interaction. UDP is likely used for low-latency device communication, though the README does not detail the exact packet formats. The system also includes a management console with authentication. The data flow is roughly: audio from the ESP32 goes through WebSocket to the server, which runs ASR (speech recognition), sends the text to an LLM, gets a response, runs TTS (speech synthesis), and streams audio back. Voiceprint recognition runs in parallel with ASR to identify the speaker, and that identity is passed to the LLM for personalized responses. This is a modular design where each component (ASR, LLM, VLLM, TTS) can be swapped via configuration.

Deployment Paths: Docker and Source, Minimal and Full

The README offers two deployment modes. The minimal installation supports single-agent dialogue and stores data in configuration files, no database needed. This suits low-resource environments: 2 cores and 2GB RAM if you use all API-based services, or 2 cores and 4GB if you run FunASR locally. The full module installation adds multi-user management, multi-agent management, and a control console UI, with data stored in a database. That requires 2 cores and 4GB for all-API, or 4 cores and 8GB with local FunASR. Both modes have Docker and source-code deployment options. The README points to specific deployment documents: docs/Deployment.md for minimal, docs/Deployment_all.md for full. There is also a dev-ops-integration.md for auto-update source deployment. No actual commands are listed in the README, so you must consult those docs for the exact docker run or npm start commands.

Configuration: Free vs. Streaming, and the 2.5-Second Claim

Configuration is where the project shows its flexibility. The README describes two configuration profiles. The 'entry-level all-free' setup uses local FunASR for speech recognition, glm-4-flash for the LLM, EdgeTTS for speech synthesis, and local short-term memory. The 'streaming' setup uses XunfeiStreamASR, qwen-flash, HuoshanDoubleStreamTTS, and the same memory. Since version 0.5.2, the streaming configuration improves response speed by about 2.5 seconds compared to earlier versions. That number comes from the README, not from independent testing, so treat it as a vendor claim. The choice between local and API-based components is a trade-off: local models like FunASR require more CPU and RAM but no per-request cost, while API services are faster but require keys and may charge money. The README also warns that the project has no business relationship with any third-party API provider and does not guarantee their service quality or financial safety.

Tools and Testing: Performance Tester and Audio Test

To help users verify components, the project includes two testing tools. The audio interaction test tool is located at main/digital-human/index.html. The README instructs you to run 'python start.py' in the main/digital-human directory, then access http://127.0.0.1:8006/index.html to test audio playback and reception. The model response test tool is at main/xiaozhi-server/performance_tester.py, run with 'python performance_tester.py'. This tests the response speed of ASR, LLM, VLLM, and TTS modules. The README notes that only models with configured keys are tested. These tools are useful for benchmarking your own setup, but they are not automated integration tests. The README also links to an external performance research repository, suggesting that the team cares about measurable latency, but you should run the tools in your own environment to get relevant numbers.

Limitations: Not Production-Ready, and the Hardware Dependency

The most significant limitation is stated plainly in the README: the project is not fully functional and has not passed network security assessment. It explicitly says not to use it in a production environment. If you deploy it on the public internet for learning, you must take necessary protective measures. This is a serious caveat. The project is also useless without ESP32 hardware; it is not a standalone voice assistant server. Another limitation is the concurrency: the README mentions a test platform with a concurrency of 6, which implies the server is not designed for high load. The configuration complexity is also a barrier. You need to obtain API keys for ASR, LLM, and TTS providers, and the README warns about the financial risk of using third-party services. If a provider changes its API or pricing, your setup may break. The project is under active development, with releases every few weeks, so you should expect frequent changes and potential breaking changes between versions.

Alternative: The Public xiaozhi Backend

The primary alternative is the public backend service that the project itself is designed to replace. The README mentions '虾哥部署的后端服务' (the backend deployed by Xia Ge), which is the hosted service for xiaozhi-esp32. The difference in approach is fundamental: the public service is a managed, ready-to-use endpoint, while this project is a self-hosted codebase that you must deploy, configure, and maintain. The public service likely handles scaling, security, and updates for you, but it gives you no control over data or customization. This project offers full control and the ability to integrate custom models or knowledge bases, but it shifts all operational burden to you. If you just want a working voice assistant, the public service is the simpler choice. If you want to experiment with different ASR/LLM/TTS providers or build a custom device fleet, this backend is the path, provided you accept the security and maintenance risks.

Maintenance and License Implications

The project is licensed under MIT, which is permissive. You can use, modify, and distribute it, even in commercial products, as long as you retain the copyright notice. There are no copyleft obligations. However, the license does not cover the third-party services you connect to; those are separate agreements. The maintenance cost is real. The README shows a release cadence of roughly one minor version per month (v0.9.4 in June, v0.9.5 in June, v0.9.6 in July 2026). That means frequent updates, which is good for bug fixes but requires you to track changes. The README includes a FAQ document and a dev-ops-integration guide for auto-updating source deployments, indicating that the team expects users to upgrade regularly. You should budget time for reading release notes and testing after each update. The project also references a separate performance research repository, suggesting that performance tuning is an ongoing concern. Before relying on this server, verify that your ESP32 firmware version is compatible with the current backend protocol, and check the FAQ for known issues.

Editorial conclusion

Adopt xiaozhi-esp32-server if you already own ESP32 hardware, have successfully connected to the public xiaozhi backend, and want to run your own server for learning or personal use. Avoid it for any production or public-facing deployment, as the README explicitly states it has not passed network security testing and is incomplete. Before adopting, verify the exact communication protocol version your ESP32 firmware uses, confirm the selected ASR/LLM/TTS providers are still available and within your budget, and check the latest release notes for breaking changes. The project is actively maintained with recent releases, but its own warning about production readiness is the decisive boundary.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes