explaingit

liwuyuee/xiaozhi-esp32-local

Analysis updated 2026-05-18

61CAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

A firmware add-on for an ESP32 voice assistant that lets it understand a handful of spoken commands offline when it cannot reach the cloud.

Mindmap

mindmap
  root((xiaozhi esp32 local))
    What it does
      Offline voice fallback
      Local command matching
      Cloud AI when online
    Tech stack
      ESP-IDF
      FreeRTOS
      ESP-SR
    Use cases
      Smart home control
      Network outage backup
      Embedded voice UI
    Audience
      Embedded developers
      Hardware hobbyists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Keep a smart home ESP32 voice assistant working during internet outages

USE CASE 2

Add basic offline voice control for lights or fans to an embedded project

USE CASE 3

Extend the xiaozhi-esp32 project with a local fallback speech mode

USE CASE 4

Learn how to use ESP-SR for on device command recognition

What is it built with?

CC++ESP-IDFFreeRTOSESP-SR

How does it compare?

liwuyuee/xiaozhi-esp32-localchillymasterio/puttyaltfreertos/freertos-smp-demos
Stars615968
LanguageCCC
Last pushed2025-02-16
MaintenanceStale
Setup difficultyhardeasymoderate
Complexity4/52/53/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Requires ESP32-S3 hardware with PSRAM and the ESP-IDF v5.5 toolchain, documentation is in Chinese.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

xiaozhi-esp32-local is a firmware extension for xiaozhi-esp32, an open source AI voice assistant that runs on ESP32 hardware. The original project needs a network connection to send speech to a cloud server for understanding and reply. This fork adds a fallback: when the device cannot reach the server, it switches to a local offline mode and can still understand a small set of spoken commands using on device recognition instead of the cloud. The offline mode ships with ten Chinese language voice commands covering simple smart home actions such as turning lights on or off and asking for the current time. After the wake word is spoken, the device listens for four seconds. If it cannot reach the cloud server in that window, it falls back to matching the spoken audio against its built in command list using ESP-SR, a speech recognition library from Espressif, the maker of the ESP32 chip. A matched command runs immediately on the device and the result is shown on screen along with a spoken confirmation. If nothing matches before the timeout, the device returns to standby. The project targets ESP32-S3 hardware with PSRAM, since the local recognition model needs that extra memory to run, and it has been tested specifically on the ICECAT K2 development board, though the underlying xiaozhi-esp32 project supports many other boards. It is built with ESP-IDF 5.5 and FreeRTOS. Developers can add their own custom offline commands by editing a command list in the source code and reflashing the device. Setup involves cloning the repository, selecting the ESP32-S3 target and board type through the ESP-IDF menuconfig tool, then building and flashing as normal. Offline recognition can be toggled on or off through the same configuration menu, and when disabled it uses no extra device resources. The project is released under the MIT license, matching the license of the original xiaozhi-esp32 project it builds on, and credits both that project and Espressif's ESP-SR and ESP-IDF frameworks.

Copy-paste prompts

Prompt 1
Walk me through flashing xiaozhi-esp32-local onto an ESP32-S3 board with ICECAT K2 selected.
Prompt 2
Show me how to add a new offline voice command to the kCommands array in local_asr.cc.
Prompt 3
Explain how the offline fallback in xiaozhi-esp32-local decides when to switch from cloud to local recognition.
Prompt 4
Help me adjust the LOCAL_ASR_DURATION_MS and LOCAL_ASR_THRESHOLD settings for more reliable recognition.

Frequently asked questions

What is xiaozhi-esp32-local?

A firmware add-on for an ESP32 voice assistant that lets it understand a handful of spoken commands offline when it cannot reach the cloud.

What language is xiaozhi-esp32-local written in?

Mainly C. The stack also includes C, C++, ESP-IDF.

What license does xiaozhi-esp32-local use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is xiaozhi-esp32-local to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is xiaozhi-esp32-local for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.