Examples
Examples are a great place to start learning about Gage and Inspect.
View examples on GitHubSetup
Before running examples, clone the gage-inspect repository and setup
a virtual environment.
Clone gage-inspect:
git clone git@github.com:gageml/gage-inspect.git
Initialize a virtual environment.
cd gage-inspect uv venv
Active the virtual environment using the instructions provided by uv.
For example, to activate the virtual environment in Bash, run:
source .venv/bin/activate
Install the project dependencies.
uv pip install . gage-cli
Check your setup.
gage status
View the list of available example tasks.
gage task list
Model setup
To run most examples, you need model support.
Default model
You can define a default model be setting either the GAGE_MODEL or
INSPECT_EVAL_MODEL environment variables.
To use OpenAI GPT 4.1 by default, run the following in Bash:
export GAGE_MODEL=openai/gpt-4.1
Python support
Gage does not install model specific Python packages. You need to install the packages for the models you use.
Refer to Inspect Model Providers for a complete list of supported models and their required Python packages.
If you’re using an OpenAI model, install the openai package:
uv pip install openai
Model permission
Unless you’re running a local model, you need permission to make model calls. Set the applicable environment variable to the API key or token issued by the provider.
For OpenAI, set OPENAI_API_KEY.
export OPENAI_API_KEY="<API key>"
Run an example
Run the funny task (this task is created in Get started).
gage run funny --input cats --model openai/gpt-4.1-mini --yes
If you get an error, check the steps above. If the task still does not run, open an issue and we’ll help.