Quick Start

Get up and running with Wisent in minutes. This guide walks you through installation and basic usage for steering and classification tasks.

Installation

Install Wisent directly from PyPI using pip.

Install Wisent
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.

Basic Usage

Wisent provides a command-line interface for running benchmark tasks with classification or steering. Here are some examples to get you started.

MMLU benchmark with classification
python -m wisent tasks mmlu --model meta-llama/Llama-3.1-8B-Instruct --layer 15 --limit 10 --classifier-type logistic --verbose
HellaSwag benchmark with steering
python -m wisent tasks hellaswag --model meta-llama/Llama-3.1-8B-Instruct --layer 15 --limit 5 --steering-mode --steering-strength 1.0 --verbose

Python API

You can also use Wisent directly in your Python code for more control over the steering process.

Basic Python Usage
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
)

Next Steps

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.