Skip to content

statsig-io/statsig-ai-python

Repository files navigation

⚠️ 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages