Skip to content
Source
Sign inSign up
TanStack/ai

perf(providers): call provider APIs with fetch instead of the SDK runtime #1973

MergedAlemTuzlakmerged 5 commits intomain fromrefs/pull/1973/headmerged by AlemTuzlak View on GitHub

Showing 276 changed files with 23 additions and 0 deletions (loading 272).

x
0 of 276 viewed, 276 left
7 additions and 0 deletions.changeset/sdk-free-ai-anthropic.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/ai-anthropic': patch
+---
+​
+The adapters now call the provider HTTP API with `fetch` and do not create the `@anthropic-ai/sdk` client. At runtime they load only small SDK modules, for example the error classes from `@anthropic-ai/sdk/core/error`. With a bundler that splits chunks, the startup bundle is smaller. Errors keep the same classes and fields.
+​
+These options still load `@anthropic-ai/sdk` on first use: `middleware`, OpenTelemetry tracing, `logLevel: 'info'` or `'debug'` (or `ANTHROPIC_LOG`), and no `apiKey` and no `authToken`.
11 additions and 0 deletions.changeset/sdk-free-ai-bedrock.mdAdded
View file
@@ -0,0 +1,11 @@
+---
+'@tanstack/ai-bedrock': minor
+---
+​
+`@aws-sdk/client-bedrock-runtime` and `@aws-sdk/credential-providers` are now optional peer dependencies. Bundles that do not use them are smaller.
+​
+- If you use the Converse API (the default `api: 'converse'`) or embeddings, install `@aws-sdk/client-bedrock-runtime`.
+- If you use SigV4 auth from the AWS credential chain (no API key), install `@aws-sdk/credential-providers`.
+- If a package is missing, the first request throws an error that names the package to install.
+​
+The Chat Completions and Responses APIs sign SigV4 requests in the adapter and call Bedrock with `fetch`. They do not load the `openai` SDK at runtime.
5 additions and 0 deletions.changeset/sdk-free-ai-byteplus.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/ai-byteplus': patch
+---
+​
+The adapters now call the provider HTTP API with `fetch` and do not create the `openai` SDK client. At runtime they load only small SDK modules, for example the error classes from `openai/core/error`. With a bundler that splits chunks, the startup bundle is smaller. A single-file bundle can be a little larger, because a few rare options still load the full SDK on first use. Errors keep the same classes and fields.