Foldbun Stack Cookbook
Each use case solves one real problem end to end: the constraints, the pipeline of API calls, the code, what a run measured and what it cost. The code runs as it is, in the languages listed in the matrix, and the numbers come from recorded runs.
Use cases by language
Section titled “Use cases by language”A mark means the use case has an implementation in that language. Choosing a language filters the list and selects the same language in the code tabs of every page.
Language
| Use case | Without a key | Python | TypeScript | Go | curl |
|---|---|---|---|---|---|
| 00 First callCheck the key, upload an image, read its text with ppocr-v6 and see what the call cost. | Everything | ||||
| 01 Pre-label an image dataset from text promptsSegment a folder of images in batches from text prompts, accept confident labels, queue the uncertain ones for review and export COCO and YOLO-seg. | Smoke run | – | – | ||
| 02 Click-to-segment component with a key-holding backendSegment one object with a few clicks in the browser: a small backend holds the key, uploads each image once and sends every click to sam-lite; a click simulator measures clicks, quality and cost. | Smoke run | – | |||
| 03 Receipts and invoices to validated JSONRead receipts with ppocr-v6, extract the fields by rules, check that the sums add up, and read only the items that fail again with paddleocr-vl. | Smoke run | – | |||
| 04 Scanned documents to Markdown chunks for a search indexParse every page with paddleocr-vl, remove headers and footers that repeat across pages, and cut the text into chunks that keep tables whole and carry page, box and heading path. | Smoke run | – | – | – | |
| 05 Search an image library by image, by text, and for near-duplicatesEmbed a library with dinov3 and siglip2, keep the vectors in a local index that is updated incrementally, and answer image, text and near-duplicate queries with exact cosine search. | Smoke run | – | – | ||
| 06 Marketplace photos to catalogue imagesCut the product out of each photo with birefnet, check the cut-out locally with four quality rules, and compose the ones that pass into 1200 x 1200 white-background WebP images with a soft shadow; the rest go to a review list with the reason. | Smoke run | – | – | – | |
| 08 Monitor cost and latency of a production integrationWrap the client to export Prometheus metrics from the billing and timing of every answer (credits by model and unit, cache hits and what they saved, queue and processing time, balance), and trip a spend guard before the budget is gone. | Smoke run | – | – | – |