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[ld]" 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. Shadow requests is experimental, in launchdarkly_ai_server.experimental.shadow_requests.

Evaluations from Code is core, so this package re-exports it. Like Agent Skills, it needs launchdarkly-ai-server 1.0.0 or later. 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 1.1.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 1.1.0
File Size Uploaded Provenance Actions
launchdarkly_ai_python-1.1.0.tar.gz 7.1 kB Without provenance Details for launchdarkly_ai_python-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.3 kB

Release files / launchdarkly_ai_python-1.1.0.tar.gz

Download URL launchdarkly_ai_python-1.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c317e61fb37a1cede5d481e3b0551d2324c0e0f43aa48a05ee64add94360be7f
BLAKE2b-256 checksum
How to use checksums
482c21c8d30c3689898cd428233dd7d4cb09edd1db03a546091d0c14cb17fe9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / launchdarkly_ai_python-1.1.0-py3-none-any.whl

Download URL launchdarkly_ai_python-1.1.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69d29b2a57116f9ba84c31fac47c2391ffea47d2f6c110217fd716989c325a27
BLAKE2b-256 checksum
How to use checksums
b2bcea2ddbfeb294b8e870dfc6c22ccb90cdf7ea96568fedb6b7cb189ec15bc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for launchdarkly-ai-python 1.1.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