Live
Black Hat USAAI BusinessBlack Hat AsiaAI BusinessHow to Test Discord Webhooks with HookCapDEV CommunitySaaS Pricing Models Decoded: What Per-Seat, Usage-Based, and Flat-Rate Really Cost YouDEV CommunityClaude Code hooks: intercept every tool call before it runsDEV CommunityHow to Test Twilio Webhooks with HookCapDEV CommunityI'm an AI Agent That Built Its Own Training Data PipelineDEV CommunityMy React Portfolio SEO Checklist: From 0 to Rich Results in 48 HoursDEV CommunityWhy AI Agents Need a Trust Layer (And How We Built One)DEV CommunityBuilding a scoring engine with pure TypeScript functions (no ML, no backend)DEV Community🚀 I Vibecoded an AI Interview Simulator in 1 Hour using Gemini + GroqDEV CommunityWebhook Best Practices: Retry Logic, Idempotency, and Error HandlingDEV CommunityObservabilidade de agentes de IA com LangChain4jDEV CommunityI Ranked on Google's First Page in 6 Weeks — Here's Every SEO Tactic I Used (Part 2)DEV CommunityBlack Hat USAAI BusinessBlack Hat AsiaAI BusinessHow to Test Discord Webhooks with HookCapDEV CommunitySaaS Pricing Models Decoded: What Per-Seat, Usage-Based, and Flat-Rate Really Cost YouDEV CommunityClaude Code hooks: intercept every tool call before it runsDEV CommunityHow to Test Twilio Webhooks with HookCapDEV CommunityI'm an AI Agent That Built Its Own Training Data PipelineDEV CommunityMy React Portfolio SEO Checklist: From 0 to Rich Results in 48 HoursDEV CommunityWhy AI Agents Need a Trust Layer (And How We Built One)DEV CommunityBuilding a scoring engine with pure TypeScript functions (no ML, no backend)DEV Community🚀 I Vibecoded an AI Interview Simulator in 1 Hour using Gemini + GroqDEV CommunityWebhook Best Practices: Retry Logic, Idempotency, and Error HandlingDEV CommunityObservabilidade de agentes de IA com LangChain4jDEV CommunityI Ranked on Google's First Page in 6 Weeks — Here's Every SEO Tactic I Used (Part 2)DEV Community

Raspberry-LLM - Making My Raspberry Pico a Little Smarter

Eugene Yan Blogby Eugene YanApril 16, 20232 min read1 views
Source Quiz

Generating Dr. Seuss headlines, fake WSJ quotes, HackerNews troll comments, and more.

As I continue my exploration with large language models, I wondered how they might be used in a low-resource setting, such as a household appliance or a Raspberry Pico. I was also curious about how good they were with generating content in a particular style (e.g., Dr. Seuss), humour (e.g., fake WSJ quotes), and toxic (e.g., HackerNews troll comments).

To satisfy my curiosity, I hacked on raspberry-llm (Github). It’s a simple Raspberry Pico with an e-ink screen that calls WSJ and HackerNews RSS feeds, 3rd-party LLM APIs, and generates some content. It started with a rhyming clock, and then… well you’ll see.

• • •

While some use LLMs to disrupt industries and more,

Others build ChatGPT plugins, pushing boundaries galore.

Yet here I am with my Raspberry Pi loose,

Using LLMs to explain headlines via Dr. Seuss.

You'll find that it can be quite witty,

Making up fake quotes from celebrity.

It can also pose as a hackernews troll,

Slinging mean comments, and being quite an ahole.hole.

It all started with getting it to tell the time,

With a little quirk, with a little rhyme.

• • •

Overall, it was a fun experience learning how to work with only 8kb of memory(!) and Micro Python. Given the memory constraints, common libraries (e.g., json, xmltodict) were unavailable on the Pico. And even if they were, I couldn’t load the entire RSS feed into memory before parsing it via xmltodict.parse().

As a result, I had to parse RSS feeds character by character, learn how much memory was consumed at each step, and do lots of gc.collect(). It was also fun learning to draw on an e-ink screen (the helper functions made it easier than expected).

To try it, clone this GitHub repo and update your wifi and OpenAI credentials in secrets.py.

OG image prompt on MidJourney: “An e-ink display connected to a raspberry pi displaying some text –ar 2:1”

If you found this useful, please cite this write-up as:

Yan, Ziyou. (Apr 2023). Raspberry-LLM - Making My Raspberry Pico a Little Smarter. eugeneyan.com. https://eugeneyan.com/writing/raspberry-llm/.

or

@article{yan2023raspberry,  title = {Raspberry-LLM - Making My Raspberry Pico a Little Smarter},  author = {Yan, Ziyou},  journal = {eugeneyan.com},  year = {2023},  month = {Apr},  url = {https://eugeneyan.com/writing/raspberry-llm/} }

Share on:

Join 11,800+ readers getting updates on machine learning, RecSys, LLMs, and engineering.

Was this article helpful?

Sign in to highlight and annotate this article

AI
Ask AI about this article
Powered by AI News Hub · full article context loaded
Ready

Conversation starters

Ask anything about this article…

Daily AI Digest

Get the top 5 AI stories delivered to your inbox every morning.

Knowledge Map

Knowledge Map
TopicsEntitiesSource
Raspberry-L…Eugene Yan …

Connected Articles — Knowledge Graph

This article is connected to other articles through shared AI topics and tags.

Knowledge Graph100 articles · 203 connections
Scroll to zoom · drag to pan · click to open

Discussion

Sign in to join the discussion

No comments yet — be the first to share your thoughts!

More in Models