Repolode
yihong0618

yihong0618/xiaogpt

Turns a Xiaomi AI Speaker into a voice front end for ChatGPT and other LLMs, routing wake-word questions to a model and speaking the reply.

Stars
6,949
Forks
955
Open issues
74
Last commit
13 days ago

What is it?

xiaogpt is a Python tool that connects a Xiaomi AI Speaker to large language models. Questions spoken to the speaker after a trigger phrase such as "帮我" are sent to the configured model, and the answer is played back through the speaker's text-to-speech.

It supports ChatGPT through the OpenAI API, plus Gemini, Qwen, Doubao, Moonshot, Llama3 via Groq, ChatGLM, 01 and New Bing. Speech output can use the speaker's built-in TTS or third-party engines such as Edge TTS, OpenAI, Azure, Volcengine, Baidu, Google and Fish Audio. Streaming responses and continuous conversation mode are available, and a LangChain option adds web search and calculation.

Setup uses the MiService library to look up the speaker's device ID, with a cookie or account login as alternatives. Configuration can come from command-line flags or a YAML/JSON file, and Docker images are provided.

Key features

  • 01Routes voice questions from Xiaomi AI Speaker to ChatGPT or other LLMs.
  • 02Plays model replies through the speaker's TTS or third-party TTS engines.
  • 03Supports streaming responses and continuous conversation mode.
  • 04Configurable via CLI flags or a YAML/JSON config file.
  • 05Provides a Docker image for deployment.

Use cases

  • Adding a conversational AI assistant to a Xiaomi speaker at home.
  • Experimenting with different LLM backends through a voice interface.
  • Customising the speaker's voice output with a preferred TTS provider.

Quick start

  1. 1

    Install xiaogpt from PyPI

    pip install -U --force-reinstall xiaogpt[locked]
  2. 2

    Find your speaker's DID with MiService (set MI_USER and MI_PASS first)

    miservice list
  3. 3

    Set your OpenAI API key

    export OPENAI_API_KEY=${your_api_key}
  4. 4

    Run xiaogpt with your speaker model and the ChatGPT API

    xiaogpt --hardware LX06 --use_chatgpt_api

Things to know

  • Requires a Xiaomi AI Speaker and a Xiaomi account.
  • Uses an LLM API key, which is typically paid, for ChatGPT or other models.
  • Requires Python 3.12 to 3.14.

Topics

FAQ

What is xiaogpt?
Turns a Xiaomi AI Speaker into a voice front end for ChatGPT and other LLMs, routing wake-word questions to a model and speaking the reply. xiaogpt is a Python tool that connects a Xiaomi AI Speaker to large language models. Questions spoken to the speaker after a trigger phrase such as "帮我" are sent to the configured model, and the answer is played back through the speaker's text-to-speech.
Is xiaogpt free to use? What license does it have?
xiaogpt is open source under the MIT license. Check the license terms before using it in commercial products.
Is xiaogpt still maintained?
Actively maintained. The last commit to xiaogpt was on Oct 7, 2026.
What can I use xiaogpt for?
Adding a conversational AI assistant to a Xiaomi speaker at home. Experimenting with different LLM backends through a voice interface. Customising the speaker's voice output with a preferred TTS provider.
How do I install xiaogpt?
Install xiaogpt from PyPI: pip install -U --force-reinstall xiaogpt[locked] Find your speaker's DID with MiService (set MI_USER and MI_PASS first): miservice list Set your OpenAI API key: export OPENAI_API_KEY=${your_api_key} Run xiaogpt with your speaker model and the ChatGPT API: xiaogpt --hardware LX06 --use_chatgpt_api
Where can I get xiaogpt?
The source code and installation instructions are on GitHub: https://github.com/yihong0618/xiaogpt

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects