docs/en/observability/langtrace.mdx
Langtrace is an open-source, external tool that helps you set up observability and evaluations for Large Language Models (LLMs), LLM frameworks, and Vector Databases. While not built directly into CrewAI, Langtrace can be used alongside CrewAI to gain deep visibility into the cost, latency, and performance of your CrewAI Agents. This integration allows you to log hyperparameters, monitor performance regressions, and establish a process for continuous improvement of your Agents.
```bash
pip install langtrace-python-sdk
```
```python
from langtrace_python_sdk import langtrace
langtrace.init(api_key='<LANGTRACE_API_KEY>')
# Now import CrewAI modules
from crewai import Agent, Task, Crew
```
LLM Token and Cost Tracking
Trace Graph for Execution Steps
Dataset Curation with Manual Annotation
Prompt Versioning and Management
Prompt Playground with Model Comparisons
Testing and Evaluations