Skip to main content

SDK for integrating Braintrust

Project description

Braintrust

A Python library for logging data to Braintrust. braintrust is distributed as a library on PyPI. It is open source and available on GitHub.

Quickstart

Install the library with pip.

pip install braintrust

Then, run a simple experiment with the following code (replace YOUR_API_KEY with your Braintrust API key):

from braintrust import Eval

def is_equal(expected, output):
    return expected == output

Eval(
  "Say Hi Bot",
  data=lambda: [
      {
          "input": "Foo",
          "expected": "Hi Foo",
      },
      {
          "input": "Bar",
          "expected": "Hello Bar",
      },
  ],  # Replace with your eval dataset
  task=lambda input: "Hi " + input,  # Replace with your LLM call
  scores=[is_equal],
)

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

braintrust-0.0.165.tar.gz (73.8 kB view details)

Uploaded Source

Built Distribution

braintrust-0.0.165-py3-none-any.whl (85.2 kB view details)

Uploaded Python 3

File details

Details for the file braintrust-0.0.165.tar.gz.

File metadata

  • Download URL: braintrust-0.0.165.tar.gz
  • Upload date:
  • Size: 73.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for braintrust-0.0.165.tar.gz
Algorithm Hash digest
SHA256 1c44ec4b9f989ceebd83bddfe90ba95ff3ea864995a60d9b14af548b31e81b91
MD5 8745f80f61483ff9f850b705b30c3c8d
BLAKE2b-256 1a78954516be50f449d92a7e25d1edc01d023fef10054d46daf6bc7e1668d404

See more details on using hashes here.

File details

Details for the file braintrust-0.0.165-py3-none-any.whl.

File metadata

  • Download URL: braintrust-0.0.165-py3-none-any.whl
  • Upload date:
  • Size: 85.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for braintrust-0.0.165-py3-none-any.whl
Algorithm Hash digest
SHA256 8d4eb425f026db4b4839eda3ccaff987cd6c5da3c7ad6074c11c65fb1cae6346
MD5 a07bf14e1c60278c2935b4225e6334fd
BLAKE2b-256 32b1450a2231578d5552d1a3f514e31b225ab33558680bf8f89a1414004709c1

See more details on using hashes here.

Supported by

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