Skip to content

Settings

Settings

Bases: _BaseSettings

Which backend to build; everything else lives on its config.

Source code in system_one/settings.py
class Settings(_BaseSettings):
    """Which backend to build; everything else lives on its config."""

    backend: Literal["http", "onnx", "stub"] = "http"

backend class-attribute instance-attribute

backend: Literal['http', 'onnx', 'stub'] = 'http'

HTTPConfig

Bases: BackendConfig

Any endpoint speaking the System One contract.

Source code in system_one/settings.py
class HTTPConfig(BackendConfig):
    """Any endpoint speaking the System One contract."""

    requires_api_key: ClassVar[bool] = False

    base_url: str
    path: str = "/v1/systemone"
    api_key: SecretStr | None = None
    timeout: float = 10.0
    max_retries: int = 2

    @model_validator(mode="after")
    def _check_api_key(self) -> HTTPConfig:
        if self.requires_api_key and self.api_key is None:
            message = "api_key is required: set SYSTEM_ONE_API_KEY"
            raise ValueError(message)
        return self

requires_api_key class-attribute

requires_api_key: bool = False

base_url instance-attribute

base_url: str

path class-attribute instance-attribute

path: str = '/v1/systemone'

api_key class-attribute instance-attribute

api_key: SecretStr | None = None

timeout class-attribute instance-attribute

timeout: float = 10.0

max_retries class-attribute instance-attribute

max_retries: int = 2

TypesafeConfig

Bases: HTTPConfig

Typesafe's hosted jev, preset. Needs SYSTEM_ONE_API_KEY.

Source code in system_one/settings.py
class TypesafeConfig(HTTPConfig):
    """Typesafe's hosted jev, preset. Needs `SYSTEM_ONE_API_KEY`."""

    requires_api_key = True
    default_model = "jev-latest"
    base_url: str = "https://api.typesafe.ai"

requires_api_key class-attribute instance-attribute

requires_api_key = True

default_model class-attribute instance-attribute

default_model = 'jev-latest'

base_url class-attribute instance-attribute

base_url: str = 'https://api.typesafe.ai'

OpenRouterConfig

Bases: HTTPConfig

OpenRouter's decisions endpoint, preset. Needs SYSTEM_ONE_API_KEY.

Source code in system_one/settings.py
class OpenRouterConfig(HTTPConfig):
    """OpenRouter's decisions endpoint, preset. Needs `SYSTEM_ONE_API_KEY`."""

    requires_api_key = True
    default_model = "typesafe/jev-latest"
    base_url: str = "https://openrouter.ai"
    path: str = "/api/alpha/decisions"

requires_api_key class-attribute instance-attribute

requires_api_key = True

default_model class-attribute instance-attribute

default_model = 'typesafe/jev-latest'

base_url class-attribute instance-attribute

base_url: str = 'https://openrouter.ai'

path class-attribute instance-attribute

path: str = '/api/alpha/decisions'

ONNXConfig

Bases: BackendConfig

Where the local graph lives, and which one to load.

Source code in system_one/settings.py
class ONNXConfig(BackendConfig):
    """Where the local graph lives, and which one to load."""

    default_model = DEFAULT_NAME
    onnx_dir: Path = Path("onnx")

default_model class-attribute instance-attribute

default_model = DEFAULT_NAME

onnx_dir class-attribute instance-attribute

onnx_dir: Path = Path('onnx')