Have you ever wished for a little desk companionβsomething with the tactile charm of a retro game character that could chat with you, keep track of your desk timers, or talk you through a tricky bugβwithout a camera staring at you all day?
That question sparked DinoDesk AI: our LEGO Dino AI Companion Robot.
I and my colleague Shama set out to build a smart, low-power desk robot that combines the nostalgia of 8-bit audio-visuals and LEGO Technic mechanics with a modern Hybrid LLM Switching Architecture (Local β Cloud). By pairing a Raspberry Pi on the desk with a local PC gateway running Gemma 4 alongside Gemini Flash, we created a companion that offers 100% visual privacy (no camera), instantaneous zero-cost local chat, and deep cloud reasoning on demand.
Here is the full behind-the-scenes story of how we designed, wired, and programmed DinoDesk AI from the ground up.
One of the biggest dilemmas when building an AI hardware companion is choosing where the brain lives. If everything runs in the cloud, every casual "What time is it?" costs API tokens, adds network latency, and sends your voice data over the internet. On the other hand, if you strictly limit yourself to a small on-device model, the robot struggles the moment you ask it to create a new feature in your gigantic codebase, or explain a complex topic.
So we decided to build a Hybrid LLM Architecture, with a Unified LLM Gateway (Router) hosted on the user's main PC. The Raspberry Pi on your desk sends identical OpenAI-compatible requests over Wi-Fi regardless of which engine is active:
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β [ Main PC / Local Gateway ] β
β β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β Dynamic Model Router / Switch β β
β ββββββββββββββββββββββ¬βββββββββββββββββββββ β
β β β
β ββββββββββββββββββββ΄βββββββββββββββββββ β
β v v β
β [ LOCAL ENGINE ] [ CLOUD ENGINE ] β
β LM Studio / Gemma 4 Gemini Flash / β
β (Zero Latency, Private) Gemini Live β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββ
β
β Wi-Fi (Unified OpenAI-Compatible Stream)
v
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β [ DinoDesk AI (RPi) ] β
β - Pirate Audio LCD & I2S Beep Speaker β
β - Push Button & Optional Sensors β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
| Mode | Active Model | Strengths & Primary Use Case | How to Switch |
|---|---|---|---|
| π’ Local Mode*(Default)* | Gemma 4 (via LM Studio) | Zero-cost, offline, 100% private. Delivers ~200 ms first-token latency for casual chats, desk timers, and quick status checks. | Double-click Pirate Audio Button X , 3s long-press on Capacitive Touch sensor, or voice command ("Switch to Cloud Mode" ) |
| π‘ Cloud Mode | Gemini Flash / Gemini Live | High reasoning & complex problem solving. Ideal for coding help, complex math, deep explanations, or language tutoring (~800 ms first token). | Same as above |
| β‘ Auto-Hybrid Mode | Automatic Routing | Defaults to Gemma 4 locally . When the complexity classifier detects multi-step reasoning keywords ("explain" ,"compare" ,"write code" ), it transparently escalates the prompt toGemini Flash . | Automatic System Routing |
When Auto-Hybrid Mode escalates a question to the cloud, the robot's indicator temporarily shifts from π’ steady green to π‘ steady gold for the duration of the response, then returns to greenβso you always know at a glance which brain is answering.
We wanted DinoDesk AI to feel like a physical toy rather than a cold smart speaker. Instead of 3D-printing a sealed plastic shell, we built the body out of basic LEGO bricks and Technic lever mechanisms so anyone can customize or repair it.
Before building the full body, I first prototyped the logic using a Raspberry Pi and a simple LEGO set.
Even with voice and sensor triggers, dedicated hardware buttons feel good for instant physical control:
Idle. Low β Medium β High β Mute).
A companion robot only feels alive when its eyes, voice, and body move together. We designed a 5-stage Finite State Machine (FSM) that coordinates the 240Γ240 LCD eye expressions, 8-bit beeps, and motor movements:
ββββββββββββ button βββββββββββββ release ββββββββββββ stream ββββββββββββ
β Sleeping βββββββββββ> β Idle βββββββββββββ>βListening ββββββββββ> β Thinking β
ββββββββββββ (wake) βββββββββββββ (trigger) ββββββββββββ (send) ββββββββββββ
^ β
β ββββββββββββ β
ββββββββββββββββ Speaking β<ββββββββββββββββββββββββ
(done) ββββββββββββ (tokens arrive)
| State | Entry Condition | Pirate Audio LCD Expression | 8-Bit Audio Feedback | Motor Action (Neck / Tail) |
|---|---|---|---|---|
| 1. Sleeping | Inactive for 3 mins OR room dark | ( - _ - )Closed eyes + zzz |
Silent (or optional soft snore) | Motors relaxed; head tilted slightly down |
| 2. Idle | Default standby | ( β’ β’ )Autonomous blinking |
Occasional wake/blink chime | Head centers; neck sways slowly |
| 3. Listening | Button click OR sensor trigger | ( O O )Eyes widen bright |
"Beep-Boop!" rising tone | Head tilts 15Β° toward the user |
| 4. Thinking | Audio sent; router inferring | ( ΒΊ ΒΊ )Spinning pupils + mode badge |
Irregular processing ticks ( tick-teek-poh ) |
Neck sways slowly side-to-side |
| 5. Speaking | Receiving SSE token stream | Expressive blinking + scrolling subtitles | 8-bit typewriter beep per token | Tail wags in sync with text length |
Building DinoDesk AI reminded us that AI doesn't have to stay locked inside a browser tab or a cloud data center. When you give an open model like Gemma 4 a pair of pixel eyes, an 8-bit voice, a wiggling LEGO tail, and the ability to call on Gemini when things get heavy, your desk suddenly feels a whole lot more lively. π¦β¨
It's still a work in progress and not quite perfect yet, but I'll be back soon with fully implemented voice chat capabilities! Until then, please enjoy the fun little 8-bit sound effects every time you press the button. Beep-Boop!
Clone the repo here : https://github.com/google-gemma/dinodesk-ai-companion/
And drop a comment to share what you're planning to create.