Python client library for the OpenPipe service
Project description
OpenPipe Python Client
This client allows you automatically report your OpenAI calls to OpenPipe. OpenPipe
Installation
pip install openpipe
Usage
- Create a project at https://app.openpipe.ai
- Find your project's API key at https://app.openpipe.ai/project/settings
- Configure the OpenPipe client as shown below.
from openpipe import openai, configure_openpipe
import os
# Set the OpenPipe API key you got in step (3) above.
# If you have the `OPENPIPE_API_KEY` environment variable set we'll read from it by default.
configure_openpipe(api_key=os.getenv("OPENPIPE_API_KEY"))
# Configure OpenAI the same way you would normally
openai.api_key = os.getenv("OPENAI_API_KEY")
You can use the OpenPipe client for normal
Special Features
Tagging
OpenPipe has a concept of "tagging." This is very useful for grouping a certain set of completions together. When you're using a dataset for fine-tuning, you can select all the prompts that match a certain set of tags. Here's how you can use the tagging feature:
completion = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=[{"role": "system", "content": "count to 10"}],
openpipe={"tags": {"prompt_id": "counting"}},
)
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
openpipe-3.0.2.tar.gz
(16.1 kB
view hashes)
Built Distribution
openpipe-3.0.2-py3-none-any.whl
(27.0 kB
view hashes)