MIGPT  by Afool4U

Xiaoai/ChatGPT integration for smart home control via streaming API

created 2 years ago
562 stars

Top 57.0% on SourcePulse

GitHubView on GitHub
Project Summary

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

  • Install dependencies: pip install -r requirements.txt. Requires a C++ build environment for tiktoken installation; a workaround is provided for missing build tools.
  • Configure MIGPT.py with Xiaomi account, password, OpenAI API Key, and speaker model.
  • Requires a stable internet connection (scientific internet access recommended).
  • Note: Does not support LX04, L05B, and L05C speaker models.

Highlighted Details

  • Achieves sub-1.5-second response times in testing.
  • Custom classifiers (BERT/SVM) trained on user-collected data claim >90% accuracy.
  • Allows interrupting ChatGPT responses with new queries or commands like "stop".
  • Supports toggling advanced ChatGPT dialogue on/off during runtime.

Maintenance & Community

  • References projects by yihong0618 (xiaogpt), acheong08 (ChatGPT), and Yonsm (MiService).
  • Author contact via QQ group: 622695590.

Licensing & Compatibility

  • License not explicitly stated in the README.
  • Compatibility with commercial or closed-source projects is undetermined due to the lack of a specified license.

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.

Health Check
Last commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
14 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.