explaingit

roalfb/olivia-ai

Analysis updated 2026-05-18

2JavaScriptAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

A browser app that emulates a real ESP32 hardware device to connect to the Xiaozhi AI assistant cloud without needing physical hardware.

Mindmap

mindmap
  root((Olivia))
    What it does
      Emulates ESP32 device
      Connects to Xiaozhi cloud
      Runs in browser
    Tech stack
      Hono
      Cloudflare Workers
      WebSocket and Opus
    Use cases
      Try Xiaozhi without hardware
      Voice and vision features
      Shareable web deployment
    Audience
      Developers
      Xiaozhi hobbyists
    Pipeline
      Header injecting proxy
      Opus audio encoding
      OTA provisioning

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

Try the Xiaozhi AI assistant cloud service without owning or flashing ESP32 hardware.

USE CASE 2

Develop and test applications against the Xiaozhi protocol from a browser.

USE CASE 3

Use browser camera and microphone to interact with Xiaozhi's voice and vision features.

USE CASE 4

Deploy a shareable Xiaozhi client to Cloudflare Pages instead of distributing physical devices.

What is it built with?

JavaScriptTypeScriptHonoCloudflare WorkersWebSocketOpus

How does it compare?

roalfb/olivia-ai3imed-jaberi/cryptography-si-isamm3imed-jaberi/koa-isomorphic-router
Stars222
LanguageJavaScriptJavaScriptJavaScript
Last pushed2021-09-252021-02-06
MaintenanceDormantDormant
Setup difficultymoderateeasyeasy
Complexity4/51/52/5
Audiencedeveloperresearcherdeveloper

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

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires deploying a Hono backend on Cloudflare Workers/Pages to proxy authenticated requests to the Xiaozhi cloud.

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

In plain English

Olivia is a web application that runs entirely in your browser and pretends to be a physical ESP32 hardware device for Xiaozhi, an open source AI assistant ecosystem normally designed to run on a real microcontroller board with a microphone and speaker. Instead of needing to buy and flash actual hardware, Olivia lets you try out and build against the Xiaozhi cloud using just a browser tab. To pull this off, Olivia has to work around several things a browser normally cannot do that real ESP32 firmware can. Browsers cannot send certain custom authentication headers when opening a WebSocket connection, so Olivia runs a small server component, built with the Hono framework on Cloudflare Workers, that adds those headers on the device's behalf. The same server component also proxies image uploads for the vision feature and handles the device registration process, both of which also require headers a browser cannot set directly. For audio, the Xiaozhi server only accepts properly encoded Opus audio rather than raw microphone data, so Olivia loads a WebAssembly build of the Opus audio codec to encode your microphone input into the exact format the real hardware would send. Because it runs in a browser rather than on a physical chip, Olivia also gains some abilities a real device cannot have, such as switching between a phone's front and back camera, keeping a full text history of conversations, showing a live protocol debug panel, supporting more image formats than a hardware camera would capture, and being reachable from any device with a browser simply by sharing a web link rather than shipping physical hardware. On the AI and conversation side, it connects to the official Xiaozhi cloud service, streams text responses as they are generated, decodes emotion signals sent by the server, and keeps a stored conversation history. On the voice side, it captures microphone audio in real time with noise suppression and echo cancellation, supports both push-to-talk and continuous listening modes, and plays back the AI's spoken responses with minimal delay. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Explain how Olivia's Hono server proxy works around browser WebSocket header limitations to emulate ESP32 firmware.
Prompt 2
Walk me through deploying Olivia to Cloudflare Pages.
Prompt 3
Help me understand how Olivia encodes microphone audio into Opus frames to match the Xiaozhi protocol.
Prompt 4
Show me how the OTA provisioning and device pairing flow works in Olivia.

Frequently asked questions

What is olivia-ai?

A browser app that emulates a real ESP32 hardware device to connect to the Xiaozhi AI assistant cloud without needing physical hardware.

What language is olivia-ai written in?

Mainly JavaScript. The stack also includes JavaScript, TypeScript, Hono.

What license does olivia-ai use?

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

How hard is olivia-ai to set up?

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

Who is olivia-ai for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.