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[ld]" 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 1.0.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 1.0.1
File Size Uploaded Provenance Actions
launchdarkly_ai_vercel_messages-1.0.1.tar.gz 22.0 kB Without provenance Details for launchdarkly_ai_vercel_messages-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 35.2 kB

Release files / launchdarkly_ai_vercel_messages-1.0.1.tar.gz

Download URL launchdarkly_ai_vercel_messages-1.0.1.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
48f56170d8016153b627cdda963cde479e9f7a67ce587789cc22c32f36c9ee2f
BLAKE2b-256 checksum
How to use checksums
fc1176954e5a061b304916f58599a0a7fa828ee7a080f4cfc338cca6b91aa0bd
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_vercel_messages-1.0.1-py3-none-any.whl

Download URL launchdarkly_ai_vercel_messages-1.0.1-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fcf4a494d1dd2ba20becb37cb8cd8beeb14115483d7d618bb4746b80404df500
BLAKE2b-256 checksum
How to use checksums
31d06811a2e8efcd56939d45c86aa5203adab43deaf31bf33bf45ed99ee8c80b
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-vercel-messages 1.0.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