UiForm solves two major challenges in document processing with LLMs:

  1. Universal Document Processing: Convert any file type (PDFs, Excel, emails, etc.) into LLM-ready format without writing custom parsers
  2. Structured, Schema-driven Extraction: Get consistent, reliable outputs using schema-based prompt engineering

We see it as building Stripe for document processing.

Our goal is to make the process of analyzing documents and unstructured data as easy and transparent as possible.

Many people haven’t yet realized how powerful LLMs have become at document processing tasks - we’re here to help unlock these capabilities.


We currently support OpenAI, Anthropic, Gemini and xAI models.

You come with your own API key from your favorite AI provider, and we handle the rest.


Quickstart

1

Setup the Python SDK

2

Process your first document

3

Extract structured data

Setup the Python SDK

To get started, install the uiform package using pip:

pip install uiform

Then, create your API key on uiform.com and populate your env variables:

Process your first document

UiForm handles all the document preprocessing - no custom parsers needed. Let’s break this down into steps:

  1. First, initialize the UiForm client and pre-process your document:
from uiform import UiForm

# Initialize UiForm client
uiclient = UiForm()

# Convert any document into LLM-ready format
doc_msg = uiclient.documents.create_messages(
    document = "invoice.pdf"  # Works with PDFs, Excel, emails, etc.
)
  1. The doc_msg object contains the pre-processed document in a format ready for LLMs. Here’s what it looks like:
doc_msg.json
{
    "id": "doc_dd003f95-81ce-4a55-9180-00c5a58d82ec",
    "object": "document.message",
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "type": "text",
                    "text": "INVOICE\n\nABC Logistics Inc.\n123 Shipping Lane\nPort City, PC 12345\n\nBill To:\nXYZ Corporation\n456 Business Ave\nMetro City, MC 67890\n\nInvoice Number: INV-2024-0123\nInvoice Date: 2024-01-15\nDue Date: 2024-02-14\n\nDescription:\n1. Ocean Freight (20ft Container) - $2,500.00\n2. Documentation Fee - $150.00\n3. Terminal Handling Charges - $350.00\n4. Customs Clearance - $275.00\n\nSubtotal: $3,275.00\nTax (10%): $327.50\nTotal Amount: $3,602.50\n\nPayment Terms: Net 30\nBank Details:\nBank: Global Trade Bank\nAccount: 1234567890\nSwift: GTBKUS12\n\nThank you for your business!\n\nFor questions contact:\naccounts@abclogistics.com\n+1 (555) 123-4567"
                }
            ]
        }
    ],
    "created": 1736524416,
    "modality": "text",
    "document": {
        "id": "cf908729402d0796537bb91e63df5e339ce93b4cabdcac2f9a4f90592647e130",
        "name": "invoice.pdf",
        "mime_type": "application/pdf",
    }
}

It also contains other class methods like items, openai_messages, anthropic_messages, gemini_messages, xai_messages… See Document Methods for more details.

  1. Now you can use this pre-processed document with your preferred LLM provider:

Extract structured data with schema-based prompt engineering

We use a standard JSON Schema with custom annotations (X-SystemPrompt, X-FieldPrompt, and X-ReasoningPrompt) as a prompt-engineering framework for the extraction process.

These annotations help guide the LLM’s behavior and improve extraction accuracy. You can learn more about these in our JSON Schema documentation.

That’s it! You can start processing documents at scale. You have 1000 free requests to get started, and you can subscribe to the pro plan to get more.

But this minimalistic example is just the beginning. Continue reading to learn more about how to use UiForm to its full potential.


Go further

Now that you understand the basics, learn how to:


Jupyter Notebooks

You can view minimal notebooks that demonstrate how to use UiForm to process documents:


Community

Let’s create the future of document processing together!

Join our discord community to share tips, discuss best practices, and showcase what you build. Or just tweet at us.

We can’t wait to see how you’ll use UiForm.


Roadmap

We share our roadmap publicly on Github

Among the features we’re working on:

[ ] Node.js SDK [ ] Finetuning [ ] Prompt optimization [ ] Data-Labelling platform