⚠️ Beta NoticeThis 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 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.
Read through the Documentation to see code samples and how to get started.
The examples/ directory contains working examples demonstrating various features of the SDK.
Set up your environment variables:
export STATSIG_API_KEY="your-statsig-api-key"
export OPENAI_API_KEY="your-openai-api-key" # For OpenAI wrapper examplespython examples/ai_wrappers/wrap_openai.pyAvailable examples:
examples/ai_wrappers/wrap_openai.py- Demonstrates wrapping OpenAI clients with Statsig telemetry (sync/async, streaming/non-streaming)
If you need any assistance or just have a question, feel free to reach out to us on Slack.