Nerd sniping with a gamepad for evals
A few weeks ago, I released mopad, which is a library that allows you to use a gamepad in Python.
When I released it, I hinted at Hamel Husain that you could use it to annotate data and that more people should consider it seriously. Turns out this was a total nerd snipe, and Hamel invited me to talk about it on his live-stream here. The benefit of this link is that it also has dialogue at the start where I showcase my streaming/work setup. You can also see the more polished demo-recording below:
Announcing molabel
I figured the livestream was also a great opportunity to showcase a new thing that I had been working on: molabel. The library contains an annotation widget that gives you simple labelling interfaces that work straight from your notebook. It works by letting you pass a custom rendering function to for your examples, after which you can attach labels and notes to each. You can use the mouse for this, as well as keyboard shortcuts or a bluetooth gamepad.
This is what the widget looks like:

You create this widget with a call like this:
from molabel import SimpleLabel
widget = SimpleLabel(
examples=list_of_examples,
render=render_function
)
The list_of_examples
can be any Python list of things that you would like to render. You'd typically pass a list of dictionaries, but you're allowed to pass whatever you like. The only thing that the widget cares about is that you also pass a render_function
that can take each example and turn it into something html-like that the widget can render. You could use a string, but any object that has a _repr_html_
would also work. That means that you can also directly use mohtml and FastHTML.

If the widget knows how to render, it can take care of the rest.

The widget will store all the annotations that you generate and you can wire it up in such a way that data is automatically sent to a database on your behalf. If you have a gamepad at-the-ready you can also use it live from the demo hosted on GitHub pages. It runs a marimo notebook in WASM, so you can give the widget a spin without installing anything locally.
Loads of use-cases are covered
This widget can feel pretty basic at first glance. There's really only a binary "yes"/"no" choice with an extra option to "skip". While it might seem basic, let's take a step back and appreciate what we've already got covered here. As-is, you can use this for:
- binary classification
- multi-label classification (each label is binary, after all)
- the "is this a match?" kinds of queries for retreival
- comparisons between two choices, one of which is better
Keeping it simple also means less human errors and more labels. I have seen annotation interfaces with 27 classification labels and it's maddening. Having a simpler interface means less cognitive overhead and it will just give you more labels with higher quality.
Not only that, but we allow you to add plenty of context via the textbox too. So if you want to explain why there is an issue with an example, maybe for finetuning an LLM later, that's totally possible here. You could theorically even use this widget only to add a note to each example, ignoring the labels all-to-gether. Note that you can use the text-to-speech API from the browser for free here, so you could also use your voice while annotating with a gamepad.
Why
I have been telling people to take data quality serious for years now and instead of talking about it I now want to start making tools for it. The focus of these tools will be to make it easy to get started, but also to make it fun. I have literally found a way for AI engineers to expense a gamepad for work, so hopefully that alone will be enough to get more people to use this.
Final note
Finally, and this is important, the gamepad is also a great ergonomic device. You can sit in a comfortable chair and use a device that is crafter for comfort. I have suffered from RSI in the past and it is something to take serious. It led me to become a bit of a device nerd, I now review ergonomic keyboards on a YouTube channel, and I am looking forward to reviewing devices/gamepads for annotation in the near future
ps. This post was also featured on my Substack. Consider becoming a free member if you want to remain in the loop of what I am up to.