Installation
Get Tracium set up in your Python project in minutes.
Requirements
- Python >=3.10 or higher
- pip (Python package installer)
Install from PyPI
The recommended way to install Tracium is via pip:
pip install traciumOr with a specific version:
pip install tracium==1.0.1Optional Dependencies
Tracium automatically detects and instruments libraries when they're imported. Install the libraries you plan to use:
LLM Providers
# OpenAI
pip install openai>=1.0.0
# Anthropic
pip install anthropic>=0.18.0
# Google AI
pip install google-generativeai>=0.3.0Frameworks
# LangChain
pip install langchain>=0.1.0
# LangGraph
pip install langgraph>=0.0.1Web Frameworks
# FastAPI
pip install fastapi uvicorn
# Flask
pip install flask
# Django
pip install django
# Celery
pip install celeryEnvironment Setup
Set your Tracium API key as an environment variable:
# Linux/macOS
export TRACIUM_API_KEY="sk_live_your_api_key_here"
# Windows (PowerShell)
$env:TRACIUM_API_KEY="sk_live_your_api_key_here"
# Windows (CMD)
set TRACIUM_API_KEY=sk_live_your_api_key_hereOr use a .env file with python-dotenv:
.envbash
# .env
TRACIUM_API_KEY=sk_live_your_api_key_here
TRACIUM_BASE_URL=https://api.tracium.ai # Optional: custom API endpointVerify Installation
Run this script to verify everything is set up correctly:
verify.pypython
import tracium
# This will raise an error if TRACIUM_API_KEY is not set
client = tracium.init()
print(f"Tracium v{tracium.__version__} initialized successfully!")
print(f"Client: {client}")Development Installation
If you want to contribute to Tracium or run from source:
# Clone the repository
git clone https://github.com/antonij-tracium/tracium-python.git
cd tracium-python/tracium
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in editable mode with dev dependencies
pip install -e ".[dev]"