Views
No views yet


1pip install lift-pdf
2
3# With vLLM (recommended, lightweight install)
4lift_vllm
5lift_extract input.pdf ./output --schema schema.json
6
7# With HuggingFace (requires torch)
8pip install lift-pdf[hf]
9lift_extract input.pdf ./output --schema schema.json --method hfstring, number, integer, boolean, arrays of those, arrays of objects, and nested objects are all supported. Write a description for any field whose name isn't self-explanatory, and mark a field required only when it must appear; fields genuinely absent from a document come back null.1{
2 "type": "object",
3 "properties": {
4 "invoice_number": {"type": "string", "description": "Invoice identifier"},
5 "total": {"type": "number", "description": "Total amount due"},
6 "line_items": {
7 "type": "array",
8 "items": {
9 "type": "object",
10 "properties": {
11 "description": {"type": "string"},
12 "amount": {"type": "number"}
13 }
14 }
15 }
16 },
17 "required": ["invoice_number", "total"]
18}1from lift import extract
2from lift.model import InferenceManager
3
4# Start the vLLM server first with: lift_vllm
5model = InferenceManager(method="vllm")
6result = extract("document.pdf", "schema.json", model=model)
7print(result.extraction)1from lift import extract
2from lift.model import InferenceManager
3
4# Loads datalab-to/lift in-process (requires: pip install lift-pdf[hf])
5model = InferenceManager(method="hf")
6result = extract("document.pdf", "schema.json", model=model)
7print(result.extraction)extract accepts the schema as a dict, a path to a .json file, an inline JSON string, or the name of a saved schema. Pass page_range="0-5" to limit PDF pages, and set VLLM_API_BASE to target a remote server.| Model | Size | Field accuracy | Full-document accuracy | Median latency* | Features |
|---|---|---|---|---|---|
| Datalab API | — | 95.9% | 44.4% | 30.8s | Citations + Verification |
| Gemini Flash 3.5 | — | 91.3% | 40.0% | 28.1s | |
| lift | 9B | 90.2% | 20.9% | 9.5s | |
| Azure Content Understanding | — | 83.4% | 22.2% | 73.7s | |
| NuExtract3 | 4B | 81.5% | 8.4% | 8.3s | |
| Qwen3.5-9B | 9B | 76.3% | 24.0% | 16.8s |
