Python API: Readiness check

Checks that the engine, keys and providers work before you ship. Generated from the docstrings and type hints of criogenai 0.1.7. See also: Python API overview, the same module in TypeScript.

ready(): one call that says whether CriogenAI can work here, for start-up checks and health endpoints.

It never raises; it reports. (In Python the engine is part of the wheel, which pip only installs on systems it runs on, so if import criogenai worked the engine loads.)

from criogenai import ready, ready_sync

Contents#

NameKindSummary
readyfunctionChecks the engine and, with model, that the model answers.
ready_syncfunctionready for scripts (not inside an event loop).

ready#

async def ready(model: Any = None, timeout: float = 30.0) -> Dict[str, Any]

Checks the engine and, with model, that the model answers.

The model check is one small call (the agent is asked to reply OK, with a limit of one model call). Failures are reported, never raised.

Parameters

  • model (Any, default None): A model string (e.g. "openai:gpt-5-mini") or model object to check. Default: check only the engine.
  • timeout (float, default 30.0): The longest the model check may take, in seconds. Default 30.

Returns: {"ok", "engine", "model"}. ok is True when everything checked works. engine holds ok, platform, arch and libc. model (only when a model was given) holds ok, model (its name), latency_ms and, on failure, error and code.

Example

from criogenai import ready

report = await ready("openai:gpt-5-mini", timeout=10)
if not report["ok"]:
    print(report["model"].get("code"), report["model"].get("error"))

ready_sync#

def ready_sync(model: Any = None, timeout: float = 30.0) -> Dict[str, Any]

ready for scripts (not inside an event loop).

Parameters

  • model (Any, default None): As for ready.
  • timeout (float, default 30.0): As for ready, in seconds. Default 30.

Returns: {"ok", "engine", "model"}. ok is True when everything checked works. engine holds ok, platform, arch and libc. model (only when a model was given) holds ok, model (its name), latency_ms and, on failure, error and code.

Example

from criogenai import ready_sync

print(ready_sync()["engine"])   # {"ok": True, "platform": ..., "arch": ..., "libc": ...}