Skip to main content
  1. Projects/

Tip of my Dictionary

A “20 Questions”-type game implemented on the Pimoroni Picosystem - a Raspberry Pi Pico packaged like a tiny game console.

I got some inspiration from the original patent, prototyped the system in an Elixir Livebook and implemented the game itself in C++.

The livebook stores the bulk of its data on an instance of CloudNativePG deployed to my home kubernetes cluster. The cluster was also useful for feeding the game logic with data - I obtained the reference answers by querying a local Ollama instance using ollamex, which is basically an Elixir implementation of a local-model friendly LiteLLM.

It currently does a decent job guessing from a database of ~8k nouns, but I believe with some tweaks and after feeding it more data it should get down to the “20 questions” benchmark, with a database of ~25k nouns.

Expect a blogpost on the benefits of running LLMs locally!


You’ll find the source in the repo linked below, but please don’t judge me on the code quality. This was made very much in the spirit of “I just want to get the PoC working”, and I made the decision to not even attempt to become proficient in C++ a long time ago.

I’m just lucky the trauma of writing C++ during my first years at uni, and banging my head against the venerable C++ FAQ Lite has left a strong enough mark to save me from segmentation faults (at least for now) 😉


Side-note - the Picosystem is a great piece of hardware for projects like these. The layout is very usable, the CPU is surprisingly powerful, and it has enough RAM to do most things if you’re smart about it. The main benefit (for me) was its 16MB of Flash - I’m nowhere close to using it up with my current implementation and there are many cases where you’d need way more read-only data than you’d need to fit in runtime memory.

nietaki
Author
nietaki
Elixir specialist learning golang and DevOps