Who it is forA data engineer who must load invoices or order forms where the number of line items changes from document to document.
The problemFixed-field extraction cannot handle a document with an unknown number of rows, and parsing free text into rows is fragile.
The outcomeOne call returns a list where each item is a dict with the fields you defined, one item per line in the document.
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 - Create a TypeLLMClient for the Type LLM API or for your SGLang server
- Define a question with type array and items that describe each line's typed properties
- Call generate() with the document text as context
- Load the returned list of dicts into your table
Prompt for your agent
Using the TypeLLM/TypeLLM package, extract every line item from <document_path> as an array of objects with description, quantity and unit_price. Return the list from response.result. Verify the count of items matches the number of line rows you can see in the document.
Caveat. The README gives different item limits for the hosted API (200 items a call) and self-hosted use (50 items a call in its comparison table), so split very long documents into batches.
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