Getting Started
Set up Kalibr in 5 minutes.
You will learn:
- How to install the SDK
- How to track your first LLM call
- How to add workflow and customer context
Step 1: Install
pip install kalibr
Step 2: Get Your API Key
- Go to dashboard.kalibr.systems
- Sign up or log in
- Create an organization when prompted
- Click your email (top right) → API Keys → Create
- Copy your API key (starts with
sk_)
Step 3: Set Environment Variables
export KALIBR_API_KEY=sk_...
export KALIBR_COLLECTOR_URL=https://api.kalibr.systems/api/ingest
Both are required. KALIBR_API_KEY authenticates you. KALIBR_COLLECTOR_URL tells the SDK where to send traces.
Step 4: Add One Line
import kalibr # Add this line FIRST
import openai
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello"}]
)
Go to dashboard.kalibr.systems. You'll see your trace.
Adding Context
Track Workflows
Group related calls into a workflow:
import os
os.environ["KALIBR_WORKFLOW_ID"] = "research_pipeline"
Track Customers
Attribute costs to specific customers:
import os
os.environ["KALIBR_TENANT_ID"] = "acme_corp"
Track Non-LLM Operations
Use the @trace decorator:
from kalibr import trace
@trace(operation="fetch_docs", provider="database", model="postgres")
def fetch_documents(query):
return db.query(query)
Verify Setup
curl -H "X-API-Key: $KALIBR_API_KEY" https://api.kalibr.systems/health
Expected: {"status": "ok"}
Troubleshooting
| Problem | Solution |
|---|---|
| Traces not appearing | Check both KALIBR_API_KEY and KALIBR_COLLECTOR_URL are set |
| Import order | import kalibr must come before import openai |
| Network issues | Check connectivity to api.kalibr.systems |