Who it is forAn finance or operations analyst who must turn many receipts into rows for expense reports and needs every field in the right type.
The problemFree-text model output is hard to load into a spreadsheet or database because amounts, categories and yes/no answers arrive in inconsistent formats.
The outcomeEach receipt returns a dict with a string merchant, a float total, one enum expense type, and a boolean reimbursable value, ready to load.
What you need first
- Python with pip installed
- A TypeLLM API key from typellm.ai (includes $5 free credit), or a GPU server running SGLang with a compatible model such as Qwen3.8-27B
- Documents or text to process, and a list of the fields you want back
Steps
- Run
pip install -U typellm - Run
export TYPELLM_API_KEY="tl-sk-..."with your key from the API keys page - Create a TypeLLMClient with your key and call generate() with the receipt text as context
- Define questions with type string, number and boolean, and an enum of expense types such as meal, travel and equipment
- Read the typed values from response.result and write them to your expense table
Prompt for your agent
Use the Python package typellm in the repo TypeLLM/TypeLLM to extract merchant, total, expense_type and reimbursable from the receipt text at <receipt_path>. Call TypeLLMClient.generate() with an enum for expense_type and return response.result as JSON. Verify that expense_type is one of the enum values and total is a number.
Caveat. The README example uses a text receipt; for scanned receipts, the README shows image input with a vision-language model, so check that your chosen model supports images before you rely on it.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page