Get up and running with Wisent in minutes. This guide walks you through installation and basic usage for steering and classification tasks.
Install Wisent directly from PyPI using pip.
pip install wisent
For GPU acceleration, make sure you have PyTorch with CUDA support installed. Wisent automatically detects available hardware and uses GPU when available.
Wisent provides a command-line interface for running benchmark tasks with classification or steering. Here are some examples to get you started.
python -m wisent tasks mmlu --model meta-llama/Llama-3.1-8B-Instruct --layer 15 --limit 10 --classifier-type logistic --verbose
python -m wisent tasks hellaswag --model meta-llama/Llama-3.1-8B-Instruct --layer 15 --limit 5 --steering-mode --steering-strength 1.0 --verbose
You can also use Wisent directly in your Python code for more control over the steering process.
from wisent import SteeringModel, ContrastivePairSet
# Load model and create steering
model = SteeringModel("meta-llama/Llama-3.1-8B-Instruct")
# Create contrastive pairs for the behavior you want to steer
pairs = ContrastivePairSet.from_file("pairs.json")
# Generate steering vector
vector = model.generate_steering_vector(pairs, layer=15)
# Apply steering during inference
response = model.generate(
"Your prompt here",
steering_vector=vector,
steering_strength=1.0
)Stay in the loop. Never miss out.
Subscribe to our newsletter and unlock Wisent insights.