iTranslated by AI
How to Build LLMCardputer
Introduction
To run LLMs (Large Language Models) in a local environment, you normally need a GPU that supports CUDA or an Apple Silicon Mac equipped with a large amount of memory. However, in recent years, edge LLM modules for embedded microcontrollers have emerged.
This article explains how to build a system combining the "Cardputer," a credit-card-sized computer with a keyboard sold by M5Stack, and the "ModuleLLM," which allows running local LLMs.
What You'll Need
ModuleLLM
Prepare a ModuleLLM. It may be out of stock at official domestic distributors, so you might need to get creative to obtain one.
Cardputer
Prepare a Cardputer. Stock for this model is occasionally replenished.
Assembly Procedure
Disassembly
- Remove the ModuleLLM from the frame and remove the four screws with a wrench.
- Disassemble the Cardputer and carefully remove the battery.
- Remove the black part at the top of the Cardputer as well.
- Make adjustments to fit the ModuleLLM into the case.
- Modify the back of the case to expose the M.BUS pins.
- Apply insulation treatment.
Connection Method
ModuleLLM and Cardputer can communicate via UART or TCP (10001), but this article uses UART.
Connection Pin Correspondence Table
| Cardputer Side (GROVE) | ModuleLLM Side (M.BUS) |
|---|---|
| G (Black) | GND |
| 5V (Red) | 5V |
| G2 (Yellow) | UART(Tx) |
| G1 (White) | UART(Rx) |
Coding
Sample Code
Use a combination of the following samples.
- https://github.com/m5stack/M5Module-LLM/blob/main/examples/SerialTextAssistant/SerialTextAssistant.ino
- https://github.com/m5stack/M5Cardputer/blob/master/examples/Basic/keyboard/inputText/inputText.ino
Specify the UART TX and RX GPIOs as follows:
Serial2.begin(115200, SERIAL_8N1, 1, 2);
Completion
The construction is now complete.
Discussion