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.1b8.tar.gz (30.1 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.1b8-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: statsig_ai-0.0.1b8.tar.gz
  • Upload date:
  • Size: 30.1 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.1b8.tar.gz
Algorithm Hash digest
SHA256 8b2a27c7c1576c4c79662a5f83cd956b4ae83dd178ee99d936b17fada8a4b307
MD5 2d23d2202fd0b758f730991ec712866f
BLAKE2b-256 71624710e702da02aad21ace59390b5705ad29276f94ffdd0df8c62736aa2221

See more details on using hashes here.

File details

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

File metadata

  • Download URL: statsig_ai-0.0.1b8-py3-none-any.whl
  • Upload date:
  • Size: 26.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.1b8-py3-none-any.whl
Algorithm Hash digest
SHA256 d9967a70805017d1bee4abc174c2fe5b5216dc20e641615fb72b88ca04bb814e
MD5 c4b4615d56dc9cc0c904d83ecfccf237
BLAKE2b-256 d4a46a09f4a02431901f7f9a04c4f00a43e63c76875786b742bf501efbcb86cf

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