v0.2.1 — Analytics, A/B Testing & Resilience

The AI orchestration toolkit you can trust

Build production LLM applications with guaranteed structured output, intelligent failover, and data-driven optimization.

MIT LicensePython 3.9+OpenAI, Anthropic, Gemini, Ollama
from parsec import EnforcementEngine
from parsec.models.adapters import OpenAIAdapter
from parsec.validators import PydanticValidator
from pydantic import BaseModel

class User(BaseModel):
    name: str
    email: str
    age: int

# Setup with automatic validation
adapter = OpenAIAdapter(api_key="...", model="gpt-4o-mini")
validator = PydanticValidator()
engine = EnforcementEngine(adapter, validator)

# Get guaranteed valid output
result = await engine.enforce(
    "Extract: John Doe, john@example.com, 30 years old",
    User
)

print(result.data)
# User(name='John Doe', email='john@example.com', age=30)

Production-grade from day one

Everything you need to build reliable LLM applications

Guaranteed Structure

Automatic validation and repair with JSON Schema and Pydantic. Never parse malformed JSON again.

Built-in Resilience

Circuit breakers, retry policies, and automatic failover keep your apps running when LLMs fail.

Data-Driven Optimization

Track performance metrics and A/B test prompts with statistical significance testing built-in.

Provider Agnostic

One API for OpenAI, Anthropic, Gemini, and Ollama. Switch providers or run A/B tests without code changes.

Version-Controlled Prompts

Manage prompts as code with semantic versioning, YAML persistence, and type-safe variables.

Intelligent Caching

LRU caching with TTL reduces API costs and improves response times. Monitor with built-in analytics.

Built for real-world applications

Data Extraction at Scale

Extract structured data from documents, emails, and unstructured text with guaranteed schema compliance.

API Response Generation

Ensure LLM-powered endpoints always return valid JSON. Automatic validation prevents malformed responses.

Multi-Step Workflows

Chain LLM calls with confidence. Validated outputs become reliable inputs, enabling complex agent workflows.

Classification & Routing

Get predictable categories and labels for routing logic. A/B test prompts to maximize accuracy.

4
LLM Providers
100%
Schema Compliance
0.2.1
Latest Version

Stop fighting with LLM outputs

Install with pip and start building reliable LLM applications in minutes.

pip install parsec-llm