Skip to main content

Python SDK 0.4.0 — validated answers, request budgets and warmup

Python SDK 0.4.0 validates typed answers, adds request budgets, Retry-After handling and event hooks, and adds local loading stages and warmup.

Upgrade notes​

Typed calls now reject malformed responses; raw predict remains available. See contracts/README.md for the timeout and resource ownership guarantees.

Changes​

  • Validate typed answers against request names, kinds, candidates and finite probability distributions. Raw predict remains available. Malformed responses previously accepted now fail explicitly.
  • Total request budgets, Retry-After with jitter, stable timeout and response errors, and metadata-only event hooks.
  • Local loading stages, runtime information and representative-request warmup; documented concurrency and ownership.
  • Versioned cross-language protocol and formula fixtures, and installed-package smoke tests.
  • Native asynchronous LLM comparisons, optional probability normalization and provenance diagnostics. Missing token counts are unknown, not zero.
  • Borrowed httpx clients are supported without transferring ownership; missing-answer lookup errors are clearer.

Install​

Terminal
python -m pip install valen-sdk==0.4.0 # HTTP clients
python -m pip install "valen-sdk[onnx]==0.4.0" # local CPU inference