Slip Copier — AI Web

Turn photos of handwritten slips into a sheet: vision model, OCR, zod, privacy, cost. 14 levels, played right in the browser with nothing to install.

What you learn in this game

A web app can send an image to a vision model (vision-language model): the image and the prompt go in together, and the answer is text. To fill a form, that text has to become structured data, not a paragraph. There are levels to it: ask for the format in the prompt, give a schema to follow, or limit the tokens the model may write so that only JSON matching the schema can come out. Big APIs call it structured output or JSON mode. Here the kecamatan's server does it to SmolVLM: every token that would break the JSON shape gets a probability of zero.

OCR (optical character recognition) turns a picture of text into text, usually line by line, and can run on your own device. A vision model takes an image and a prompt together and answers in text. Both can be wrong. What decides between them is not their names but what they produce on the papers really in the drawer.

A vision model does not read pixels one by one. The image is cut into tiles, and each tile becomes a number of image tokens read together with the prompt's text tokens. SmolVLM uses 512-pixel tiles and 64 tokens a tile. So the size of an image is a cost: a server that counts tokens charges more for a bigger photo, and the model takes longer to read it.

zod checks data while the program runs: Slip.safeParse(data) returns success or a list of issues, each with a path (which field) and a message. For AI output, a schema is the last fence before the data is used. It does not make the model smarter, but it makes sure an impossible shape does not slip quietly into the sheet.

Human in the loop: AI does the easy part, a person checks the doubtful part. The key is the rule that chooses: too loose and mistakes get in, too strict and the person checks everything. The signals at hand include the schema's rules, the model's confidence (the probability of the tokens it wrote), a disagreement between two readers, and rules from experience with the papers themselves.

Changing an AI setting without measuring it is a guess. Evaluation needs a test set with known answers, and a way of scoring that fits the task. Three ways are common: exact match, a metric per part (here per field), and a model as judge (LLM-as-judge). A judge is cheap to set up, but it is a model itself, it can be wrong, and it tends to agree.