helgesverre/extractor
Extractor is a Laravel package that uses OpenAI to pull structured data out of images, PDFs, emails, Word docs, and web pages. Define fields, get arrays or Spatie data objects back—no custom parsing logic needed.
OPENAI_BASE_URI (Ollama, Together, Groq) plus Azure override support lets you treat model choice as an experiment variable — cost, latency, and data-residency options stay open. You are not voting for OpenAI permanently by adopting this.Text::pdf, Text::text) → structured fields → image/vision last. The Vision feature is explicitly WIP; don't put image extraction on a committed roadmap until you've spiked it.fields() API with nested schemas covers most list-of-subitems cases (line items, work history) without custom classes.data objects means extraction feeds your existing validation, DTOs, and persistence — no parallel serialization layer, no new conventions for the team to learn.Consider it when:
Look elsewhere when:
One structural caveat for the adoption decision: 226 stars, zero dependents, and a single maintainer. Treat it as code you may need to fork. Pin the version, wrap it behind an internal extraction interface, and keep the swap to a managed document AI service a contained change.
To executives: This package compresses several weeks of LLM integration work — multi-format document parsing, structured JSON output, typed DTOs — into a few days, under an MIT license with effectively zero switching cost. It lets us validate demand for document automation with a small, metered inference spend instead of a headcount or platform commitment, and it unlocks backlog items (receipt capture, CV parsing, contact enrichment) that currently need manual entry. The risk is bounded: it's a thin wrapper we can replace or fork, and the only durable spend is per-request inference that scales with usage.
To engineering: Thin, idiomatic Laravel — facades, JSON-mode responses, Spatie data output, a custom-extractor registry for domain prompts, and a swappable base URI so we're not locked to one provider. Known gaps we own: no built-in retries, caching, cost controls, or eval harness; the Vision path is WIP; single maintainer with no downstream dependents, so we pin and wrap it.
The ask: a two-week spike — 100 labeled documents, three success metrics (per-field accuracy, straight-through rate, cost per document), and a go/no-go on whether the review UI or a managed document-AI vendor is the real next investment.
How can I help you explore Laravel packages today?