Skip to main content

Crilio

Test your AI prompts before they reach your users.

Crilio helps you check that an AI assistant gives the answers you expect. You write a few prompts and rules in crilio.yaml, then Crilio runs them and shows which rules passed or failed.

PyPI Python License: MIT

Why use Crilio?

AI responses can change when you update a prompt or model. Crilio helps you catch problems such as:

  • a refund answer with the wrong number of days;
  • an answer that mentions a competitor;
  • a response that is not valid JSON;
  • a reply that is not polite or does not follow your instructions.

Your tests stay in your project, so they can be reviewed and run alongside your code.

Get started

1. Install Crilio

pip install crilio

2. Add your OpenAI key

export OPENAI_API_KEY="sk-proj-..."

You can also put the key in a .env file. Do not commit that file.

3. Create your tests

crilio init

This creates crilio.yaml with an example you can edit.

4. Check and run your tests

# Check your file without using the API
crilio run --dry-run

# Run the tests
crilio run

You will see each test, its response, and whether each rule passed or failed.

Your crilio.yaml

Here is a small example:

settings:
  target_model: "gpt-4o"
  judge_model: "gpt-4o-mini"

tests:
  - name: "Refund answer"
    prompt: "How long do I have to return a product?"
    rules:
      - "Must mention the 30-day return window."
      - "Must NOT mention competitor names."

  - name: "JSON answer"
    prompt: |
      Return only this JSON:
      {"status": "shipped", "order_id": "12345"}
    rules:
      - "Must return valid JSON with status and order_id."
      - "Must NOT include extra text."

Write rules as simple, clear instructions:

rules:
  - "Must mention the support email address."
  - "Must NOT make up a delivery date."

Each test needs a unique name, a prompt, and at least one rule.

Commands

crilio init

Creates a new crilio.yaml.

Use --force if you want to replace an existing file. Use --yes when running without questions, such as in a script.

crilio run

Runs the tests in crilio.yaml.

crilio run
crilio run --dry-run
crilio run --verbose
crilio run --json
crilio run --config tests/crilio.yaml
crilio run --model gpt-4o
crilio run --judge-model gpt-4o-mini
  • --dry-run checks the file without calling OpenAI.
  • --verbose shows the complete AI response.
  • --json prints results in a format suitable for other tools.
  • --config uses a different YAML file.
  • --model changes the model that answers your prompt.
  • --judge-model changes the model that checks the answer.

You can also use:

crilio --help
crilio --version
crilio --docs

GitHub Actions

When you run crilio init in a terminal, Crilio asks whether you want to create a GitHub Actions workflow for pull requests. The workflow runs:

pip install crilio
crilio run

Add OPENAI_API_KEY to your repository secrets. A failed test blocks the pull request in GitHub Actions. Locally, a failed test is reported without blocking your shell workflow.

Supported provider

Crilio currently supports OpenAI.

Provider Environment variable
OpenAI OPENAI_API_KEY

Your key is used to communicate directly with OpenAI. Crilio does not receive or store it.

Development

git clone https://github.com/crilio/crilio
cd crilio
python -m venv .venv
source .venv/bin/activate
pip install -e .
pip install pytest
pytest -q

License

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crilio-0.0.1.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crilio-0.0.1-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file crilio-0.0.1.tar.gz.

File metadata

  • Download URL: crilio-0.0.1.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.9

File hashes

Hashes for crilio-0.0.1.tar.gz
Algorithm Hash digest
SHA256 51db8061207c0c322aa45fe8579a8a6342f95f8563822665caaa215e1ea99e0b
MD5 7f951547237085c80694087e46740320
BLAKE2b-256 29d7ddf172b5640f865dd5fb69cfbd18c19b51d3af1ea97276d55a259a052dda

See more details on using hashes here.

File details

Details for the file crilio-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: crilio-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.9

File hashes

Hashes for crilio-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a160b429804d08612499f0672f929d153a9f8beffd11ca7fe95e3f8418b99d1d
MD5 4f0bc1ea9d0064b54d2f004f69a78a4b
BLAKE2b-256 9b0fdeb9b6bf51bdbdfce8330d87bee2aa2d7e62e69c735e31858860c3705c04

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page