Skip to content

Conversation

professorice
Copy link
Contributor

@professorice professorice commented Oct 8, 2025

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Provide links to any issues in this repository or elsewhere relating to this pull request.

Describe the solution you've provided

Provide a clear and concise description of what you expect to happen.

Describe alternatives you've considered

Provide a clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context about the pull request here.


Note

Adds a new @launchdarkly/cloudflare-server-sdk-ai package integrating LaunchDarkly AI Configs with Cloudflare Workers AI, plus example, tests, and workspace wiring.

  • SDK: packages/sdk/cloudflare-ai
    • New package @launchdarkly/cloudflare-server-sdk-ai with initAi, config, agent, and agents APIs.
    • Converts LD AI Configs to Cloudflare Workers AI via config.toWorkersAI(...) and normalizes parameters.
    • KV-backed AI Config retrieval using clientSideID + KVNamespace; Mustache-based template interpolation for messages.
    • Comprehensive metrics tracker (LDAIConfigTrackerImpl): success/error, duration, TTFT, token usage; Workers AI helpers for sync/stream.
    • Type definitions and minimal LD client interface; build setup (rollup), tsconfig, eslint, README, LICENSE, CHANGELOG.
  • Example: packages/sdk/cloudflare-ai/example
    • Cloudflare Worker demonstrating AI Config usage (random-joke), wrangler.toml, TypeScript setup, and start/deploy scripts.
  • Tests
    • Adds unit tests for LDAIClientImpl covering config retrieval, interpolation, tracking, and Workers AI mapping.
  • Repo wiring
    • Updates root package.json workspaces to include packages/sdk/cloudflare-ai and packages/sdk/cloudflare-ai/example.
  • Docs
    • Updates packages/tooling/jest/README.md with a Quickstart example and adjusts setup guidance.

Written by Cursor Bugbot for commit 61f9300. This will update automatically on new commits. Configure here.

@professorice professorice requested a review from a team as a code owner October 8, 2025 16:16
@professorice professorice changed the title Mzafir/cloudflare ai sdk Cloudflare Ai SDK alpha Oct 8, 2025
@professorice professorice changed the title Cloudflare Ai SDK alpha feat: initial cloudflare-ai alpha release Oct 8, 2025
@jsonbailey
Copy link
Contributor

You can use the cloudflare-server-sdk with the server-sdk-ai package since it implements the min interface needed.

@jsonbailey jsonbailey closed this Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants