Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

System One Adapter

A drop-in replacement for typesafe_sdk's system_one evaluation API, backed by LLM APIs instead of TypeSafe.

Useful for comparing TypeSafe against an LLM on cost/speed/intelligence.

Install

The provider SDKs are optional extras — install the one(s) you use:

pip install 'system-one-adapter[openai]'      # OpenAI-compatible providers
pip install 'system-one-adapter[anthropic]'   # native Anthropic

Usage

Unlike TypeSafeClient, the client is configured with how the LLM should answer, and each call names a provider alongside the model:

from system_one_adapter import SystemOneAdapterClient, Noul, Score, Choice

client = SystemOneAdapterClient(
    structured_outputs=True,  # use the provider's native structured-output mode
    llm_answer_mode="probabilities",  # or "discrete"
    normalize_probabilities=True,
)

response = client.system_one(
    state="This book was a delight to read.",
    questions={"positive": Noul(instructions="The book review is positive.")},
    provider="openai",  # "openai" or "anthropic"
    model="gpt-4o-mini",
)

provider and model may also be set on the constructor as defaults. provider is required unless model is a Provider instance (e.g. a custom OpenAI-compatible endpoint):

from system_one_adapter.providers import OpenAIProvider

client.system_one(state, questions, model=OpenAIProvider("grok-4", base_url="https://api.x.ai/v1"))

Response

The response is a typesafe_sdk.SystemOneResponse subclass — same answers and typed views — with two additions:

  • response.usage adds input_tokens_total / output_tokens_total (across retries), n_retries, n_retries_malformed_structure, and latency.
  • response.debug holds retry_reasons and probability-normalization diagnostics.

It is a msgspec.Struct like every SDK response, so serialize it the same way (there is no model_dump):

import msgspec

print(msgspec.json.encode(response).decode())

Async

AsyncSystemOneAdapterClient mirrors the sync client with await client.system_one(...) and async with.

Options

Option Meaning
structured_outputs Use the provider's native structured output, else prompt for JSON and validate client-side (works with any chat model).
llm_answer_mode "probabilities" (per-label distribution) or "discrete" (one value per question).
normalize_probabilities Rescale invalid LLM probability distributions to sum to 1.
n_retry_malformed_structure Corrective retries when the model's output fails schema validation.
retry typesafe_sdk.RetryPolicy for transient provider failures.

Release files for system-one-adapter 0.0.1a0

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

Source distribution (sdist)

Source distribution for system-one-adapter 0.0.1a0
File Size Uploaded
system_one_adapter-0.0.1a0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for system-one-adapter 0.0.1a0
File Interpreter ABI Platform
system_one_adapter-0.0.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / system_one_adapter-0.0.1a0.tar.gz

Download URL system_one_adapter-0.0.1a0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
aadddc8ef98f52744a090edb09d77f4b8398ddc61d6975ed35ba8d25ef579ab3
BLAKE2b-256 checksum
How to use checksums
6da9691db3a0e663e89dcbcf818b039f90a70e3b22dba70dbea91da3eca2d35a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / system_one_adapter-0.0.1a0-py3-none-any.whl

Download URL system_one_adapter-0.0.1a0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a68b52e744b39fd9fa690b84b84fe0621f14d9dc916be2cc202c4c33dd62085c
BLAKE2b-256 checksum
How to use checksums
54826a9f95b21f88f5231b09c58d26d83ba1f074e5f5725feceb2c775fd589db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

0.2.1

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

This release

0.0.1a0 This release

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