title | description | icon |
---|---|---|
Agent Monitoring with Langtrace |
How to monitor cost, latency, and performance of CrewAI Agents using Langtrace, an external observability tool. |
chart-line |
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.
Sign up by visiting [https://langtrace.ai/signup](https://langtrace.ai/signup). Set the project type to `CrewAI` and generate an API key. Use the following command:```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
- Monitor the token usage and associated costs for each CrewAI agent interaction.
-
Trace Graph for Execution Steps
- Visualize the execution flow of your CrewAI tasks, including latency and logs.
- Useful for identifying bottlenecks in your agent workflows.
-
Dataset Curation with Manual Annotation
- Create datasets from your CrewAI task outputs for future training or evaluation.
-
Prompt Versioning and Management
- Keep track of different versions of prompts used in your CrewAI agents.
- Useful for A/B testing and optimizing agent performance.
-
Prompt Playground with Model Comparisons
- Test and compare different prompts and models for your CrewAI agents before deployment.
-
Testing and Evaluations
- Set up automated tests for your CrewAI agents and tasks.