🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

trainloop-evals-sdk

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trainloop-evals-sdk

TrainLoop Evaluations SDK for data collection and evaluation

0.1.13
PyPI
Maintainers
2

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()

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts