Skip to main content

Tools for testing, debugging, and evaluating LLM features.

Project description

Baserun

Twitter

Baserun is the testing and observability platform for LLM apps.

Quick Start

1. Install Baserun

pip install baserun

2. Generate an API key

Create an account at https://baserun.ai. Then generate an API key for your project in the settings tab. Set it as an environment variable:

export BASERUN_API_KEY="your_api_key_here"

Or set baserun.api_key to its value:

baserun.api_key = "br-..."

3. Start testing

Use our pytest plugin and start immediately testing with Baserun. By default all OpenAI and Anthropic requests will be automatically logged.

# test_module.py

import openai

def test_paris_trip():
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        temperature=0.7,
        messages=[
            {
                "role": "user",
                "content": "What are three activities to do in Paris?"
            }
        ],
    )
    
    assert "Eiffel Tower" in response['choices'][0]['message']['content']

To run the test and log to baserun:

pytest --baserun test_module.py
...
========================Baserun========================
Test results available at: https://baserun.ai/runs/<id>
=======================================================

Documentation

For a deeper dive on all capabilities and more advanced usage, please refer to our Documentation.

License

MIT License

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

baserun-0.5.6.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

baserun-0.5.6-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file baserun-0.5.6.tar.gz.

File metadata

  • Download URL: baserun-0.5.6.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for baserun-0.5.6.tar.gz
Algorithm Hash digest
SHA256 c85f6f385b75bc4245e7625729cb4091a2590646b5bcb868ff23ffd5281ba95a
MD5 5b3ea2b591e2ca1ded15b783baed5153
BLAKE2b-256 216209ebf37ef8d8a017d0d83862d0adb4e828eb72eac817edc4078413a7c9bb

See more details on using hashes here.

File details

Details for the file baserun-0.5.6-py3-none-any.whl.

File metadata

  • Download URL: baserun-0.5.6-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for baserun-0.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 946ba5ff0561dc42806b3ba202f6e9d841bda50bc3c0ff1ff2db0efc613bcb10
MD5 c5893a2122c028716c34a713a865ef72
BLAKE2b-256 ca0e752c4cb06d707bebae0d32bb48ff13b93573505f2b017141c97462ca2a40

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