Case study

Berlin Art Galleries

A weekly screenshot grid of about 350 Berlin galleries, museums and project spaces. I built Mistral text and vision models into the pipeline to clear cookie banners and find each site's current exhibition, while keeping the weekly run free of model calls.

berlinartgalleries.de

Berlin art sites, captured weekly
~350
model calls in the weekly run
0
sites where a model chose the pop-up fix
27
sites now showing the current exhibition
232
fewer tokens a year than models in every run
~97%
less input per call than an agent turn
~130×

Design principles

  • Models at build time, not run time.

    A model decides once per site and the decision is saved as a fixed recipe. The weekly run replays it with plain code.

  • Code first, models last.

    Free checks on known patterns, page structure and HTML come first. A model only sees the sites code could not settle.

  • Models choose from a list.

    Models get a short JSON summary or a downscaled screenshot and pick the ID of a button or page that code found. They never write a selector or URL.

  • Checked and measured.

    Every recipe is replayed and re-checked before it is saved, and every AI step was tested against hand-checked examples before it was kept.

Current exhibition pages

A gallery's homepage often shows a logo or a news list. The better page is usually "Current exhibition" or "Aktuell", which differs per site and changes every few weeks.

Exhibition page stages and whether each uses a model
StageWhat it doesModel
S1–S3Fetch the homepage and candidate pages over plain HTTP, then score link text ("aktuell", "current"), large images and exhibition datesNo
S4Text tie-break between candidatesText, switched off
S5Playwright opens the page, applies the consent recipe and scrolls to the first artworkNo
S6Pairwise check against the homepage: which shows more current artwork, and is either blocked?Vision

On 30 sites I labelled by hand, the rules alone picked the right page for 26. The vision check costs one of those but never swaps a homepage for an error page or a page with no art. The text tie-break lowered accuracy, so it is off. 232 sites now show an exhibition page; 122 keep the homepage, each with a recorded reason.

Token savings

Every Mistral answer is cached with its token usage: 1,065 calls and 1.41 million tokens, experiments included. Each choice below is compared with the simpler alternative.

Tokens per year, in millions
DesignMillion tokens
Models in every weekly run (estimated) 52M
Everything sent to Mistral this year 1.41M
Token savings by design choice
Design choiceTokens saved
Models at build time, not in every weekly run0 tokens a week instead of ~994,000 (~97% a year)
Code checks before the model for pop-up buttons~30,000 tokens instead of ~203,000 (85%)
Rules choose the exhibition page0 tie-break calls instead of ~345,000 tokens (100%)
Compact JSON instead of raw HTMLInputs ~16–40× smaller (estimated)

A scripted pipeline vs. an AI agent session

A pipeline call sends a short fixed prompt and one site's input. An agent like Claude Code re-sends the whole conversation every turn. Measured from the three Claude Code sessions that built these pipelines:

Mistral pipeline compared with Claude Code sessions
MetricMistral pipelineClaude Code
Model calls1,065479
Input tokens~1.36 million~83 million
Average input per call~1,300~174,000

That's about 130× the input per call, though about 99% of it was cheaper cached context. The two do different jobs: the agent built the pipeline, and the pipeline makes the repeated decisions.

How it was built, and lessons

I built the pipelines with Claude Code from written plans that estimated cost before any model was called, and made the product decisions myself. Other features deliberately use no AI: finding new venues, the planned "recently updated" block, and cached Google Places data.

  • Put the model in the build step.

    One model call that produces a saved recipe serves every weekly run after it.

  • Test the cheap options.

    A smaller model and a smaller image were measurably worse at the same price. 768 px screenshots cost about 1.8× as much as 512 px and are worth it.

  • Keep a human reference set.

    A 30-site hand-labelled gold set decided which changes stayed, including switching off an AI step.

  • Use the agent to build the tool.

    An agent's large context is worth it once, to design and debug. The tool then makes hundreds of narrow decisions with small prompts.