Version Packages#395
Merged
threepointone merged 2 commits intomainfrom Feb 11, 2026
Merged
Conversation
f246039 to
1238b05
Compare
1238b05 to
a1826a3
Compare
commit: |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@cloudflare/tanstack-ai@0.1.0
Minor Changes
#389
a4b756eThanks @vaibhavshn! - Add@cloudflare/tanstack-ai— adapters for using TanStack AI with Cloudflare Workers AI and AI Gateway.Workers AI adapters
All Workers AI adapters support four configuration modes: plain binding (
env.AI), plain REST (account ID + API key), AI Gateway binding (env.AI.gateway(id)), and AI Gateway REST (account ID + gateway ID).createWorkersAiChat) — Streaming chat completions via the OpenAI-compatible API. Includes tool calling with full round-trip support, structured output viajson_schema, and reasoning text streaming (STEP_STARTED/STEP_FINISHEDAG-UI events) for models like QwQ, DeepSeek R1, and Kimi K2.5. A custom fetch shim translates OpenAI SDK calls toenv.AI.run()for binding mode, with a stream transformer that handles both Workers AI native format and OpenAI-compatible format.createWorkersAiImage) — Stable Diffusion and other text-to-image models.createWorkersAiTranscription) — Speech-to-text via Whisper and Deepgram Nova-3.createWorkersAiTts) — Audio generation via Deepgram Aura-1.createWorkersAiSummarize) — Text summarization via BART-large-CNN.createWorkersAiEmbedding) — Text embeddings (implemented but not yet exported, pending TanStack AI'sBaseEmbeddingAdapter).AI Gateway adapters (third-party providers)
Route requests through Cloudflare AI Gateway for caching, rate limiting, and unified billing. Each adapter injects a custom
fetch(orhttpOptionsfor Gemini) that handles both binding and credential-based gateway configurations.createOpenAi*)createAnthropic*)createGemini*). Credentials-only (Google GenAI SDK lacks custom fetch support).createGrok*)createOpenRouter*). Accepts any model string.Utilities
createGatewayFetch— Shared fetch factory that routes requests through AI Gateway (binding or REST), with support for cache control headers (skipCache,cacheTtl,customCacheKey,metadata).createWorkersAiBindingFetch— Fetch shim that makesenv.AIlook like an OpenAI endpoint, including stream transformation and tool call ID sanitization for the binding's strict[a-zA-Z0-9]{9}validation.isDirectBindingConfig,isDirectCredentialsConfig,isGatewayConfig) using structural typing to discriminateenv.AIfromenv.AI.gateway(id).Robustness
finish_reason), the adapter emits proper closing events so consumers don't hang.stream: true, the binding shim wraps it into a valid response.Testing
workers-ai-provider@3.1.0
Minor Changes
#389
8538cd5Thanks @vaibhavshn! - Add transcription, text-to-speech, and reranking support to the Workers AI provider.New capabilities
Transcription (
provider.transcription(model)) — implementsTranscriptionModelV3. Supports Whisper models (@cf/openai/whisper,whisper-tiny-en,whisper-large-v3-turbo) and Deepgram Nova-3 (@cf/deepgram/nova-3). Handles model-specific input formats: number arrays for basic Whisper, base64 for v3-turbo via REST, and{ body, contentType }for Nova-3 via binding or raw binary upload for Nova-3 via REST.Speech / TTS (
provider.speech(model)) — implementsSpeechModelV3. Supports Workers AI TTS models including Deepgram Aura-1 (@cf/deepgram/aura-1). Acceptstext,voice, andspeedoptions. Returns audio asUint8Array. UsesreturnRawResponseto handle binary audio from the REST path without JSON parsing.Reranking (
provider.reranking(model)) — implementsRerankingModelV3. Supports BGE reranker models (@cf/baai/bge-reranker-base,bge-reranker-v2-m3). Converts AI SDK's document format to Workers AI's{ query, contexts, top_k }input. Handles both text and JSON object documents.Bug fixes
createRunREST shim now passes the abort signal tofetch, enabling request cancellation and timeout handling. Previously the signal was silently dropped.createRunBinaryutility for models that require raw binary upload instead of JSON (used by Nova-3 transcription via REST).Usage