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.1b6.tar.gz (27.6 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.1b6-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: statsig_ai-0.0.1b6.tar.gz
  • Upload date:
  • Size: 27.6 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.1b6.tar.gz
Algorithm Hash digest
SHA256 30e5963ebfcf6490c1b958109c67d4bfc5fb15d90c930569e38d80a3144240dc
MD5 74b17fb8c1e40cd0a6a1e3135c2ebc1b
BLAKE2b-256 10d937453955a2b45185c02081565ed5e5155857ecee99be194fd3c6bcf44fd9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: statsig_ai-0.0.1b6-py3-none-any.whl
  • Upload date:
  • Size: 24.7 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.1b6-py3-none-any.whl
Algorithm Hash digest
SHA256 34e3412684e26cb35074612bff7a1ec786ebb9b5e901a33700664a93302d08c4
MD5 3e3a4203bd019acdb06d6c8926d55a57
BLAKE2b-256 dc5efa7e0b34a90ed66c932280904639ee675629f304c248af4934a52520dd2f

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