Skip to main content

Statsig AI Python SDK

Project description

⚠️ Beta Notice

This SDK is currently in beta. All APIs are experimental and subject to change. Please review the release notes for any breaking changes before upgrading.

Statsig Python AI SDK

Statsig is the on-stop data platform for product development. We help you move faster with feature gates (feature flags), experiments, and the world's most powerful stats engine. If you're new to Statsig, check out our product and create an account at statsig.com.

The AI SDK provides convenient hooks for developers working with LLMs to iterate on their promps, run evals to test their efficacy, add observability to LLM usage.

Getting Started

Read through the Documentation to see code samples and how to get started.

Running Examples

The examples/ directory contains working examples demonstrating various features of the SDK.

Prerequisites

Set up your environment variables:

export STATSIG_API_KEY="your-statsig-api-key"
export OPENAI_API_KEY="your-openai-api-key"  # For OpenAI wrapper examples

Running an Example

python examples/ai_wrappers/wrap_openai.py

Available examples:

  • examples/ai_wrappers/wrap_openai.py - Demonstrates wrapping OpenAI clients with Statsig telemetry (sync/async, streaming/non-streaming)

Community

If you need any assistance or just have a question, feel free to reach out to us on Slack.

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

statsig_ai-0.0.1b7.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

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

statsig_ai-0.0.1b7-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file statsig_ai-0.0.1b7.tar.gz.

File metadata

  • Download URL: statsig_ai-0.0.1b7.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for statsig_ai-0.0.1b7.tar.gz
Algorithm Hash digest
SHA256 7dcbf558952598ed4b1f9e16aa8a6dda7f2bcabd272063c9e7cdde1b66c03053
MD5 ca0fe77cc54056c8d16d3800e4f36464
BLAKE2b-256 a86e5d9e1ff45139c8b511336dfddf8834e3dc4e4f582c8c7125bda68e4e5001

See more details on using hashes here.

File details

Details for the file statsig_ai-0.0.1b7-py3-none-any.whl.

File metadata

  • Download URL: statsig_ai-0.0.1b7-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for statsig_ai-0.0.1b7-py3-none-any.whl
Algorithm Hash digest
SHA256 08338893527fc75d53e3df81dfabb4469da3c83d0b0695c5d6a97c859fe53286
MD5 53672a72d5be3f6a34d1c3f84d173d5b
BLAKE2b-256 280942a7911179a133faa3469bde929f8f9940b5b638dca5d0a464f4df037dee

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