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 tracium

Or with a specific version:

pip install tracium==1.0.1

Optional 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.0

Frameworks

# LangChain
pip install langchain>=0.1.0

# LangGraph
pip install langgraph>=0.0.1

Web Frameworks

# FastAPI
pip install fastapi uvicorn

# Flask
pip install flask

# Django
pip install django

# Celery
pip install celery

Environment 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_here

Or 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 endpoint

Verify 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]"