Registry / llm-agents / wisent

wisent

JSON →
library0.11.81pypypi✓ verified 85d ago

Wisent (version 0.11.6) is a Python library to monitor, log, and influence AI model outputs in real-time. It provides a lightweight agent for tracing LLM calls and injecting interventions such as content moderation, jailbreak detection, and custom logic. Released on a monthly cadence.

pip install wisent
INSTALL
IMPORT
SIG · WISENT
W
wisent
llm-agentspythonv0.11.81
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
timeout
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.
fix
Set 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).
fix
Use `@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.
fix
Pass 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.
fix
Use 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.
fix
Export 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'.
fix
Change `guard=MyGuard()` to `guards=[MyGuard()]`.
ModuleNotFoundError: No module named 'wisent.guard'
Trying to import from submodule that no longer exists.
fix
Import directly: `from wisent import WisentGuard`.
AttributeError: 'Wisent' object has no attribute 'start_trace'
Method renamed or removed in recent versions.
fix
Use 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.

Agent activity
49 hits · last 30 days
node
42
Perplexity
1
OpenAI (training)
1
Resources
wisent — pip install wisent · libregistry