Skip to main content

Gage Inspect

Gage Inspect extends Inspect AI to support general LLM app development and running tasks in production endpoints. It's designed for programmers who want to build LLM applications that leverage Inspect AI for evaluations.

Inspect AI is open source software used by the AI safety community, AI labs, and the general community for defining and running evaluations.

Gage Inspect works with Gage CLI, a set of command line tools that enable programmer workflows for building and improving Inspect AI tasks.

Gage Inspect is available as open source software under the MIT license.

Visit Gage documentation for a more complete guide to using Gage.

Motivation

Gage integrates with Inspect AI to enable eval drive development. Evaluation support is built into your code from day one. Measure in development and test to improve your application and establish baselines. Measure in production to catch regressions and outliers.

Quick start

To use this library, install it using pip.

pip install gage-inspect

Here's a simple Inspect task that can be run from the command line.

from inspect_ai import Task, task
from inspect_ai.solver import generate, prompt_template
from gage_inspect.task import run_task

@task
def funny():
    return Task(
        solver=[
            prompt_template("Say something funny about {prompt} in 5 words or less"),
            generate(),
        ]
    )

if __name__ == "__main__":
    import sys
    resp = run_task(
        funny(),
        input=sys.argv[1],
        model=sys.argv[2],
    )
    print(resp.completion)

To run this task from the command line, save the code to a file named funny.py.

For OpenAI models, install the openai Python package.

pip install openai

Specify your API key for OpenAI using OPENAI_API_KEY.

export OPENAI_API_KEY='*****'

Run the task from the command line.

python funny.py cats openai/gpt-4.1

Task endpoint

Use FastAPI to create an HTTP endpoint for the task.

Save this code to a file named serve.py:

from fastapi import FastAPI
from gage_inspect.task import run_task
from funny import funny

app = FastAPI()

@app.get("/funny/{topic}")
def get_funny(topic, model="openai/gpt-4.1"):
    resp = run_task(funny(), topic, model=model)
    return resp.completion

This code requires the fastapi[standard] package.

pip install fastapi[standard]

Start an endpoint using the fastapi command.

fastapi run serve.py

Call the task using curl:

curl localhost:8000/funny/cats

For a more detailed example of serving a task, see examples/add.

Evaluate the task

Modify funny.py to add a scorer with sample.

from inspect_ai import Task, task
from inspect_ai.solver import generate, prompt_template
from gage_inspect.dataset import dataset
from gage_inspect.scorer import llm_judge

@task
def funny():
    return Task(
        solver=[
            prompt_template("Say something funny about {prompt} in 5 words or less"),
            generate(),
        ],
        scorer=llm_judge(),
    )

@dataset
def samples():
    return ["birds", "cows", "cats", "corn", "barns"]

Evaluate this task using Inspect AI.

INSPECT_EVAL_MODEL=openai/gpt-4.1 inspect eval funny.py

Alternative, use the Gage CLI.

Install gage-cli.

pip install gage-cli

Use gage eval to run the task. Gage asks for input and calls Inspect AI to run the eval.

gage eval funny

Use either Inspect AI View to examine the eval logs.

Inspect View is a web app that runs locally.

inspect view

Visit http://127.0.0.1:7575 to view the Inspect logs.

Alternatively, use Gage Review. Gage Review is a terminal based application that provides an alternative interface to Inspect logs.

gage review

For more information on Gage CLI, see the gage-cli project.

  • Use Inspect AI commands for advanced applications or where Gage's simplified interfaces are insufficient.

  • Use Gage CLI for dialog based commands and terminal based log reviews.

Contributing

See our contribution policy.

Metadata

Release files for gage-inspect 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gage-inspect 0.2.1
File Size Uploaded Provenance Actions
gage_inspect-0.2.1.tar.gz 30.5 kB Without provenance Details for gage_inspect-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gage-inspect 0.2.1
File Interpreter ABI Platform Actions
gage_inspect-0.2.1-py3-none-any.whl Python 3 none any Details for gage_inspect-0.2.1-py3-none-any.whl

Total release size: 73.1 kB

Release files / gage_inspect-0.2.1.tar.gz

Download URL gage_inspect-0.2.1.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8ff5a751328bd096c5b8bbe4297e8d0690eaf55a9ed43be755a949edf3abdc1b
BLAKE2b-256 checksum
How to use checksums
2022b7508825775049f6abae7b12f2d20fc7f69ac0df6371a58643ffbe34932c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gage_inspect-0.2.1-py3-none-any.whl

Download URL gage_inspect-0.2.1-py3-none-any.whl
Size 42.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34bdda55f18517feaffe8b920c95c7e4251286b970fea0508eb115af9d5b040d
BLAKE2b-256 checksum
How to use checksums
eb9007b7230dd50242d40cb15f60e091f786a25ab19fad7b2300d0834342832d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for gage-inspect 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page