## Braintrust
A Python library for logging data to Braintrust. `braintrust` is distributed as
a [library on PyPI](https://pypi.org/project/braintrust/). It is open source and
[available on GitHub](https://github.com/braintrustdata/braintrust-sdk/tree/main/py).
### Quickstart
Install the library with pip.
```bash
pip install braintrust
```
Then, run a simple experiment with the following code (replace `YOUR_API_KEY` with
your Braintrust API key):
```python
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],
)
```
Raw data
{
"_id": null,
"home_page": "https://www.braintrust.dev",
"name": "braintrust",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8.0",
"maintainer_email": null,
"keywords": null,
"author": "Braintrust",
"author_email": "info@braintrust.dev",
"download_url": "https://files.pythonhosted.org/packages/97/a0/16d1db4355a3f6a4a02f401bb1dbd8f593c62d0737414451e5471d7471d9/braintrust-0.0.188.tar.gz",
"platform": null,
"description": "## Braintrust\n\nA Python library for logging data to Braintrust. `braintrust` is distributed as\na [library on PyPI](https://pypi.org/project/braintrust/). It is open source and\n[available on GitHub](https://github.com/braintrustdata/braintrust-sdk/tree/main/py).\n\n### Quickstart\n\nInstall the library with pip.\n\n```bash\npip install braintrust\n```\n\nThen, run a simple experiment with the following code (replace `YOUR_API_KEY` with\nyour Braintrust API key):\n\n```python\nfrom braintrust import Eval\n\ndef is_equal(expected, output):\n return expected == output\n\nEval(\n \"Say Hi Bot\",\n data=lambda: [\n {\n \"input\": \"Foo\",\n \"expected\": \"Hi Foo\",\n },\n {\n \"input\": \"Bar\",\n \"expected\": \"Hello Bar\",\n },\n ], # Replace with your eval dataset\n task=lambda input: \"Hi \" + input, # Replace with your LLM call\n scores=[is_equal],\n)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "SDK for integrating Braintrust",
"version": "0.0.188",
"project_urls": {
"Bug Tracker": "https://github.com/braintrustdata/braintrust-sdk/issues",
"Homepage": "https://www.braintrust.dev",
"Source Code": "https://github.com/braintrustdata/braintrust-sdk"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a07f36850c0e19da5056563326df23ae28f72cb171879e7a10a8accb8f7c40d0",
"md5": "c7d8de7202e8822c47ad4b90693c0b68",
"sha256": "bce3f458e82c911e4c6692af86278ce5c1e2b9c3b64c892333696850bc9fbd2a"
},
"downloads": -1,
"filename": "braintrust-0.0.188-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c7d8de7202e8822c47ad4b90693c0b68",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.0",
"size": 119749,
"upload_time": "2025-03-10T21:37:22",
"upload_time_iso_8601": "2025-03-10T21:37:22.626670Z",
"url": "https://files.pythonhosted.org/packages/a0/7f/36850c0e19da5056563326df23ae28f72cb171879e7a10a8accb8f7c40d0/braintrust-0.0.188-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97a016d1db4355a3f6a4a02f401bb1dbd8f593c62d0737414451e5471d7471d9",
"md5": "977f0fd6c7ce63819708b555261e4302",
"sha256": "f1609dc4da64495c4023d05e0dda8c7b1fd5d5e86f8dd855e2c2f3e53017e001"
},
"downloads": -1,
"filename": "braintrust-0.0.188.tar.gz",
"has_sig": false,
"md5_digest": "977f0fd6c7ce63819708b555261e4302",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.0",
"size": 103024,
"upload_time": "2025-03-10T21:37:24",
"upload_time_iso_8601": "2025-03-10T21:37:24.270917Z",
"url": "https://files.pythonhosted.org/packages/97/a0/16d1db4355a3f6a4a02f401bb1dbd8f593c62d0737414451e5471d7471d9/braintrust-0.0.188.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-10 21:37:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "braintrustdata",
"github_project": "braintrust-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "braintrust"
}