Running it through the Vercel AI Gateway
Parlour reaches Jev through the Vercel AI Gateway with one server-side key, and reads live per-token prices from the Gateway's model catalogue, so the cost counter on screen is a real number and not a constant.
- Secrets
- one: AI_GATEWAY_API_KEY, server-side only
- Model
- PARLOUR_MODEL, default typesafe-ai/jev
- Price source
- the Gateway model catalogue, cached one hour
- No key
- the house brain, and the UI says so
One key, no client surface
There is exactly one secret and it never reaches the browser. Every call is made on the server inside the simulation loop, so there is no NEXT_PUBLIC_* anything and nothing to inline into a bundle. A watcher's browser talks to a stream of simulation frames and to nothing else.
Live prices, not a hardcoded rate
lib/sim/pricing.ts pulls per-token prices from the Gateway catalogue, caches them for an hour, and falls back to a deliberately conservative constant if the catalogue is unreachable. An over-stated meter beats a crashed room. The counter on the party UI then reads like a buy-in that ticks up while you watch.
Because model ids and prices come from the Gateway and not from the code, changing model is PARLOUR_MODEL and nothing else. Anything that is not an evaluation model will simply not answer the question pack.
Failure modes
No key, a failed call, and an exhausted hourly budget all land in the same place: the room drops to the house brain, keeps playing, and says which brain it is on. There is no state in which this site shows you an error instead of a party.
Read next
typesafe-ai/jev, and what Parlour uses it for
Jev is the evaluation model Parlour runs on. It answers nine typed questions per character per beat in one call, is billed on input tokens only, and costs roughly three cents for a five-minute party.
The house brain: running with no model at all
The house brain is a deterministic personality heuristic that answers the same nine questions and synthesises its own distributions, so the simulation stays watchable, and tunable, with no API key and no network.
Two guard rails on a public LLM toy
Nothing ticks in a room nobody has opened. A party already under way plays to its end and then stops. A rolling hourly cap drops a room to the house brain past a fixed dollar figure.
What a live LLM simulation actually costs
A Parlour party runs five or six minutes on roughly 250–300 evaluation calls of about 3,000 input tokens each, which is three to four cents. Every watcher of a room shares one party, so the bill does not grow with the audience.