Workshop notebook
This Colab notebook takes you from a first completion to a steered model in one sitting.
Run it:
workshop_student.ipynbin Colab
Prerequisites
- You need an API key. Account explains where to create one.
- You need a Google Account to run the notebook in Colab.
Open the notebook
In the student notebook, run the first code cell and paste your key when it asks for it, then run the other cells in order.
The workshop repository has the exercises and an instructor notebook with the solutions.
Notebook topics
- You make a first completion with a plain HTTP request to this API.
- You sample at different temperatures with a fixed
seedand see whattemperaturechanges. - You read the model's probabilities at each position with
logprobsandprompt_logprobs. - You read a model's activations with
output_residual_stream. - You steer the model to talk like a pirate with
apply_steering_vectors.
Next steps
- Steer a model with a contrast vector is the full version of the last exercise.
- Read logprobs at each generated token and score your own text cover the probability exercises in more detail.
- The Workbench lets you try prompts without any code.