Xiaoai/ChatGPT integration for smart home control via streaming API
Top 57.0% on SourcePulse
This project integrates ChatGPT with Xiaomi's XiaoAi smart speaker to create a low-latency, stream-based conversational AI for smart home control. It targets users seeking a more responsive and intelligent smart home experience by leveraging OpenAI's streaming API and custom model-switching algorithms.
How It Works
The core innovation lies in using OpenAI's native streaming API for near-instantaneous responses, reducing user wait times by an estimated 80% compared to traditional methods. It employs a producer-consumer pattern for stream processing and a custom algorithm for segmenting responses. A key differentiator is its self-developed model-switching logic, which uses a fine-tuned BERT model with 8-bit dynamic quantization or an SVM with TF-IDF features to automatically invoke large language models without disrupting core smart home functions like device control or weather queries.
Quick Start & Requirements
pip install -r requirements.txt
. Requires a C++ build environment for tiktoken
installation; a workaround is provided for missing build tools.MIGPT.py
with Xiaomi account, password, OpenAI API Key, and speaker model.Highlighted Details
Maintenance & Community
yihong0618
(xiaogpt), acheong08
(ChatGPT), and Yonsm
(MiService).622695590
.Licensing & Compatibility
Limitations & Caveats
The self-developed large model calling algorithm is not yet uploaded. The project explicitly states it does not support certain XiaoAi speaker models (LX04, L05B, L05C). Installation may require troubleshooting C++ build tools.
2 months ago
1 day