Skip to main content

Analytics for LLM apps

Project description

phospho Python Client

Phospho is a platform to help you monitor LLM apps.

With phospho, monitor every user interaction with your LLM app to identify issues and improve performance. Understand how users use your app and which versions of your product are the most successful.

Read the docs at docs.phospho.ai.

Warning : This project is still under active development!

Installation of the phospho client

You need Python >=3.8

pip install --upgrade phospho

Quickstart

Create an account on phospho. Create an API key and note down the project id. Set them as environment variables:

export PHOSPHO_API_KEY="your-api-key"
export PHOSPHO_PROJECT_ID="project-id"

In the code of your LLM app, log interactions with your agent using phospho.log().

import phospho

phospho.init()

# This is how you log interactions to phospho as strings
phospho.log(input="The user input", output="Your LLM app output")

You can also directly pass OpenAI API query and responses (or any object with same format) to phospho :

import phospho
import openai

phospho.init()
openai_client = openai.OpenAI()

# This is your agent code
query = {
    "messages": [{"role": "user", "content": "The user input"}],
    "model": "gpt-3.5-turbo",
}
response = openai_client.chat.completions.create(**query)

# Log the interactions to phospho
phospho.log(input=query, output=response)

Monitor and visualize your agent on the phospho dashboard.

Usage

Read the docs at docs.phospho.ai for more information. Use your phospho dashboard to monitor your agent, score interactions and detect events.

Project details


Download files

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

Source Distribution

phospho-0.2.19.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

phospho-0.2.19-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file phospho-0.2.19.tar.gz.

File metadata

  • Download URL: phospho-0.2.19.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.12.2 Linux/6.5.0-1015-azure

File hashes

Hashes for phospho-0.2.19.tar.gz
Algorithm Hash digest
SHA256 14bca940f22c0e72081257b0269c5f9d06da9026613756dd0df75acf47b120e7
MD5 a280c4b805644f120873e9c8c5ac70f7
BLAKE2b-256 835ed48d44864cdd200b0bd9a11024f508355a783bf252b52ccd18ecd49ea0e2

See more details on using hashes here.

Provenance

File details

Details for the file phospho-0.2.19-py3-none-any.whl.

File metadata

  • Download URL: phospho-0.2.19-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.12.2 Linux/6.5.0-1015-azure

File hashes

Hashes for phospho-0.2.19-py3-none-any.whl
Algorithm Hash digest
SHA256 169ae47d010078e230c5c4ddb2633bb06318afbfb2f8c0522c6ef9b727ad52f0
MD5 d5808a54b2b034ee6ca66379dd400c05
BLAKE2b-256 93182dedbf0758d8686189130b94a57cdbdfe380fec2f3d25d598bf25a67e801

See more details on using hashes here.

Provenance

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