Registry / llm-agents / tensorzero

tensorzero

JSON →
library2026.5.0pypypi✓ verified 85d ago

The Python client for TensorZero, an open-source platform for optimizing and evaluating LLM applications. Current version 2026.5.0, requires Python >=3.10. Released approximately monthly.

pip install tensorzero
INSTALL
IMPORT
SIG · TENSORZERO
T
tensorzero
llm-agentspythonv2026.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TensorZeroGateway
from tensorzero import TensorZeroGateway
from tensorzero import Client
The main client class was historically named 'Client' but is now 'TensorZeroGateway' in modern versions.
inference
from tensorzero import inference
Direct import of inference function

Initialize TensorZero client and make a simple inference.

from tensorzero import TensorZeroGateway # Initialize client pointing to your TensorZero gateway client = TensorZeroGateway(base_url='http://localhost:3000') # Make an inference response = client.inference( function_name='chatbot', input={ 'messages': [ {'role': 'user', 'content': 'Hello!'} ] } ) print(response['output']['content'])
Debug
Known issues
breakingVersion 2026.5.0 changes UI authentication: when gateway requires auth, UI now also requires auth.
fix
Ensure your gateway and UI authentication settings are consistent.
affects: >=2026.5.0
breakingVersion 2026.4.1 defaults to async observability writes, reducing tail latency.
fix
To restore synchronous writes, set `observability.async_writes = false` in gateway config.
affects: >=2026.4.1
breakingVersion 2026.2.2 changes config-file globbing: single-level wildcards no longer match across directories.
fix
Use `**` for recursive globbing, e.g., `--config-file **/*.toml`.
affects: >=2026.2.2
breakingVersion 2026.2.1 changes default `cache_options.enabled` from `write_only` to `off`.
fix
If you rely on caching, set `cache_options.enabled = 'write_only'` explicitly.
affects: >=2026.2.1
deprecatedLegacy inference evaluations format (flat under `[evaluators]`) is deprecated since 2026.3.4.
fix
Nest evaluators under functions: `[functions.my_func.evaluators.exact_match]`.
affects: >=2026.3.4
deprecatedThe `model_provider_name` filter for `extra_body` and `extra_headers` was removed in 2026.3.1.
fix
Use `model_name` and `provider_name` instead.
affects: >=2026.3.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tensorzero'
Package not installed or installed in wrong environment.
fix
Run `pip install tensorzero` in the correct Python environment (Python >=3.10).
ImportError: cannot import name 'Client' from 'tensorzero'
The client class was renamed from `Client` to `TensorZeroGateway` in a past breaking change.
fix
Use `from tensorzero import TensorZeroGateway` instead.
tensorzero.config.ConfigError: config file not found
The gateway requires a configuration file (e.g., `tensorzero.toml`) in the specified path.
fix
Ensure the config file exists and use `--config-file` with correct path (use `**/*.toml` for recursive search).
tensorzero.gateway.GatewayError: inference failed: ...
Inference request failed due to invalid input, missing API keys, or provider errors.
fix
Check the response status code and error message. Verify your input schema and ensure provider API keys are set.
Upgrade
Version history
2026.5.0latest on PyPI · released May 8, 2026
Audit
Dependencies
openaioptionalTensorZero wraps OpenAI-compatible APIs and may use client internally
httpxrequiredUsed for HTTP requests to the TensorZero gateway
Agent activity
40 hits · last 30 days
node
34
Bingbot
1
OpenAI (training)
1
Resources
tensorzero — pip install tensorzero · libregistry