Correctover validates every LLM response across 6 dimensions before accepting it. This is the core differentiator: standard failover checks HTTP 200. Correctover verifies the contract. P50 = 22µs, P99 = 99µs.
| Contract | Dimension | What It Validates | P50 |
|---|---|---|---|
Contract.structure() | Structure | JSON schema compliance, required fields | 8µs |
Contract.schema() | Schema | Field types match expected schema | 5µs |
Contract.latency() | Latency | Response time within SLA threshold | 1µs |
Contract.cost() | Cost | Token usage within budget | 2µs |
Contract.identity() | Identity | Model identity matches (no substitution) | 3µs |
Contract.integrity() | Integrity | Semantic coherence, no hallucinations | 22µs |
Validates that the response conforms to a JSON Schema definition. Catches missing fields, wrong field types, and malformed responses.
Contract.structure(
name="output_shape",
schema={
"type": "object",
"properties": {
"answer": {"type": "string"},
"confidence": {"type": "number"},
"citations": {
"type": "array",
"items": {"type": "string"},
"minItems": 1
}
},
"required": ["answer", "confidence"]
}
)
Detects when the response structure drifts from the expected type — e.g. a provider returns Markdown instead of JSON, or changes field types.
Contract.schema(
name="field_types",
field_types={
"temperature": float,
"steps": list,
"metadata.duration_ms": (int, float),
}
)
Enforces response time SLAs. If a provider's response exceeds the threshold, it counts as a contract failure and triggers failover.
Contract.latency(
name="p95_sla",
max_ms=5000, # Soft threshold
hard_max_ms=10000, # Hard cutoff
)
Prevents cost overruns from unexpected token usage. Particularly useful when failover lands on a more expensive model.
Contract.cost(
name="budget",
max_cents=2.0,
alert_on_exceed=True,
)
Verifies the responding model matches what was requested. Detects silent model substitution — when a provider serves a cheaper model than billed.
Contract.identity(
name="model_check",
expected="gpt-4o-2024-11-20",
allow_aliases=True, # gpt-4o-2024-08-06 also OK
)
The most advanced dimension. Uses semantic coherence checks to detect hallucinations, contradictions, and nonsensical output.
Contract.integrity(
name="semantic_check",
anti_hallucination=True,
self_consistency=True,
coherence_threshold=0.7,
)
Multiple contracts run in parallel on each response. All must pass for the response to be validated=True.
response = provider.complete(
messages=[...],
contracts=[
Contract.structure("format", output_schema),
Contract.latency("sla", max_ms=5000),
Contract.cost("budget", max_cents=1.0),
]
)
if response.validated:
# All 3 contracts passed
print(response.metrics.contract_results)
# → {"format": True, "sla": True, "budget": True}