Backends
Protocols
Backend
Bases: Protocol
What SystemOne needs from a backend.
Source code in system_one/backends/__init__.py
model
instance-attribute
The model to ask when neither the call nor SYSTEM_ONE_MODEL names one.
AsyncBackend
Bases: Protocol
The same two methods as Backend, awaited.
Source code in system_one/backends/__init__.py
ask
async
ask(request: SystemOneInput) -> SystemOneOutput
Source code in system_one/backends/__init__.py
close
async
Source code in system_one/backends/__init__.py
create_backend
The sync backend named by settings.backend.
Source code in system_one/backends/__init__.py
create_async_backend
create_async_backend(
settings: Settings, config: BackendConfig | None = None
) -> AsyncBackend
The async backend named by settings.backend.
Source code in system_one/backends/__init__.py
HTTP
HTTPBackend
Bases: BaseHTTPBackend
Talks to any vendor implementing the System One contract over HTTP.
Source code in system_one/backends/http.py
ask
ask(request: SystemOneInput) -> SystemOneOutput
AsyncHTTPBackend
Bases: BaseHTTPBackend
The async counterpart of HTTPBackend, sharing its config and retry policy.
Source code in system_one/backends/http.py
ask
async
ask(request: SystemOneInput) -> SystemOneOutput
ONNX
ONNXBackend
Runs the exported graph in-process. No torch, no transformers, no network.
Source code in system_one/backends/onnx.py
ask
ask(request: SystemOneInput) -> SystemOneOutput
Source code in system_one/backends/onnx.py
AsyncONNXBackend
The sync backend on a worker thread — ONNX Runtime releases the GIL anyway.
Source code in system_one/backends/onnx.py
ask
async
ask(request: SystemOneInput) -> SystemOneOutput