Skip to main content

SAIDEX — Structured AI Data Extraction

CI PyPI Python 3.10+ License: Apache 2.0

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

saidex-0.7.0.tar.gz (451.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saidex-0.7.0-py3-none-any.whl (80.5 kB view details)

Uploaded Python 3

File details

Details for the file saidex-0.7.0.tar.gz.

File metadata

  • Download URL: saidex-0.7.0.tar.gz
  • Upload date:
  • Size: 451.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for saidex-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c40b560974a244b7eef7e337cee66bdfab5ce408b7efcc58efe95c2202818f36
MD5 4ae09b5eb819c779e07b4e4a30f9b10d
BLAKE2b-256 59eb22a7e9023e276b3ab41a866397bb60b9d144d94e92c296eee256b7ef7d6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for saidex-0.7.0.tar.gz:

Publisher: release.yml on mlauf-labs/SAIDEX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file saidex-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: saidex-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 80.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for saidex-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e63854f8eae6b98fd6b3cb92547de9514c1e504f2d6d6bbcb3e14f78c9c6864
MD5 f3b5646a74a22472e6ae161a2d7c2087
BLAKE2b-256 6bedcc1ec9920eaff2c1778b8f51c09f334bf60477428210fc28ee1ffc6a9ed4

See more details on using hashes here.

Provenance

The following attestation bundles were made for saidex-0.7.0-py3-none-any.whl:

Publisher: release.yml on mlauf-labs/SAIDEX

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page