Installation
Requirements
- Python 3.10 or higher
- pip or uv package manager
Basic Installation
Install the core mantisdk package:
pip install mantisdkOr using uv:
uv pip install mantisdkOptional Dependencies
Mantis SDK provides optional dependency groups for specific integrations:
Agent Frameworks
# All agent frameworks
pip install mantisdk[agents]
# Specific frameworks
pip install mantisdk[langchain] # LangChain + LangGraph
pip install mantisdk[dspy] # DSPy
pip install mantisdk[crewai] # CrewAITraining & Optimization
# Automatic Prompt Optimization
pip install mantisdk[apo]
# VERL training (requires GPU)
pip install mantisdk[verl]
# TRL integration
pip install mantisdk[trl]LLM Proxy
# LLMProxy feature (note: has strict dependency pins for boto3, grpcio, uvicorn)
pip install 'mantisdk[proxy]'Note: The
[proxy]extra includeslitellm[proxy]which has strict dependency pins forboto3,grpcio, anduvicornthat may conflict with other packages in your environment. Only install this if you need the LLMProxy feature.
Storage Backends
# MongoDB support
pip install mantisdk[mongo]RAG Support
# RAG with FAISS and sentence-transformers
pip install mantisdk[rag]Full Installation
For development or to install all optional dependencies:
pip install mantisdk[agents,apo,mongo,rag]Verify Installation
After installation, verify the SDK is working:
import mantisdk.tracing as tracing
# Should print version info
print(f"Mantis SDK installed successfully")
# Initialize (will use no-op tracer if no credentials)
tracing.init()
print("Tracing initialized")Environment Setup
Create a .env file in your project root:
# Insight credentials (required for trace export)
INSIGHT_HOST=https://insight.withmetis.ai
INSIGHT_PUBLIC_KEY=pk-lf-your-public-key
INSIGHT_SECRET_KEY=sk-lf-your-secret-key
# LLM API keys (for your agent)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=...Load environment variables in your code:
from dotenv import load_dotenv
load_dotenv()
import mantisdk.tracing as tracing
tracing.init() # Auto-detects credentials from environmentNext Steps
- Quickstart Guide - Get tracing working in 5 minutes
- Tracing Overview - Learn the core concepts
- Integrations - Set up framework-specific instrumentation