Built for vLLM. Structure-D ingests PDFs, DOCX, HTML, images, and 11 other formats
and uses guided_json constrained decoding to guarantee schema-valid output at scale.
Drop-in support for OpenAI, Anthropic, Gemini, and Ollama when a GPU is not available.
or install the Rust CLI for native batch extraction
Everything you need
One place for documentation, AI reference, and release history.
Installation guides, configuration reference, and step-by-step tutorials for every feature — from basic extraction to advanced RAG pipelines.
Full API reference for the Pipeline, all LLM providers, schemas, validators, and storage writers. Typed signatures and live examples.
Every release documented. See what's changed, what's fixed, and what's on the roadmap for v0.3 and beyond.
Features
Parse PDFs, images, HTML, DOCX, XLSX, PPTX, emails, audio transcripts, and plain text through a unified async interface.
Define any Pydantic model as your extraction target. Built-in schemas for key-value, table, entity, form, classification, and summary.
Built for vLLM — guided_json constrained decoding guarantees schema-valid output at high throughput. OpenAI, Anthropic, Gemini, and Ollama available as drop-in alternatives.
Built-in DocumentReader, VectorStoreIndex, and QueryEngine. Plug in ChromaDB, pgvector, or any custom vector store.
Async-first pipeline with concurrent batch processing. Run hundreds of documents in parallel with configurable concurrency limits.
Automatic schema validation on every extraction. LLM retry with refined prompts on failure. Zero invalid JSON reaching your application.
Quick Start
Define a Pydantic model as your extraction schema, pass any file, get back validated results — automatically retried if the model output is invalid.
import asyncio
from pathlib import Path
from pydantic import BaseModel
from structure_d.pipeline import Pipeline
class Invoice(BaseModel):
vendor: str
total: float
line_items: list[str]
async def main():
pipeline = Pipeline(schema_cls=Invoice)
results = await pipeline.run(Path("invoice.pdf"))
print(results[0].structured_output)
# {"vendor": "Acme Corp", "total": 1240.0}
asyncio.run(main()) Architecture
Each stage is independently configurable and replaceable — override any component with your own implementation.
Supported input formats
Open Source · MIT License
No API key required for local models. Deploy as a FastAPI service or use the Rust CLI.
Start typing to search...