System One Python Adapter Guide
Open-source drop-in replacement for typesafe_sdk backed by general LLM APIs for offline development and testing.
What It Solves & Overview
system-one-adapter-python provides a drop-in replacement for the typesafe_sdk evaluation API, backed by standard LLM providers (OpenAI, Anthropic) instead of TypeSafe. It enables local testing, cost comparison, and staging simulation without live TypeSafe production credentials.
Suitability & Fit
When to Use
- Local developer testing and CI pipelines without TypeSafe API keys.
- Benchmarking TypeSafe decision performance against standard LLM prompt completion.
- Staging environments requiring mocked or alternative model backends.
When NOT to Use
- Ultra-low-latency production hot paths where native System One speeds (<150ms) are required.
- Environments requiring mathematically calibrated probabilities without prompt variability.
Installation & Setup
pip install "system-one-adapter[openai]"
# or with anthropic
pip install "system-one-adapter[anthropic]" Offline Contract Verification Example
Verification Notice: The code snippet below demonstrates local structural validation of inputs and choice schemas without requiring live network credentials. Real-world API execution requires active connectivity and API credentials.
# Offline interface compatibility verification
from dataclasses import dataclass
@dataclass
class AdapterConfig:
provider: str
structured_outputs: bool
llm_answer_mode: str
cfg = AdapterConfig(provider="openai", structured_outputs=True, llm_answer_mode="probabilities")
print("Adapter interface configured offline:", cfg.provider) Prerequisites & Operational Boundaries
Prerequisites
- Python 3.10+.
- API keys for alternative providers (e.g. OPENAI_API_KEY) if running live LLM tests.
Known Limitations
- Inherits standard LLM latency (1-4s) and token costs when backed by general models.
- Probabilities are approximated via token logits or prompt parsing rather than native decision calibration.
Official Source Provenance
This guide is compiled and fact-checked against official upstream assets: