pdf-icon

Product Guide

Industrial Control

Real-Time AI Voice Assistant

AtomS3R-M12 Volcengine Kit

Offline Voice Recognition

Thread

Module Gateway H2

IoT Measuring Instruments

IoT Cloud

Ethernet Camera

LoRa & LoRaWAN

DIP Switch Usage Guide

Module GPS v2.0

Module GNSS

Module ExtPort For Core2

OpenAI API Usage Guide

This tutorial introduces how to install various model services on the Module LLM and LLM630 Compute Kit, and how to access and invoke their model capabilities via the standard OpenAI API on PC or other devices. It covers common scenarios including chat completion, speech recognition, speech synthesis, etc., helping you build efficient AI edge applications.

1. Preparation

Before use, please refer to the respective device’s software upgrade tutorial to add the M5Stack apt repository info and update the index.

2. Dependency Updates

  1. Access the device terminal via UART or SSH and run the following command to update the apt repository index.
apt update
  1. Update the llm core package on the device.
apt install lib-llm
  1. Update the related dependency packages.
apt install llm-sys llm-llm llm-vlm llm-whisper llm-melotts llm-openai-api
  1. After installing the above packages, reboot the device.
reboot

3. Python OpenAI

On the PC, configure your Python environment and install the official OpenAI Python library via pip. Subsequent steps will use this library and the standard OpenAI API interface to access the LLM device and invoke its model capabilities.

pip install openai

4. Feature Index

On This Page