Skip to main content

TrainLoop Evaluations SDK for data collection and evaluation

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

TrainLoop Evals SDK

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

Installation

pip install trainloop-evals-sdk

Usage

Data Collection

from trainloop_evals import collect

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

from anthropic import Anthropic
from openai import OpenAI



# 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"
)

IMPORTANT: The collect() function must be called in your entrypoint BEFORE you import any LLM clients. Otherwise their requests will not be patched!

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 for complete API reference.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trainloop_evals_sdk-0.2.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trainloop_evals_sdk-0.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file trainloop_evals_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: trainloop_evals_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Darwin/24.2.0

File hashes

Hashes for trainloop_evals_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ae0dce9a853d5fc21550022ceac41fff0d10765eed7dd5edb0a03fc2da6beaa1
MD5 a290a8b9de8f25dc3015ba3fca30d32a
BLAKE2b-256 6e5c1a79ec931cd65e1370c9b4fd348da9301e2c286f095fbd3d2609f6bbd0e7

See more details on using hashes here.

File details

Details for the file trainloop_evals_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trainloop_evals_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f22ed088b254f76c04999723436b37e67d223c6b3a42430238d9daaf61cd022a
MD5 86b5fcebec5c8fad292816e1bc31dc9a
BLAKE2b-256 20d5c0c47d785fbfaa185d5d768a8c96117f8a15ba41657c26e22645cb017ec1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page