iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🍌

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

  1. Remove the ModuleLLM from the frame and remove the four screws with a wrench.
  2. Disassemble the Cardputer and carefully remove the battery.
  3. Remove the black part at the top of the Cardputer as well.
  4. Make adjustments to fit the ModuleLLM into the case.
  5. Modify the back of the case to expose the M.BUS pins.
  6. 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.

Specify the UART TX and RX GPIOs as follows:

Serial2.begin(115200, SERIAL_8N1, 1, 2);

Completion

The construction is now complete.

Discussion