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. No feature is experimental now.

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.0.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.0.0
File Size Uploaded Provenance Actions
launchdarkly_ai_python-1.0.0.tar.gz 7.0 kB Without provenance Details for launchdarkly_ai_python-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.2 kB

Release files / launchdarkly_ai_python-1.0.0.tar.gz

Download URL launchdarkly_ai_python-1.0.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7ecc91efddd64875d052e5467f6d51d0e631c816d74636ae3daf7f4c7c0a2b82
BLAKE2b-256 checksum
How to use checksums
c565318fbf7202e0d100e4197450df020690c47b0a467f6b7d530ebaacb5aec4
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-1.0.0-py3-none-any.whl

Download URL launchdarkly_ai_python-1.0.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69bdd6ca473b983142c6c0b18bf789a75ad6408c47ddafedf70f20d8fbbe6a44
BLAKE2b-256 checksum
How to use checksums
28bfeab6dce61839176e4c0e05957f7e077a47e71f827c37bad4abbb0db575a9
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 1.0.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