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

How to use TypeLLM: what you can do with it

What is TypeLLM? TypeLLM is a Python library that makes open autoregressive LLMs return type-safe answers (strings, numbers, booleans, enum choices, objects and arrays) by constraining generation with JSON Schema, either through the hosted TypeLLM API or a model you serve with SGLang.

How do I use it? Run pip install -U typellm; then 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. Full steps below.

Trended earlier

View repo on GitHub

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

4 use cases

  • Extract typed fields from receipts into structured data

    Turn receipt text or images into merchant, total, expense type and reimbursable flags as typed values.

    View prompt
    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.
  • Route support tickets to the right team with fixed choices

    Assign each incoming ticket to one team from a fixed list, with a description for each choice.

    View prompt
    In the TypeLLM/TypeLLM repo, call TypeLLMClient.generate() on each ticket in <tickets_file> with a queue field whose choices are billing, technical, shipping and other, each with a description. Return a list of ticket IDs with their queue. Verify that every queue value is one of the four choices.
  • Pull every line item from a document into a typed list

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

    View prompt
    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.
  • Run typed extraction on your own GPU to keep data in-house

    Serve Qwen3.8-27B with SGLang and point TypeLLM at it so documents never leave your server.

    View prompt
    Set up TypeLLM/TypeLLM against an SGLang server at <server_url> serving Qwen/Qwen3.8-27B. Run TypeLLMClient.generate() on <document_path> with the questions in <questions_file> and return response.result. Verify that the model returned values for every field and no value falls outside its enum.

Quick start with TypeLLM

  1. Check you have what it needs: 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.
  2. Open TypeLLM/TypeLLM on GitHub and read the README and license.
  3. Run pip install -U typellm
  4. Run export TYPELLM_API_KEY="tl-sk-..." with your key from the API keys page
  5. Create a TypeLLMClient with your key and call generate() with the receipt text as context
  6. Define questions with type string, number and boolean, and an enum of expense types such as meal, travel and equipment

These steps come from our top use case, Extract typed fields from receipts into structured data, which also has a copy-paste agent prompt.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for TypeLLM/TypeLLM

Add Deduped to Claude Code once

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

Cursor, ChatGPT, others

Best AI repos for Work and operations

About this repo

  • Who it is forPython developers and data or operations teams who need structured fields extracted from text or images with answers that stay inside a fixed set of allowed values.
  • Why it is hot981 stars, launched 53 days ago
  • LanguagePython
  • Sourcegithub.com/TypeLLM/TypeLLM · Back to Hot repos

Requirements

  • 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

Add this badge to your README

Maintain TypeLLM? Show readers where to find these use cases. Use cases on Deduped

Markdown

[![Use cases on Deduped](https://dedupedai.com/badge/TypeLLM/TypeLLM.svg)](https://dedupedai.com/use-cases/typellm-typellm/?utm_source=github&utm_medium=badge&utm_campaign=TypeLLM-TypeLLM)

HTML

<a href="https://dedupedai.com/use-cases/typellm-typellm/?utm_source=github&amp;utm_medium=badge&amp;utm_campaign=TypeLLM-TypeLLM"><img src="https://dedupedai.com/badge/TypeLLM/TypeLLM.svg" alt="Use cases on Deduped" height="20"></a>

A static image, no tracking script. About the badge

Questions about TypeLLM

What is TypeLLM?

TypeLLM is a Python library that makes open autoregressive LLMs return type-safe answers (strings, numbers, booleans, enum choices, objects and arrays) by constraining generation with JSON Schema, either through the hosted TypeLLM API or a model you serve with SGLang. It is an open-source project on GitHub: https://github.com/TypeLLM/TypeLLM.

How do I use TypeLLM?

Run pip install -U typellm; then 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. The use cases on this page give the full steps and a copy-paste agent prompt for each job.

Who is TypeLLM for?

Python developers and data or operations teams who need structured fields extracted from text or images with answers that stay inside a fixed set of allowed values.

What can I do with TypeLLM?

4 use cases so far, for example: Extract typed fields from receipts into structured data; Route support tickets to the right team with fixed choices; Pull every line item from a document into a typed list. Each has steps and a copy-paste agent prompt.

What do I need to run TypeLLM?

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.

What are alternatives to TypeLLM?

Other hot AI repos in Work and operations: Open Maus Bot, Career Ops, Paperclip, n8n Skills, Nocodb.

Is TypeLLM safe to run?

Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.