Skip to main content

Python SDK 0.3.0 — compare Valen with an LLM

Python SDK 0.3.0 adds Valen.llm(provider, model): the same Decisions and SystemOne requests answered by an OpenAI-compatible, Anthropic or Gemini model, with the same typed responses.

Highlights​

  • Valen.llm(provider, model) answers the same Decisions and SystemOne requests with an OpenAI-compatible, Anthropic or Gemini model and returns the same typed responses, so Valen and an LLM can be compared on the same questions with the same decision code. See "Compare with an LLM" in the README.
  • Usage counts tokens across retries and latency; every provider request and response is kept in debug["llm_attempts"].
  • Malformed output is corrected; truncation and refusals raise ValenAPIError with error.debug.

Changes​

  • Video inputs are sent to LLMs as frames; valen-sdk[video] now includes Pillow.
  • Usage token counts may be None when a provider omits them.
  • No new base dependencies and no request/response schema change.

Validation​

Published through PyPI Trusted Publishing from tag v0.3.0; the files attached to the GitHub release are the PyPI files. The downloaded wheel passed SHA256 verification, its Python source matched the tag, and installed in a clean environment it passed 42 contract tests (tests/test_server.py needs the server extra).

Install​

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