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.
- 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.
Cookie banners and pop-ups
Many screenshots showed a consent wall or newsletter pop-up instead of the site. Each tier only handles what the tiers before it couldn't.
| Tier | What it does | Model |
|---|---|---|
| Triage | Checks the existing screenshots for anything covering the page | Vision |
| Known tools and rules | Matches consent tools (Borlabs, Cookiebot, Usercentrics, OneTrust and others) and German and English button labels | No |
| Page structure | Finds covering elements from fixed position, screen coverage, dialog roles, scroll lock and backdrops | No |
| Decision | Sends a short JSON description of each overlay; the model picks a button ID and an action, with a screenshot only if unsure | Text, then vision |
| Verify | Replays the recipe in a fresh browser with the production code, then checks again | Vision |
| Tier | Sites |
|---|---|
| No blocker, no recipe needed | 247 |
| Label rules | 49 |
| Consent-tool library | 31 |
| Text model | 19 |
| Mix of tiers | 7 |
| Vision model | 1 |
About 80 of the roughly 107 recipes came from code alone. A model decided 27 sites, and consent dialogs stopped appearing in the weekly screenshots.
mistral-small found 5–6 of 6 blockers in a 24-screenshot test, against 4
for ministral-8b at about the same price. The model can only click buttons the code
found, never off-site links, form submits or inputs, and bot checks are left alone.
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.
| Stage | What it does | Model |
|---|---|---|
| S1–S3 | Fetch the homepage and candidate pages over plain HTTP, then score link text ("aktuell", "current"), large images and exhibition dates | No |
| S4 | Text tie-break between candidates | Text, switched off |
| S5 | Playwright opens the page, applies the consent recipe and scrolls to the first artwork | No |
| S6 | Pairwise 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.
| Design | Million tokens |
|---|---|
| Models in every weekly run (estimated) | 52M |
| Everything sent to Mistral this year | 1.41M |
| Design choice | Tokens saved |
|---|---|
| Models at build time, not in every weekly run | 0 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 page | 0 tie-break calls instead of ~345,000 tokens (100%) |
| Compact JSON instead of raw HTML | Inputs ~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:
| Metric | Mistral pipeline | Claude Code |
|---|---|---|
| Model calls | 1,065 | 479 |
| 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.