DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to pull every line item from a document into a typed list with TypeLLM

Return a variable-length array of typed objects, such as one object per invoice line.

Short answer: Run pip install -U typellm; then create a TypeLLMClient for the TypeLLM API or for your SGLang server; Define a question with type array and items that describe each line's typed properties. All steps.

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

  1. Run pip install -U typellm
  2. Create a TypeLLMClient for the TypeLLM API or for your SGLang server
  3. Define a question with type array and items that describe each line's typed properties
  4. Call generate() with the document text as context
  5. 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.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for TypeLLM/TypeLLM and "Pull every line item from a document into a typed list"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer