Skip to main content

launchdarkly-ai-vercel-messages

Wildcard LaunchDarkly AI messages handler built on the official Vercel AI SDK for Python. It builds Vercel's creator/model id from the evaluated provider and model, while preserving already-qualified Gateway ids.

Install

pip install launchdarkly-ai-server launchdarkly-server-sdk launchdarkly-ai-vercel-messages

Default routing is AI Gateway: for example, xAI + grok-4.5 becomes spacexai/grok-4.5 before calling ai.get_model. Set AI_GATEWAY_API_KEY, or use Vercel OIDC with the ai[vercel] extra. Provider keys such as OPENAI_API_KEY are ignored on that path. This package does not import langchain-openai or other provider SDKs from config.provider.name. To call a model directly, inject model= with an already configured model or a sync/async factory:

import ai
from launchdarkly_ai_vercel_messages import vercel_messages

result = await vercel_messages(
    key,
    user_input,
    context,
    model=lambda cfg: ai.Model(
        id=cfg["model"]["name"],
        provider=ai.get_provider("openai"),
    ),
)

All LaunchDarkly providers are handled explicitly. Anthropic, OpenAI, Azure, Gemini, Cohere, DeepSeek, Meta, Mistral, Perplexity, and Vertex map directly. Bedrock, Cortex, Cursor, Databricks, and Fireworks AI infer the creator from the model and fail locally if ambiguous. AI21 Labs and IBM Watson fail locally because Vercel's current catalog has no corresponding creator.

experimental_evaluate / vercelEvaluate is TypeScript-only until the official Python ai package ships the same API.

Use

from launchdarkly_ai_server import config
from launchdarkly_ai_vercel_messages import create_vercel_messages_handler

result = await config(
    key="my-ai-config",
    handler=create_vercel_messages_handler(),
).invoke("Hello", {"kind": "user", "key": "user-123"})

The factory accepts model=<model or sync/async factory> and capture_content=False. It advertises ("*", "messages"); register only one wildcard messages adapter (Vercel, LangChain, etc.) in a handler pool.

The adapter maps native text and multimodal history, callable tools, streaming, structured JSON output, usage, and LaunchDarkly telemetry. Flag parameters cannot replace handler-owned model, credentials, messages, tools, stream lifecycle, output contract, or loop controls.

Metadata

Release files for launchdarkly-ai-vercel-messages 0.1.1

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-vercel-messages 0.1.1
File Size Uploaded Provenance Actions
launchdarkly_ai_vercel_messages-0.1.1.tar.gz 16.1 kB Without provenance Details for launchdarkly_ai_vercel_messages-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for launchdarkly-ai-vercel-messages 0.1.1
File Interpreter ABI Platform Actions
launchdarkly_ai_vercel_messages-0.1.1-py3-none-any.whl Python 3 none any Details for launchdarkly_ai_vercel_messages-0.1.1-py3-none-any.whl

Total release size: 27.5 kB

Release files / launchdarkly_ai_vercel_messages-0.1.1.tar.gz

Download URL launchdarkly_ai_vercel_messages-0.1.1.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cbf863829ee69490a66c9bc6504b272a55bd25732cdebc90e9684d063bc5c9ce
BLAKE2b-256 checksum
How to use checksums
a804a21768604c1f5e6d29cc2c32b5664ffabd2e6196a901f5fd730e98cba39d
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_vercel_messages-0.1.1-py3-none-any.whl

Download URL launchdarkly_ai_vercel_messages-0.1.1-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e967d7c4e787eff7322024e0130112b995c8174d08c511f34464d0c5064b993
BLAKE2b-256 checksum
How to use checksums
08bd24a749df21a4d4f05d6176729f618e1b1a865a465c58b28c5fec12221bf9
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-vercel-messages 0.1.1

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