Packages

@tanstack/ai-bedrock

1.0.0 · 22 Oct 2026MIT38.3k / weekRepositorynpmAtom feed

38 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 1.x · latest line
  2. 1.0.0

    22 Oct 2026
  3. 0.6.x
  4. 0.6.2

    21 Oct 2026
  5. 0.6.1

    19 Oct 2026
    • Keep the provider's raw tool argument string for replay.

  6. 0.6.0

    13 Oct 2026
    • Text adapters now set one stable code on RUN_ERROR when the input does not fit in the model's context window: code: 'context_overflow'. @tanstack/ai exports it as CONTEXT_OVERFLOW_CODE. The provider's own text stays in message.

      if (chunk.type === 'RUN_ERROR' && chunk.code === CONTEXT_OVERFLOW_CODE) {
        // shorten the messages, then call chat() again
      }

      These adapters set it: OpenAI and the other OpenAI-compatible adapters (from code: 'context_length_exceeded'), Anthropic, Gemini, Bedrock (Converse, Chat Completions, and Responses), OpenRouter, Grok, Cloudflare Workers AI, and BytePlus.

      Changes to code that reads the old values:

    • Prompt caching is now on by default. Each chat() call asks the provider to cache the stable start of the request (system prompt, tools, and earlier messages), so repeated requests cost less and answer sooner.

    • Set reasoning with chat({ reasoning }) on the three Bedrock APIs.

      Breaking: reasoning_effort (Chat Completions) and reasoning (Responses) are no longer in modelOptions.

      // Before
      chat({
        adapter: bedrockText('openai.gpt-oss-120b-1:0', { api: 'chat' }),
        messages,
        modelOptions: { reasoning_effort: 'high' },
      })
      
      // After
      chat({
        adapter: bedrockText('openai.gpt-oss-120b-1:0', { api: 'chat' }),
        messages,
        reasoning: 'high',
      })

      Structured output sends no thinking, because Claude cannot think while a tool is forced.

  7. 0.5.x
  8. 0.5.1

    9 Oct 2026
  9. 0.5.0

    9 Oct 2026
    • usage.promptTokens is now the total input on the Anthropic, Bedrock Converse, and Claude Code adapters. It is the uncached tokens plus the cache reads plus the cache writes. Before, it was the uncached tokens only. totalTokens now uses the new promptTokens. The cache parts stay in promptTokensDetails.cachedTokens and promptTokensDetails.cacheWriteTokens. Other adapters already report promptTokens this way.

      Breaking: if your code adds cachedTokens or cacheWriteTokens to promptTokens to get the total input, it now counts the cache two times. Use promptTokens as the total. To get the uncached tokens, subtract cachedTokens and cacheWriteTokens from promptTokens.

    • Add wrapFetch to chat(), to the middleware onConfig config, and to TextOptions. A wrapper gets the next fetch and gives back a new fetch. Use it to change the URL, the headers, the request, or the response of a model call. The new FetchWrapper type names the wrapper.

      The engine chains the chat() wrapper and the middleware wrappers into one function. A middleware wrapper runs inside the chat() wrapper and applies to one model call only.

      These text adapters send their requests through the wrapper: every adapter on @tanstack/openai-base (OpenAI, the OpenAI-compatible adapters, Grok, Groq, BytePlus, LLM Gateway, Lovable, Vercel AI Gateway, Cloudflare, and the Bedrock Chat Completions and Responses APIs), Anthropic, Mistral, Ollama, and OpenRouter. The wrapper wraps the fetch of the adapter config, not the global fetch. An Anthropic or Ollama adapter with an injected client ignores wrapFetch. In Cloudflare binding mode, the wrapper runs, but the binding does not send the URL or the headers. Without wrapFetch, the requests do not change.

  10. 0.4.x
  11. 0.4.5

    8 Oct 2026
    • Update the openai SDK dependency to ^7.30.0. openai 7 requires Node.js 22 or later.

  12. 0.4.1 – 0.4.33 releases that only update dependencies@tanstack/ai 0.65.0@tanstack/openai-base 0.12.4Show each
  13. 0.3.x
  14. 0.3.11 – 0.3.154 releases that only update dependencies@tanstack/ai 0.61.0@tanstack/openai-base 0.11.1Show each
  15. 0.3.9

    17 Sep 2026
    • Use the Bedrock API compatibility config's mantlePath on the Mantle endpoint so Gemma 4 hits /openai/v1 instead of a misleading 401. Other models stay on /v1.

  16. 0.3.7 – 0.3.82 releases that only update dependencies@tanstack/ai 0.54.0@tanstack/openai-base 0.10.11Show each
  17. 0.3.6

    3 Sep 2026
    • Accept baseURL and defaultHeaders on every adapter's client config so one gateway config (Cloudflare AI Gateway, Vercel AI Gateway, a corporate proxy) can be spread into any adapter. The vendor-specific names (httpOptions, serverURL, host, baseUrl, headers) keep working. Bedrock's Converse adapter now applies defaultHeaders too.

  18. 0.3.5

    2 Sep 2026
    • Forward Bedrock Converse cache token counts to TokenUsage.

      cacheReadInputTokens and cacheWriteInputTokens from the Converse metadata.usage event now land on promptTokensDetails.cachedTokens and promptTokensDetails.cacheWriteTokens, in chatStream, structuredOutput, and structuredOutputStream. Bedrock's inputTokens counts only the uncached part of the input, so without these fields a cached request looked like a near-zero-input call. Both fields are omitted when Bedrock omits them.

  19. 0.3.4

    1 Sep 2026
    • forward usage from Converse structuredOutputStream()

      ConverseTextAdapter.structuredOutputStream() iterated the Converse event stream without a metadata branch, so the trailing usage event was ignored and RUN_FINISHED carried no token counts on the streaming structured-output path. The normal chat path (processConverseStream) and the non-stream structuredOutput() already handled it; this brings the third path in line.

  20. 0.3.2 – 0.3.32 releases that only update dependencies@tanstack/ai 0.52.0@tanstack/openai-base 0.10.8Show each
  21. 0.3.1

    27 Aug 2026
    • Stop requiring Zod as a peer dependency when the adapters do not import it at runtime.

  22. 0.3.0

    24 Aug 2026
    • Add headless BYOK: defineByok in @tanstack/ai-client/byok, pass byok into chat and generation hooks, and read keys on the relay with getByokKey from @tanstack/ai/byok/server. Provider ids are open slugs (x-byok-<slug>). Each adapter exports a { id, label, env? } object (openaiByok, …); id is required. env is the env var name(s) for the relay — names only; the client never reads process.env. A wrong key surfaces as the provider's own 401 through the relay, so no client-side key check is needed. OpenRouter PKCE (@tanstack/ai-openrouter/pkce) saves the minted key under openrouterByok.id.

  23. 0.2.x
  24. 0.2.3 – 0.2.63 releases that only update dependencies@tanstack/ai 0.48.0@tanstack/openai-base 0.10.3Show each
  25. 0.2.2

    18 Aug 2026
    • Timestamp native and fallback structured-output events when they are emitted so their lifecycle remains chronologically ordered.

  26. 0.2.1

    11 Aug 2026
    • populate StructuredOutputResult.usage from non-stream structuredOutput()

      Adapters that already returned tokens/cost on streaming structured paths were dropping response.usage on the non-stream structuredOutput() method. OpenRouter now forwards tokens and cost; openai-base, Mistral, and Bedrock Converse do the same for tokens so fallbackStructuredOutputStream and middleware can observe usage.

  27. 0.2.0

    10 Aug 2026
    • Add a multimodal embed() activity. A single primitive covers one input or a batch — input accepts a string, a text part, an image part, or a fused text+image item written as a nested Array<ContentPart> ([textPart, imagePart], the same shape chat messages use), one vector per item, with the accepted item types narrowed per model at compile time. Top-level dimensions requests Matryoshka output sizes where supported. Results carry embeddings: [{ vector, index }] plus usage when the provider reports it, and embed() participates in generation middleware, debug logging, OTel (gen_ai.operation.name: embeddings), and devtools events like every other activity.

      Provider adapters: openaiEmbedding (text-embedding-3-small/large), geminiEmbedding (gemini-embedding-001), mistralEmbedding (mistral-embed, codestral-embed), ollamaEmbedding (nomic-embed-text and any local model), bedrockEmbedding (Titan Text V2, Titan Multimodal G1 with fused text+image, Cohere Embed v3 on Bedrock), and @tanstack/ai-cohere's cohereEmbedding (embed-v4.0, multimodal text+image with required inputType).

    • publish internal dependency ranges as ^x.y.z instead of exact pins

      Internal dependencies on other TanStack AI packages used workspace:* in dependencies and peerDependencies. pnpm rewrites that to an exact version at publish time, so a released package asked for e.g. @tanstack/ai-utils@0.4.0 rather than ^0.4.0.

      Two consequences for consumers:

      These fields now use workspace:^, which publishes as ^x.y.z. Every package here is still 0.x, so ^0.43.1 resolves to 0.43.x only — patches dedupe cleanly and no breaking minor is ever pulled in.

      devDependencies deliberately keep workspace:*: they are never published, and * correctly means "always build against the local copy".

  28. 0.1.x
  29. 0.1.5 – 0.1.62 releases that only update dependencies@tanstack/ai 0.43.1@tanstack/openai-base 0.9.10Show each
  30. 0.1.4

    20 Jul 2026

    Reading the note…

  31. 0.1.3

    16 Jul 2026

    Reading the note…

  32. 0.1.2

    6 Jul 2026

    Reading the note…

  33. 0.1.1

    3 Jul 2026

    Reading the note…

  34. 0.1.0

    30 Jun 2026

    Reading the note…

  35. 0.0.x
  36. 0.0.1

    30 Jun 2026

    Reading the note…