Research preview. Apply for access. We review each application and email you when it's approved, with your API key ready on the API keys page.

Workshop notebook

This Colab notebook takes you from a first completion to a steered model in one sitting.

Run it: workshop_student.ipynb in 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

  1. You make a first completion with a plain HTTP request to this API.
  2. You sample at different temperatures with a fixed seed and see what temperature changes.
  3. You read the model's probabilities at each position with logprobs and prompt_logprobs.
  4. You read a model's activations with output_residual_stream.
  5. You steer the model to talk like a pirate with apply_steering_vectors.

Next steps