launchdarkly-ai-python
Convenience barrel package for the LaunchDarkly AI Python SDK. Re-exports the complete public API of launchdarkly-ai-server — install this instead of launchdarkly-ai-server for the simplest setup.
Installation
pip install launchdarkly-ai-python launchdarkly-ai-openai-messages
To enable trace export to the LaunchDarkly Observability dashboard, install the otel extras group:
pip install "launchdarkly-ai-python[otel]"
init_client() detects the OTel packages at runtime and configures tracing automatically. If the extras are not installed, a single warning is logged and all AI calls continue normally with no-op spans.
Usage
Import everything from launchdarkly_ai_python instead of launchdarkly_ai_server:
import asyncio
from launchdarkly_ai_python import config, graph, resolve_graph
from launchdarkly_ai_python import init_client, shutdown, global_registry
from launchdarkly_ai_openai_messages import create_openai_messages_handler
async def main():
result = await config(
key="my-ai-config-flag",
handler=create_openai_messages_handler(),
).invoke("What is feature flagging?", {"kind": "user", "key": "user-123"})
print(result.response)
await shutdown()
asyncio.run(main())
inspect_config(key, context)
Reads an AI Config flag variation without invoking any AI provider. Re-exported from launchdarkly-ai-server — see the full reference there.
from launchdarkly_ai_python import inspect_config
result = await inspect_config("my-ai-config-flag", {"kind": "user", "key": "user-123"})
if result["enabled"]:
print(result["config"]["model"]["name"])
Never raises. Returns {"enabled": bool, "config": dict | None, "meta": dict | None}.
Experimental features
Experimental features are not re-exported from this package. They live in
launchdarkly-ai-server, the package this one depends on, and need a launchdarkly-ai-server
release that includes them. Import them from launchdarkly_ai_server.experimental; if that
import fails, upgrade launchdarkly-ai-server itself, since upgrading this package alone can
leave an older launchdarkly-ai-server in place. The experimental features are:
- Agent Skills, in
launchdarkly_ai_server.experimental.skills; see the Agent Skills guide. - Evaluations from Code, in
launchdarkly_ai_server.experimental.evaluations; see the evaluations guide.
All exports, types, and behaviors are identical to launchdarkly-ai-server. See the core client README for the full API reference.
Metadata
Release files for launchdarkly-ai-python 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| launchdarkly_ai_python-0.3.0.tar.gz | 6.5 kB | Without provenance | Details for launchdarkly_ai_python-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| launchdarkly_ai_python-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for launchdarkly_ai_python-0.3.0-py3-none-any.whl |
Total release size: 9.4 kB
Release files / launchdarkly_ai_python-0.3.0.tar.gz
| Download URL | launchdarkly_ai_python-0.3.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b903647cfd1c33d40e67064e61701713964a1b3ed749bbf17942381fbebffaf
|
|
BLAKE2b-256 checksum How to use checksums |
88fb33c775cca6d166aafec410e9c86a5d48908229e7cc548752c9338c5e9145
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / launchdarkly_ai_python-0.3.0-py3-none-any.whl
| Download URL | launchdarkly_ai_python-0.3.0-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1683e8e5b39edef43d7558f3d4dfdf76f8ef6178c40893142d68643d199361cb
|
|
BLAKE2b-256 checksum How to use checksums |
acbdd154b34d3e148bff7743c3afd31349a6ec45c674b673f8ec70dd2e4ababe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for launchdarkly-ai-python 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.