StackFlow can provide a local HTTP interface compatible with the OpenAI API format. Existing OpenAI SDKs, Chatbox, and other compatible clients can access local models through the device IP address for chat generation, speech recognition, and speech synthesis.
“OpenAI-compatible” refers only to API-format compatibility. The models and inference services run on the local device, and requests are not sent to the OpenAI cloud.
Follow the software update guide for your device to add the M5Stack APT repository and update its package index.
apt update apt install lib-llm llm-sys llm-openai-api | AI Capability | Service | Installation Command |
|---|---|---|
| Large language model | llm-llm | apt install llm-llm |
| Multimodal model | llm-vlm | apt install llm-vlm |
| Whisper speech recognition | llm-whisper | apt install llm-whisper |
| MeloTTS speech synthesis | llm-melotts | apt install llm-melotts |
Each service also requires a model package compatible with the device platform. After installing a model, refresh the model list exposed by the OpenAI-compatible API:
systemctl restart llm-openai-api Prepare a Python environment on the PC and install the official OpenAI Python library with pip. The library can then access the OpenAI-compatible API provided by the device and invoke its local models.
pip install openai