## 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/0e/8f/78485581a76b1313e45aa509a8ccdbb1519e0e2ec5861cc02043fa54a04f/braintrust-0.0.177.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.177",
"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": "9d838a8bcb04897db9f6a8e7c44444b2c09ea379557460fd0cc201e07c8a49c8",
"md5": "96a73e9939377df3e3a3d00fa4601ffc",
"sha256": "0b2c082418ea10269d552b8e9580d9483f17bac1d6042f7dd24a991f6d4c0b0b"
},
"downloads": -1,
"filename": "braintrust-0.0.177-py3-none-any.whl",
"has_sig": false,
"md5_digest": "96a73e9939377df3e3a3d00fa4601ffc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.0",
"size": 103179,
"upload_time": "2024-12-16T23:01:52",
"upload_time_iso_8601": "2024-12-16T23:01:52.288732Z",
"url": "https://files.pythonhosted.org/packages/9d/83/8a8bcb04897db9f6a8e7c44444b2c09ea379557460fd0cc201e07c8a49c8/braintrust-0.0.177-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0e8f78485581a76b1313e45aa509a8ccdbb1519e0e2ec5861cc02043fa54a04f",
"md5": "12852d662161ae8eb1dc99f102053e36",
"sha256": "1635f61d092b27d34d4773c539b38092fe5ba10da3048b58107e146593fa10d9"
},
"downloads": -1,
"filename": "braintrust-0.0.177.tar.gz",
"has_sig": false,
"md5_digest": "12852d662161ae8eb1dc99f102053e36",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.0",
"size": 90238,
"upload_time": "2024-12-16T23:01:55",
"upload_time_iso_8601": "2024-12-16T23:01:55.242265Z",
"url": "https://files.pythonhosted.org/packages/0e/8f/78485581a76b1313e45aa509a8ccdbb1519e0e2ec5861cc02043fa54a04f/braintrust-0.0.177.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 23:01:55",
"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"
}