SAIDEX — Structured AI Data Extraction
Extract validated Pydantic models from LLM responses — with automatic retry, field-level error feedback, an optional fallback model, and an agentic tool loop.
Works with any LangChain-compatible model: GPT-4o, Claude, Gemini, and local models via Ollama or vLLM. No tool-calling support required — use ExtractionMode.JSON for any chat model.
Installation
pip install saidex
With automatic OpenAI rate-limit handling:
pip install "saidex[openai]"
Quick start
import asyncio
from pydantic import BaseModel, Field
from langchain_openai import ChatOpenAI
from saidex import extract_data_from_text
class PersonInfo(BaseModel):
name: str
age: int
occupation: str
async def main():
llm = ChatOpenAI(model="gpt-4o-mini", temperature=0)
person, stats = await extract_data_from_text(
llm,
PersonInfo,
"Alice Müller, 34, works as a software engineer in Munich.",
)
print(person) # name='Alice Müller' age=34 occupation='software engineer'
print(stats.total_retries) # 0 — first attempt was valid
asyncio.run(main())
Key features
| Feature | Detail |
|---|---|
| Validated output | Pydantic validation with field-level error feedback fed back to the LLM for self-correction |
| Auto-retry | Configurable retries with exponential back-off for transient errors and rate limits |
| Fallback model | Pair a cheap primary with a powerful fallback — pay for the big model only when needed |
| No tool-calling required | ExtractionMode.JSON works with any chat model including local models via Ollama / vLLM |
| Agentic tool loop | Give the LLM your own tools (lookups, API calls) — it calls them freely, then delivers a validated final answer |
| Multimodal | Pass images via standard LangChain messages to any vision-capable model |
| LangChain-native | Plugs into any LangChain chat model; supports callbacks (Langfuse, LangSmith, …) |
LangGraph SaidexToolNode |
Drop-in ToolNode replacement (pip install "saidex[langgraph]") that repairs, validates and corrects tool calls before execution |
Links
License
Copyright 2026 Martin Lauff. Licensed under the Apache License, Version 2.0.
Metadata
Release files for saidex 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| saidex-0.8.0.tar.gz | 571.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| saidex-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 687.3 kB
Release files / saidex-0.8.0.tar.gz
| Download URL | saidex-0.8.0.tar.gz |
|---|---|
| Size | 571.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80dbf183aa0e297edd3001f1e7cef7eb9f1e0085cba231609fd784c69bbf0838
|
|
BLAKE2b-256 checksum How to use checksums |
1ef3b760ea0604dc1ae291e4444ec1268c529344e573178de9d8597598d81011
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency logRelease files / saidex-0.8.0-py3-none-any.whl
| Download URL | saidex-0.8.0-py3-none-any.whl |
|---|---|
| Size | 115.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92ed36fc5d3108d7dcd334ebeff24deef8893e4335bffe8e0c35d16d96e7757d
|
|
BLAKE2b-256 checksum How to use checksums |
4fa1b62c12c882714b03a2e36bcc7fe0a981b622c8eaae917eeaf81130945028
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.
Transparency log