Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Wisent
✓ from wisent import Wisent
✗ import wisent
Common mistake: importing the module directly, but the main class is `Wisent`.
WisentGuard
✓ from wisent import WisentGuard
✗ from wisent.guard import WisentGuard
In older versions, guards were in a submodule; now they are at the top level.
Basic example: initialize Wisent, decorate an OpenAI call to trace it.
from wisent import Wisent
from wisent.trace import openai_trace
import os
# Initialize Wisent (requires WISENT_API_KEY env var)
wis = Wisent(api_key=os.environ.get('WISENT_API_KEY', ''))
# Trace OpenAI calls
@openai_trace(wis)
def generate(prompt: str):
import openai
response = openai.ChatCompletion.create(
model='gpt-3.5-turbo',
messages=[{'role': 'user', 'content': prompt}]
)
return response['choices'][0]['message']['content']
# Run
print(generate('Say hello!'))
Debug
Known issues
breakingAPI key must be set via environment variable or constructor; not reading from config files.fixSet WISENT_API_KEY environment variable or pass api_key='your_key' to Wisent().
affects: >=0.11.0
breakingThe @openai_trace decorator changed signature in v0.11.0. Old 'guard' parameter is now 'guards' (list).fixUse `@openai_trace(wis, guards=[MyGuard()])` instead of `@openai_trace(wis, guard=MyGuard())`.
affects: >=0.11.0
deprecatedThe method `add_guard` is deprecated; use the `guards` parameter in the trace decorator.fixPass guards to @openai_trace(wis, guards=[...]).
affects: >=0.10.0 <0.12.0
gotchaWisent only supports OpenAI and Anthropic providers; other LLMs require custom instrumentation.fixUse the generic `@trace` decorator for custom providers.
affects: all
Errors
Common errors & fixes
WisentError: No API key found. Set WISENT_API_KEY environment variable.
Missing or unset API key.
fixExport WISENT_API_KEY or pass api_key to Wisent() constructor.
TypeError: openai_trace() got an unexpected keyword argument 'guard'
Using old 'guard' parameter instead of new 'guards'.
fixChange `guard=MyGuard()` to `guards=[MyGuard()]`.
ModuleNotFoundError: No module named 'wisent.guard'
Trying to import from submodule that no longer exists.
fixImport directly: `from wisent import WisentGuard`.
AttributeError: 'Wisent' object has no attribute 'start_trace'
Method renamed or removed in recent versions.
fixUse the `@openai_trace` decorator or `with wis.trace():` context manager.
Upgrade
Version history
0.11.81latest on PyPI · released Jun 15, 2026
Audit
Dependencies
No dependency data recorded yet.