Skip to content

Add support for readable streams in AI binding#4294

Merged
anonrig merged 7 commits intocloudflare:mainfrom
thatsKevinJain:kevin/ai-readable-stream
Jun 19, 2025
Merged

Add support for readable streams in AI binding#4294
anonrig merged 7 commits intocloudflare:mainfrom
thatsKevinJain:kevin/ai-readable-stream

Conversation

@thatsKevinJain
Copy link
Contributor

Workers AI is extending its binding to allow for passing ReadableStreams as inputs,
this will only be supported for a few models and will be fully backwards compatible.

For newer models, users will be able to send bigger media files as raw JS ReadableStream
objects. This will result in faster inference responses.

@thatsKevinJain thatsKevinJain requested a review from a team as a code owner June 10, 2025 15:00
Copy link
Contributor

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other comments (3)

💡 To request another review, post a new comment with "/windsurf-review".

@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch from 8f211d0 to 48dc1a9 Compare June 10, 2025 15:16
@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch 4 times, most recently from 49f240f to 9ba37a6 Compare June 11, 2025 15:30
Workers AI is extending its binding to allow for passing ReadableStreams as inputs,
this will only be supported for a few models and will be fully backwards compatible.

For newer models, users will be able to send bigger media files as raw JS ReadableStream
objects. This will result in faster inference and interesting capabilities in future.
@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch from 9ba37a6 to f0c78ab Compare June 11, 2025 15:30
@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch from f0c78ab to 2827e4b Compare June 18, 2025 15:15
@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch from 2827e4b to 07ae33a Compare June 18, 2025 16:45
@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch from 91f3a94 to b0a5886 Compare June 19, 2025 17:42
@thatsKevinJain thatsKevinJain force-pushed the kevin/ai-readable-stream branch from b0a5886 to 96dfc50 Compare June 19, 2025 18:28
@anonrig anonrig enabled auto-merge (squash) June 19, 2025 18:55
@anonrig anonrig merged commit 9b6ae32 into cloudflare:main Jun 19, 2025
15 of 16 checks passed
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.

5 participants