Overview
MicroLLM is the world’s first real-time voice assistant that runs entirely on a Raspberry Pi Pico W! By leveraging Groq’s blazing-fast LLaMA API and ElevenLabs for natural-sounding text-to-speech, it delivers contextual AI responses through a DAC via I2S audio output—all on a $6 microcontroller.
✨ Features
- 🤖 Contextual LLM Responses - Powered by Groq’s LLaMA 3 API
- 🔊 Real-Time TTS - Natural speech via ElevenLabs PCM 24kHz stream
- 📶 Wi-Fi Connectivity - True IoT integration with CircuitPython
- 🧠 Fully Embedded - No PC or Raspberry Pi OS required!
Hardware Requirements
- Raspberry Pi Pico W
- MAX98357A I2S DAC
- 4-to-8 Ohm Speaker
- 5V USB Power
Wiring
| Pico Pin | MAX98357A Pin |
|---|---|
| GP1 | BCLK |
| GP0 | LRCK |
| GP9 | DIN |
| GND | GND |
| 3V3 | VDD |
Setup
- Flash CircuitPython - Use the provided
.uf2firmware - Copy Files - Transfer
code.pyandlib/folder to Pico - Configure API Keys - Edit
settings.toml:
CIRCUITPY_WIFI_SSID = "YourWiFiNetwork"
CIRCUITPY_WIFI_PASSWORD = "YourPassword"
ELEVENLABS_API_KEY = "your-elevenlabs-api-key"
GROQ_API_KEY = "your-groq-api-key"
- Power On - The Pico connects to WiFi and starts listening!
How It Works
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Pico W │───▶│ Groq API │───▶│ LLaMA 3 LLM │
│ (WiFi) │ │ (Cloud) │ │ │
└─────────────┘ └─────────────┘ └──────┬──────┘
│
Text Response │
▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Speaker │◀───│ I2S DAC │◀───│ ElevenLabs │
│ │ │ (MAX98357A) │ │ TTS Stream │
└─────────────┘ └─────────────┘ └─────────────┘
Example: Groq Query
import adafruit_requests
response = requests.post(
"https://api.groq.com/openai/v1/chat/completions",
json={"model": "llama3-8b-8192", "messages": messages},
headers={"Authorization": f"Bearer {groq_api_key}"}
)
answer = response.json()["choices"][0]["message"]["content"]
print("Response:", answer)