Getting Started¶
Installation¶
Driftcut requires Python 3.12 or later.
# Clone and install from source (PyPI package coming soon)
git clone https://github.com/riccardomerenda/driftcut.git
cd driftcut
pip install -e .
Prepare your corpus¶
Driftcut needs a structured prompt corpus — the real prompts your system uses in production. Each prompt must have a category and criticality level.
id,category,prompt,criticality,expected_output_type,notes
cx-001,customer_support,"Draft a response to: 'I want a refund'",high,free_text,
ex-001,extraction,"Extract entities from: 'Alice at Acme Corp'",high,json,Must return valid JSON
cl-001,classification,"Classify this review as positive/negative",medium,labels,
Required fields¶
| Field | Type | Values |
|---|---|---|
id |
string | Unique identifier |
category |
string | e.g. customer_support, extraction |
prompt |
string | The prompt to execute |
criticality |
enum | low, medium, high |
expected_output_type |
enum | free_text, json, labels, markdown |
notes |
string | Optional context |
Create a config file¶
Compare models from different providers (requires both API keys):
Compare models from the same provider (one API key):
Use OpenRouter to access any model with a single API key:
Use api_base for Azure, proxies, or self-hosted models:
Driftcut uses LiteLLM under the hood — any LiteLLM-supported provider works.
Set your API keys¶
The run command calls real model APIs. Set the environment variable for your provider(s):
# Set the key(s) for the providers in your config
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENROUTER_API_KEY="sk-or-..."
Only the providers used in your config need keys. The validate command does not require API keys.
Validate your setup¶
Before spending any money on API calls, validate that your config and corpus are correct:
This prints a summary of your config, corpus stats, and sampling plan — without making any API calls.
Run a migration test¶
Driftcut will:
- Sample representative batches from your corpus
- Run both models on each batch concurrently
- Track latency (p50, p95) and cost per category
- Export results to
driftcut-results/results.json
Decision engine coming soon
The run command executes the migration and collects results. The automatic stop/continue/proceed decision engine is under development.