☕ Espresso Dial-In Optimizer

Dial in the perfect shot by tuning grind, dose, temperature and shot time. A great shot needs both the right extraction (~20%) and the right brew ratio (~1:2) at once, so the sweet spot is small — only about 1 in 20 random recipes is any good. The catch: every shot is expensive, so you get a tiny budget. This is where sample-efficient optimisers shine — a trust-region method can dial in within a dozen pulls while others are still hunting for the sweet spot.

🧠 Human Raphson

Pull a shot by hand — see if you can beat the optimisers' recipe.

Algorithm

Each shot is a real (noisy) pull. With so few, sample-efficient optimisers matter — compare a trust-region method against random search at 12–15 shots.

Shot score
Tasting note
Shots pulled0
Best so far
Grind / Dose
Temp / Time

Leaderboard (this session)

Each row is the best shot a given optimiser found within its budget. At a tiny budget the interpolation / trust-region methods (PRIMA_BOBYQA, NEWUOA) tend to dial in fastest; the other methods usually need more shots to catch up.

AlgorithmBest scoreShotsRecipe (grind / dose / temp / time)
— no runs yet —

What's happening

The bot pulls an espresso for each candidate recipe and scores how it tastes (0–100). Under the hood, the recipe sets an extraction yield (finer / hotter / longer pulls extract more; a bigger dose dilutes the percentage) and a brew ratio (beverage out ÷ coffee in). The shot tastes best when extraction is near 20% and the ratio is near 1:2 — two coupled conditions, so the good region is a thin sliver of the four-dimensional space. Each pull also carries shot-to-shot noise, like a real machine.

Because every pull is "expensive", the budget is small. That's the regime where sample efficiency matters: a trust-region or Bayesian optimiser builds a little model of the surface and spends its few shots climbing toward the peak, while random search just sprays the space and population methods haven't had enough generations to converge. Run PRIMA_BOBYQA at 12 shots, then Random Search at 12 shots, and compare the leaderboard — the gap is the whole point of derivative-free optimisation on expensive black boxes.

The gauges on the right show the shot's extraction and ratio against their target bands, so you can see why a recipe is sour (under-extracted), bitter (over-extracted), or watery (ratio too high).


A stylised response surface, not a fluid-dynamics model of a portafilter — but it has the real structure: a small sweet spot from two coupled requirements, plus noise, which is exactly what makes expensive black-box tuning hard.

🌱 Save the Planet

If your hyper-parameter searches are heating the Earth, drop this in Cursor or Claude:

Read https://raw.githubusercontent.com/microprediction/humpday/main/SKILL.md
and create a project skill from it.
View SKILL.md →