Under the hood
Ask
How the Ask box works, and what it costs me.
The Ask box on my home page answers questions about my work, using only what I’ve published here: the home page, my CV, the About page and my articles. None of the numbers below are typed in by hand. They’re read from the site’s settings, its sources and the last eval run every time it builds.
In this build: Preview · live answers are off for now, but the suggested questions still work
The route
The pages themselves are static, served from Vercel’s CDN. When you ask a question, it goes to a single function in Dublin (dub1). That function first checks your limits and my small daily budget in Firestore (in Belgium), then calls Gemini on Vertex AI in the EU. It signs in to Google Cloud with Workload Identity Federation, so there’s no API key stored anywhere. Just in case, I’ve also put a spend cap on the Google Cloud project, so the bill can’t keep growing.
Under each answer you can follow the route it took, step by step:
- guard
- Before anything is counted, it checks the question for prompt injection and for questions about customers or confidential work. If it finds one, you get a fixed reply, the model isn’t called and it costs nothing.
- retrieve
- There’s no search step. Every question is sent with all the passages and the rules, about 11,857 tokens. This step shows how many passages the answer ended up citing.
- model
- Gemini on Vertex AI, with one turn, no tools and at most 400 output tokens. It replies in JSON with the answer, the passages it cites and the language it answered in. This step shows the tokens in and out and how long the call took.
- eval
- Every passage the answer cites gets looked up. If none of them check out, you get a safe reply instead of a guess.
- ship
- The answer, how long it all took and what the model call cost, estimated at list price from the token counts Google reports.
The suggested questions have answers written ahead of time, from the same passages. Clicking one never reaches the server, which is why its route shows the model as not called and a cost of $0.0000. If you just type a greeting, your browser answers that one too.
Model
- Name
- not configured
- Region
- not configured
- Function
- Dublin (dub1)
- List prices
- not configured
These are read when the page is built. The costs shown on the route are estimates at these list prices, marked “est., list price”.
Limits
- You
- 3 live questions in any 24 hours
- Your network
- 10 live questions in any 24 hours
- Everyone
- 150 model calls a day
- Daily budget
- not configured
- Bursts
- 10 questions in 10 minutes per network
- Size
- 500 characters in, 400 tokens out, one turn
Only questions that reach the model count, so suggested questions, greetings and the guard’s replies are free. When you’ve used yours, the box will tell you. The daily budget keeps my bill small, and if a check fails or is too slow, the model isn’t called at all.
Guardrails
The guard runs before the counters and the model, and it looks for two kinds of question: prompt_injection (trying to make it ignore its rules, play a role or reveal its instructions) and confidentiality (asking about customers, or about internal or unreleased work). Before it checks, it undoes the usual tricks, like look-alike letters, digits instead of letters, spaced-out words and invisible characters. It also recognises the common injection and confidentiality questions in Spanish, Italian, German, French, Dutch and Swedish, and the override and role-play ones in Portuguese.
If it catches one, you get one of these two replies and nothing is counted:
- I’ll stick to my instructions, thanks. I can only answer from what’s on this site, so ask me about my work, my writing or the languages I speak.
- I can’t talk about customers or their work, but I’m happy to tell you how I work in general.
The model gets the same rules, and if an answer ever repeats its instructions, it’s swapped for the first reply. Unit tests keep the guard in check, with probes that must be blocked and ordinary questions that must get through. The golden set has 31 cases: 11 fact, 3 language, 3 out-of-scope, 4 customer, 4 injection, 5 harmful, 1 length.
Citations
The model can only answer from 147 passages cut from the same pages I listed at the top. Each passage has an id, and the model has to cite the ones it used. Every citation is checked against that list, and made-up ones are dropped. If an answer is left without a valid citation, it’s replaced with:
I haven’t written about that, so I’d rather not guess. Ask me something about my work or my articles instead.
The sources under each answer link to the pages it used.
Privacy
I don’t store your question. I don’t log its text either. To count your questions, the function keeps a random id for your browser (in a signed cookie, __session, for 30 days, and only when live answers are on) and a keyed hash of your network, never your actual IP address. Each one holds at most a day of timestamps. Apart from that, the site only keeps a daily total of questions and spend.
Suggested questions and greetings never leave your browser. The only services involved are Vercel (the pages, the function and cookieless analytics) and Google Cloud (the model and the counters).
Evals
Nothing here yet. I run the golden cases against the real model myself, and the results will show up here after the first one.