本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Find a file
lapy d51c54f483 fix(tests): make pytest suite runnable from a fresh checkout (CI fix)
PR#2 CI: the Python job failed with 17 FileNotFoundError collection errors.
Widening CI from upstream's smoke-test-only to the full suite exposed that
the suite depends on main/xiaozhi-server/data/.config.yaml, which is
gitignored and therefore absent on CI runners (dev boxes always have it, so
the local rebase gate never caught it).

- add tracked tests/testdata/test-config.yaml (placeholder keys, empty
  manager-api block, same shape as the local stub)
- conftest falls back to it when data/.config.yaml is missing (explicit
  PYTEST_CONFIG_FILE still wins)
- neutralize config.settings/config.logger check_config_file bindings and
  logger's load_config so setup_logging() at module import works without a
  real deployment config; these names are bound at import time via
  manage_api_client -> config.logger, so patching the source modules alone
  was not enough

Verified on a clean clone with py3.10 + full requirements: 58 passed,
5 skipped; lifecycle unittests 11 OK on both clean clone and dev box.
2026-10-13 12:55:55 +01:00
.github test(server): shim edge_tts.communicate so upstream WSS_URL monkey-patch imports in mock mode 2026-10-13 11:53:28 +01:00
docs docs: remove dead vicp.fun demo block and broken translated READMEs 2026-10-11 18:54:44 +01:00
main fix(tests): make pytest suite runnable from a fresh checkout (CI fix) 2026-10-13 12:55:55 +01:00
scripts test(server): shim edge_tts.communicate so upstream WSS_URL monkey-patch imports in mock mode 2026-10-13 11:53:28 +01:00
.dockerignore update: 增加docker 统一打包 (#232) 2025-03-08 21:11:30 +08:00
.gitignore chore(westernization): add rebase-verification tooling and docs 2026-10-13 11:35:11 +01:00
docker-setup.sh ci(docker): publish server images to GHCR; add server-base and app Dockerfiles 2026-04-25 17:05:06 +01:00
Dockerfile-server ci(docker): publish server images to GHCR; add server-base and app Dockerfiles 2026-04-25 17:05:06 +01:00
Dockerfile-server-base fix(westernization): runtime English surface, voiceprint truth, CI gates 2026-10-11 13:13:07 +01:00
Dockerfile-web ci(docker): publish server images to GHCR; add server-base and app Dockerfiles 2026-04-25 17:05:06 +01:00
LICENSE fix(westernization): runtime English surface, voiceprint truth, CI gates 2026-10-11 13:13:07 +01:00
Makefile Makefile test-web 同时跑契约与 vitest 2026-09-02 22:24:36 +08:00
model-setup.sh chore(repo): westernization audit, rebase guide, and local test runners 2026-04-25 17:05:26 +01:00
README.md docs: remove dead vicp.fun demo block and broken translated READMEs 2026-10-11 18:54:44 +01:00
run_tests.bat chore(repo): westernization audit, rebase guide, and local test runners 2026-04-25 17:05:26 +01:00
run_tests.sh fix(rebase): restore upstream mobile/web assets and test harness paths 2026-06-13 11:34:27 +01:00
westernization.md chore(westernization): add rebase-verification tooling and docs 2026-10-13 11:35:11 +01:00

Xiaozhi Backend Service xiaozhi-esp32-server

This project is based on human-machine symbiotic intelligence theory and technology to develop intelligent terminal hardware and software systems
providing backend services for the open-source intelligent hardware project xiaozhi-esp32
Implemented using Python, Java, and Vue according to the Xiaozhi Communication Protocol
Supports MCP endpoints and voiceprint recognition

FAQ · Report Issues · Release Notes

GitHub Contributors GitHub Contributors Issues GitHub pull requests GitHub pull requests stars


⚠️ Important Disclaimer

This is a complete port and refactoring of the original xinnan-tech/xiaozhi-esp32-server project, specifically adapted for Western users.

Credits & Acknowledgments

What Changed

This port removes Chinese AI providers and infrastructure dependencies, replacing them with Western alternatives:

  • STT: WhisperASR (offline, multilingual) instead of Chinese ASR services
  • LLM: LMStudioLLM (local, open-source) instead of Chinese LLM providers
  • TTS: EdgeTTS (Microsoft, free) - kept as default
  • Infrastructure: Replaced Chinese mirrors with international alternatives
  • Documentation: Translated and adapted for Western users

The core architecture, ESP32 communication protocol, and fundamental functionality remain unchanged from the original excellent work.


Target Users 👥

This project requires ESP32 hardware devices to work. If you have purchased ESP32-related hardware, successfully connected to Brother Xia's deployed backend service, and want to build your own xiaozhi-esp32 backend service independently, then this project is perfect for you.


Warnings ⚠️

  1. This project is open-source software. This software has no commercial partnership with any third-party API service providers (including but not limited to speech recognition, large models, speech synthesis, and other platforms) that it interfaces with, and does not provide any form of guarantee for their service quality or financial security. It is recommended that users prioritize service providers with relevant business licenses and carefully read their service agreements and privacy policies. This software does not host any account keys, does not participate in fund flows, and does not bear the risk of recharge fund losses.

  2. The functionality of this project is not complete and has not passed network security assessment. Please do not use it in production environments. If you deploy this project for learning purposes in a public network environment, please ensure necessary protection measures are in place.


Deployment Documentation

This project provides two deployment methods. Please choose based on your specific needs:

🚀 Deployment Method Selection

Deployment Method Features Applicable Scenarios Deployment Docs Configuration Requirements Video Tutorials
Simplified Installation Intelligent dialogue, IOT, MCP, visual perception Low-configuration environments, data stored in config files, no database required ①Docker Version / ②Source Code Deployment 2 cores 2GB if all APIs -
Full Module Installation Intelligent dialogue, IOT, MCP endpoints, voiceprint recognition, visual perception, OTA, intelligent control console Complete functionality experience, data stored in database ①Docker Version / ②Source Code Deployment 2 cores 4GB if all APIs -

💡 Tip: This fork does not operate a public demo platform. Follow the Docker quick start to run your own instance — the console, OTA and WebSocket endpoints are all served by your deployment.

🚩 Configuration Description and Recommendations

Note

This project provides two configuration schemes:

  1. Entry Level Free Settings: Suitable for personal and home use, all components use free solutions, no additional payment required.

  2. Streaming Configuration: Suitable for demonstrations, training, scenarios with more than 2 concurrent users, etc. Uses streaming processing technology for faster response speed and better experience.

Starting from version 0.5.2, the project supports streaming configuration. Compared to earlier versions, response speed is improved by approximately 2.5 seconds, significantly improving user experience.

Module Name Entry Level Free Settings Streaming Configuration
ASR(Speech Recognition) ✅WhisperASR(Local, Offline) 👍WhisperASR(Local, Offline)
LLM(Large Model) ✅LMStudioLLM(Local, Open Source) 👍LMStudioLLM(Local, Open Source)
VLLM(Vision Large Model) OpenAILLMVLLM(OpenAI gpt-4o) 👍OpenAILLMVLLM(OpenAI gpt-4o)
TTS(Speech Synthesis) ✅EdgeTTS(Microsoft Edge TTS) 👍EdgeTTS(Microsoft Edge TTS)
Intent(Intent Recognition) function_call(Function calling) function_call(Function calling)
Memory(Memory function) mem_local_short(Local short-term memory) mem_local_short(Local short-term memory)

🔧 Testing Tools

This project provides the following testing tools to help you verify the system and choose suitable models:

Tool Name Location Usage Method Function Description
Audio Interaction Test Tool main/xiaozhi-server/test/test_page.html Open directly with Google Chrome Tests audio playback and reception functions, verifies if Python-side audio processing is normal
Model Response Test Tool 1 main/xiaozhi-server/performance_tester.py Execute python performance_tester.py Tests response speed of three core modules: ASR(speech recognition), LLM(large model), TTS(speech synthesis)
Model Response Test Tool 2 main/xiaozhi-server/performance_tester_vllm.py Execute python performance_tester_vllm.py Tests VLLM(vision model) response speed

💡 Note: When testing model speed, only models with configured keys will be tested.


Feature List ✨

Implemented ✅

Feature Module Description
Core Architecture Based on MQTT+UDP gateway, WebSocket and HTTP servers, provides complete console management and authentication system
Voice Interaction Supports streaming ASR(speech recognition), streaming TTS(speech synthesis), VAD(voice activity detection), supports multi-language recognition and voice processing
Voiceprint Recognition Supports multi-user voiceprint registration, management, and recognition, processes in parallel with ASR, real-time speaker identity recognition and passes to LLM for personalized responses
Intelligent Dialogue Supports multiple LLM(large language models), implements intelligent dialogue
Visual Perception Supports multiple VLLM(vision large models), implements multimodal interaction
Intent Recognition Supports LLM intent recognition, Function Call function calling, provides plugin-based intent processing mechanism
Memory System Supports local short-term memory, mem0ai interface memory, with memory summarization functionality
Command Delivery Supports MCP command delivery to ESP32 devices via MQTT protocol from Smart Console
Tool Calling Supports client IOT protocol, client MCP protocol, server MCP protocol, MCP endpoint protocol, custom tool functions
Management Backend Provides Web management interface, supports user management, system configuration and device management; Supports English display
Testing Tools Provides performance testing tools, vision model testing tools, and audio interaction testing tools
Deployment Support Supports Docker deployment and local deployment, provides complete configuration file management
Plugin System Supports functional plugin extensions, custom plugin development, and plugin hot-loading

Under Development 🚧

If you are a software developer, here is our Contributing Guide. Welcome to join!


Product Ecosystem 👬

Xiaozhi is an ecosystem. When using this product, you can also check out other excellent projects in this ecosystem

Project Name Project Address Project Description
Xiaozhi Android Client xiaozhi-android-client An Android and iOS voice dialogue application based on xiaozhi-server, supporting real-time voice interaction and text dialogue.
Currently a Flutter version, connecting iOS and Android platforms.
Xiaozhi Desktop Client py-xiaozhi This project provides a Python-based AI client for beginners, allowing users to experience Xiaozhi AI functionality through code even without physical hardware conditions.
Xiaozhi Java Server xiaozhi-esp32-server-java Xiaozhi open-source backend service Java version is a Java-based open-source project.
It includes frontend and backend services, aiming to provide users with a complete backend service solution.

Supported Platforms/Components List 📋

LLM Language Models

Usage Method Supported Platforms Free Platforms
Local deployment LMStudioLLM, OllamaLLM, XinferenceLLM LMStudioLLM, OllamaLLM, XinferenceLLM
OpenAI interface calls OpenAILLM -
Google interface calls GeminiLLM GeminiLLM
Platform integrations DifyLLM, HomeAssistant -

In fact, any LLM that supports OpenAI interface calls can be integrated and used, including Xinference and HomeAssistant interfaces.


VLLM Vision Models

Usage Method Supported Platforms Free Platforms
OpenAI interface calls OpenAILLMVLLM -
Google interface calls GeminiVLLM GeminiVLLM

In fact, any VLLM that supports OpenAI interface calls can be integrated and used.


TTS Speech Synthesis

Usage Method Supported Platforms Free Platforms
Interface calls OpenAITTS, EdgeTTS, ElevenLabsTTS EdgeTTS
Local services KokoroTTS, CustomTTS KokoroTTS, CustomTTS

VAD Voice Activity Detection

Type Platform Name Usage Method Pricing Model Notes
VAD SileroVAD Local use Free

ASR Speech Recognition

Usage Method Supported Platforms Free Platforms
Local deployment VoskASR, WhisperASR VoskASR, WhisperASR
OpenAI interface calls OpenaiASR, GroqASR OpenaiASR, GroqASR
Google interface calls GeminiASR GeminiASR

Voiceprint Recognition

Usage Method Supported Platforms Free Platforms
External HTTP service Any voiceprint API compatible with the built-in VoiceprintProvider protocol (see guide) Self-hosted services

Memory Storage

Type Platform Name Usage Method Pricing Model Notes
Memory mem_local_short Local summarization Free Local short-term memory with LLM summarization
Memory mem0ai Interface calls 1000 times/month quota Cloud-based memory service
Memory nomem No memory Free Disables memory functionality

Intent Recognition

Type Platform Name Usage Method Pricing Model Notes
Intent function_call Interface calls Based on LLM pricing Function calling through LLM, fast speed, good effect
Intent intent_llm Interface calls Based on LLM pricing Intent recognition through LLM, strong generalization
Intent nointent No intent Free Disables intent recognition

Acknowledgments 🙏

Logo Project/Company Description
🎤 Bailing Voice Dialogue Robot This project is inspired by Bailing Voice Dialogue Robot and implemented on its basis
🏫 Tenclass Thanks to Tenclass for formulating standard communication protocols, multi-device compatibility solutions, and high-concurrency scenario practice demonstrations for the Xiaozhi ecosystem; providing full-link technical documentation support for this project
🌪️ Xuanfeng Technology Thanks to Xuanfeng Technology for contributing function calling framework, MCP communication protocol, and plugin-based calling mechanism implementation code. Through standardized instruction scheduling system and dynamic expansion capabilities, it significantly improves the interaction efficiency and functional extensibility of frontend devices (IoT)
📱 huangjunsen Thanks to huangjunsen for contributing the Smart Control Console Mobile module, which enables efficient control and real-time interaction across mobile devices, significantly enhancing the system's operational convenience and management efficiency in mobile scenarios.
🎨 Huiyuan Design Thanks to Huiyuan Design for providing professional visual solutions for this project, using their design practical experience serving over a thousand enterprises to empower this project's product user experience
🏢 Xi'an Qinren Information Technology Thanks to Xi'an Qinren Information Technology for deepening this project's visual system, ensuring consistency and extensibility of overall design style in multi-scenario applications
👥 Code Contributors Thanks to all code contributors, your efforts have made the project more robust and powerful.
Star History Chart