Skip to main content

aischemagate

AISchemaGate — thin alias package over contractgate for LLM structured-output validation. Same Rust engine, same cg_live_... API keys, same tenant service, same backend as DataContractGate.

pip install aischemagate

Why this package exists

The underlying engine, SDK, and API are DataContractGate — one validator, one gateway. aischemagate is the LLM / AI-agent-shaped front door: it re-exports contractgate under a name that reads correctly from the LLM-output-validation angle. Use whichever import name matches your mental model; the behavior is identical.

See:

  • aischemagate.com — product site
  • aischemagate.dev — developer documentation
  • RFC-094 (docs/rfcs/094-sdk-llm-output-guard.md) — SDK design

10-line quickstart

import os
from aischemagate import LLMGate
from openai import OpenAI

gate = LLMGate(
    api_key=os.environ["CONTRACTGATE_API_KEY"],
    contract_id="extract_invoice_v1",
    llm=OpenAI(),
)
result = gate.completion(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Extract invoice JSON from: ..."}],
    response_format={"type": "json_object"},
    auto_repair=True,
)
if result.ok:
    forward_downstream(result.payload)   # egress-sanitized; safe to forward

For Anthropic, call gate.message(model="claude-sonnet-4-5", messages=[...]). For vLLM / Ollama OpenAI-compat, call gate.completion(...) unchanged.

What's new

See CHANGELOG.md and the parent contractgate CHANGELOG — the alias version tracks initial release only; feature work is versioned on contractgate.

Metadata

Release files for aischemagate 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aischemagate 0.3.1
File Size Uploaded
aischemagate-0.3.1.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aischemagate 0.3.1
File Interpreter ABI Platform
aischemagate-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / aischemagate-0.3.1.tar.gz

Download URL aischemagate-0.3.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3078b4844f4abcaf9d91704c081bc671690015fcf9a7e98d57167a1f28d93c7f
BLAKE2b-256 checksum
How to use checksums
eec95ccc5a8733cb16533921e54b9c4fa546095e07ed7e13421ad19d63f3ec1b
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 13, 2026.

Transparency log

Release files / aischemagate-0.3.1-py3-none-any.whl

Download URL aischemagate-0.3.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52814a836d3ad1bf1db818d618bbde4e729a61f27e9909227c5bbadb352ad2ea
BLAKE2b-256 checksum
How to use checksums
5762320b5d2058a9d1ff055e39bea6be1fff31f2a3372ff648493160abff99c1
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 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.2

2 release files

This release

0.3.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page