Skip to main content

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}.

Agent Skills

Agent Skills (get_skill, write_skills, watch_skills and the rest) are re-exported from this package's root. They need launchdarkly-ai-server 1.0.0 or later, the first release with Agent Skills in core. This package does not pin launchdarkly-ai-server, so upgrading it alone can leave an older one installed, and from launchdarkly_ai_python import get_skill then raises ImportError. Upgrade both:

pip install --upgrade launchdarkly-ai-python "launchdarkly-ai-server>=1.0.0"

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 feature is:

  • 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.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for launchdarkly-ai-python 0.4.0
File Size Uploaded Provenance Actions
launchdarkly_ai_python-0.4.0.tar.gz 6.7 kB Without provenance Details for launchdarkly_ai_python-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for launchdarkly-ai-python 0.4.0
File Interpreter ABI Platform Actions
launchdarkly_ai_python-0.4.0-py3-none-any.whl Python 3 none any Details for launchdarkly_ai_python-0.4.0-py3-none-any.whl

Total release size: 9.7 kB

Release files / launchdarkly_ai_python-0.4.0.tar.gz

Download URL launchdarkly_ai_python-0.4.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
59524b2ec85df7c24eb8e5a6063ce20b11ef0ee5a322b7c46edf397dc19e0246
BLAKE2b-256 checksum
How to use checksums
ef26d09a11755871d100e88aee4d44c7103a14610f5b6aae3075b9328ae6eaae
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.4.0-py3-none-any.whl

Download URL launchdarkly_ai_python-0.4.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e241fbad0e3174b7d069111dcd0b9bbc0cfc2758eb51ee657362d1adb45c83eb
BLAKE2b-256 checksum
How to use checksums
830317dc9a6912cf6932a5762015f0dec2b19178378527f91f5cdc1db5b981af
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.4.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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page