Metadata-Version: 2.3
Name: trainloop-evals-sdk
Version: 0.1.6
Summary: TrainLoop Evaluations SDK for data collection and evaluation
Author: Mason Pierce
Author-email: masonpierce@trainloop.ai
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: requests (>=2.31.0,<3.0.0)
Description-Content-Type: text/markdown

# TrainLoop Evals SDK

A lightweight Python SDK for collecting, submitting, and evaluating LLM responses with TrainLoop.

## Installation

```bash
pip install trainloop-evals-sdk
```

## Usage

### Data Collection

```python
from trainloop_evals import collect

# Set this up during the initialization of your application
# to collect data from all LLM calls
collect()

# Annotate llm calls with the trainloop_tag parameter
# the sdk will intelligently remove the parameter and collect information about the llm call
import openai

openai.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "2+2"}],
    trainloop_tag="math.addition"
)
```

## Configuration

The SDK can be configured using environment variables:
- `TRAINLOOP_DATA_FOLDER`: Directory where the registry file will be saved. If this is not set, `collect()` becomes a no-op.

## Advanced Usage

See the [documentation](https://docs.trainloop.ai/evals/sdk) for complete API reference.

