Skip to content

feat!: replace ai/ai-sdk deps with in-house provider clients - #75

Merged
mcarvin8 merged 3 commits into
mainfrom
feat/inhouse-llm-providers
Aug 24, 2026
Merged

feat!: replace ai/ai-sdk deps with in-house provider clients#75
mcarvin8 merged 3 commits into
mainfrom
feat/inhouse-llm-providers

Conversation

@mcarvin8

Copy link
Copy Markdown
Owner

Summary

  • Drops the ai runtime dependency and all @ai-sdk/* optionalDependencies in favor of small, in-house fetch-based clients per provider (OpenAI, Anthropic, Google, Bedrock, Mistral, Cohere, Groq, xAI, DeepSeek, and OpenAI-compatible gateways), cutting the package down to @scolladon/tsgit and diff as its only runtime dependencies.
  • Adds a from-scratch AWS SigV4 signer (src/ai/providers/sigv4.ts) and a minimal AWS credential resolver (env vars or ~/.aws/credentials profile) so Bedrock support no longer needs the AWS SDK — static credentials only, not the full credential-provider chain (SSO/instance-role/container credentials are out of scope).
  • llmProviders.ts no longer does dynamic import()s of optional packages; every provider is always available with nothing extra to install.
  • New ChatModel/ChatCallOptions/ChatResult/ChatUsage types (src/ai/llmClient.ts) replace the Vercel AI SDK's LanguageModel/generateText, with an equivalent retry loop for transient failures.
  • README and test suite updated to match; test/llmProviders.spec.ts now asserts against mocked fetch calls (URL, headers, body) instead of mocked @ai-sdk/* factories.

Breaking changes

  • llmModelProvider now returns this package's own ChatModel instead of a Vercel AI SDK LanguageModel.
  • Bedrock credential resolution is now static-only (env vars or a shared-credentials-file profile); SSO, instance-role, and container credentials are no longer supported.
  • optionalDependencies on @ai-sdk/* packages are removed — nothing to install per-provider anymore.

Test plan

  • npx vitest run --coverage — 318/318 passing
  • npx tsc --noEmit — clean
  • npx biome lint . — clean
  • npx knip — clean
  • npx rollup -c — builds successfully (pre-existing Node-builtin/external warnings only, same class as before)

🤖 Generated with Claude Code

Drop the "ai" runtime dependency and all @ai-sdk/* optionalDependencies.
Every LLM provider (OpenAI, Anthropic, Google, Bedrock, Mistral, Cohere,
Groq, xAI, DeepSeek, and OpenAI-compatible gateways) now talks directly
to its HTTP API via a small in-house fetch-based client, cutting the
package's dependency/attack surface to just @scolladon/tsgit and diff.
Bedrock auth is a from-scratch AWS SigV4 signer supporting only static
credentials (env vars or an ~/.aws/credentials profile) instead of the
full AWS SDK credential chain.

BREAKING CHANGE: llmModelProvider now returns a ChatModel (this
package's own minimal interface) instead of a Vercel AI SDK
LanguageModel. Bedrock no longer supports SSO, instance-role, or
container credentials. optionalDependencies on @ai-sdk/* packages are
removed entirely.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mcarvin8 mcarvin8 changed the title Replace ai/ai-sdk deps with in-house LLM provider clients feat!: replace ai/ai-sdk deps with in-house provider clients Aug 24, 2026
@codecov-commenter

codecov-commenter commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.56962% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ai/providers/anthropic.ts 85.71% 0 Missing and 2 partials ⚠️
src/ai/providers/awsCredentials.ts 97.14% 0 Missing and 1 partial ⚠️
src/ai/providers/bedrock.ts 94.11% 0 Missing and 1 partial ⚠️
src/ai/providers/cohere.ts 91.66% 0 Missing and 1 partial ⚠️
src/ai/providers/google.ts 88.88% 0 Missing and 1 partial ⚠️
src/ai/providers/sigv4.ts 96.00% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/ai/aiSummary.ts 100.00% <100.00%> (ø)
src/ai/llmClient.ts 100.00% <100.00%> (ø)
src/ai/llmProviders.ts 100.00% <100.00%> (ø)
src/ai/providers/httpJson.ts 100.00% <100.00%> (ø)
src/ai/providers/openaiChat.ts 100.00% <100.00%> (ø)
src/ai/providers/awsCredentials.ts 97.14% <97.14%> (ø)
src/ai/providers/bedrock.ts 94.11% <94.11%> (ø)
src/ai/providers/cohere.ts 91.66% <91.66%> (ø)
src/ai/providers/google.ts 88.88% <88.88%> (ø)
src/ai/providers/sigv4.ts 96.00% <96.00%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mcarvin8 and others added 2 commits August 24, 2026 14:11
Adds direct unit tests for llmClient's retry loop, the shared HTTP
helper, and each new provider client (Anthropic, Google, Cohere,
Bedrock, SigV4 signing, AWS credential/region resolution) to bring
patch coverage on the new files up to ~100% statements/lines and
98.6% branches.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mcarvin8
mcarvin8 merged commit e57ea03 into main Aug 24, 2026
6 checks passed
@mcarvin8
mcarvin8 deleted the feat/inhouse-llm-providers branch August 24, 2026 18:16
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.

2 participants