You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cloudflare builds continue to include the binding-backed cloudflare/... provider automatically. Custom providers that use a built-in transport, such as openai-completions, should include a provider that enables that transport, such as openai.
amazon-bedrock is Node-only and intentionally includes the AWS SDK when selected.
Verification
pnpm run check:lint
pnpm run build && pnpm run check:types in packages/runtime
pnpm run build && pnpm run check:types in packages/cli
pnpm run check:types in packages/sdk
pnpm run check:types in packages/opentelemetry
pnpm run check:types in apps/docs
pnpm exec vitest run test/build-plugin-node.test.ts test/build-plugin-cloudflare.test.ts test/config.test.ts in packages/runtime
pnpm exec vitest run --config vitest.integration.cloudflare.config.ts --no-file-parallelism test/vite-cloudflare-build.test.ts in packages/runtime
pnpm --dir packages/runtime run test:integration:release
If that PR merges, Flue can keep accepting model-provider IDs in config, such as anthropic, groq, cloudflare-workers-ai, or cloudflare-ai-gateway, while generating only the required transport imports at build time:
Read the configured model-provider IDs.
Call getModels(providerId) from @earendil-works/pi-ai/base.
Collect and deduplicate the resulting model.api values.
Emit static imports and register() calls only for those API transports.
For example, groq and cloudflare-workers-ai resolve to openai-completions. cloudflare-ai-gateway currently resolves to multiple transports: anthropic-messages, openai-responses, and openai-completions. The generated JavaScript would include only the corresponding direct registration imports.
This avoids a runtime registration table that statically imports every transport and preserves the bundle-size goal without maintaining provider-to-transport mappings in Flue. If the Pi PR does not merge, we can reopen this fallback approach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
providersallowlist so Flue only bundles selected Pi provider transports and SDK chunksamazon-bedrockopt-in through Pi's public Bedrock injection hook and reject it for Cloudflare builds>=22.19.0Intent
Reduce generated bundle size by preventing every Pi SDK-backed provider implementation from becoming reachable in every Flue build.
Migration
Catalog-backed providers are now opt-in in
flue.config.ts:Cloudflare builds continue to include the binding-backed
cloudflare/...provider automatically. Custom providers that use a built-in transport, such asopenai-completions, should include a provider that enables that transport, such asopenai.amazon-bedrockis Node-only and intentionally includes the AWS SDK when selected.Verification
pnpm run check:lintpnpm run build && pnpm run check:typesinpackages/runtimepnpm run build && pnpm run check:typesinpackages/clipnpm run check:typesinpackages/sdkpnpm run check:typesinpackages/opentelemetrypnpm run check:typesinapps/docspnpm exec vitest run test/build-plugin-node.test.ts test/build-plugin-cloudflare.test.ts test/config.test.tsinpackages/runtimepnpm exec vitest run --config vitest.integration.cloudflare.config.ts --no-file-parallelism test/vite-cloudflare-build.test.tsinpackages/runtimepnpm --dir packages/runtime run test:integration:releasegit diff --check