Skip to content

feat(interop): add an optional Vercel AI SDK resilience adapter and prioritize provider access #117

Open

Description

@stackbilt-admin

Priority

P2 · impact H [INFERRED] · effort M · risk M (versioned peer contracts and streaming fidelity).

Problem / evidence

src/index.ts:102 exposes native provider classes and src/index.ts:289 a package-specific client, but no Vercel model adapter. src/types.ts:294 streams plain strings, so tool/reasoning/finish/usage events cannot be represented directly. src/providers/base.ts:353 blocks unlisted model IDs. src/model-catalog.ts:4 hardcodes six providers; src/factory.ts:366 hardcodes constructor registration. Extending coverage currently requires modifying the core. Deprecated image generation's Gemini support is not Gemini text inference.

[INFERRED] Developers who already use Vercel AI SDK will adopt resilience more easily as a model/middleware adapter than by replacing generateText/streamText/useChat. Confirm with three external integrations, not npm-download guesses. AI SDK custom provider contract.

Proposed scope

Keep core zero-dependency, fetch-only, Workers-first and Apache-2.0. Ship optional adapter in a separate entry/package with AI SDK as a peer/dev type dependency; core must not import it. Pin and test a supported provider contract version; do not invent LanguageModel method names from memory.

First support text generation/structured output with model selection, fallback, identity and usage translation. Add typed stream events only when the lifecycle can preserve tools/reasoning/finish reasons and cancellation. Add generic provider registration/custom-model metadata so consumers can use OpenAI-compatible services without six more copy-pasted adapters.

Access roadmap (adoption value is a hypothesis, not measured market share)

  1. Current OpenAI transport/model support and Responses API: fix existing users' blocked modern models first.
  2. Google Gemini API-key text adapter: major missing native protocol. Separate Google AI Studio from Vertex authentication; link provider proposal: Google Vertex AI integration #79, do not assume it covers both.
  3. OpenAI-compatible registration, then verified profiles for OpenRouter, DeepSeek direct, xAI, Mistral and Ollama/local. OpenRouter expands aggregate access fastest; DeepSeek/xAI/Mistral follow demonstrated users. provider proposal: native Mistral AI integration #78 already owns native Mistral.
  4. Vertex/Bedrock/Azure enterprise auth only when a consumer sponsors the maintenance; keep provider proposal: Google Vertex AI integration #79.
  5. Cohere provider proposal: Cohere integration #80 later unless a user needs its distinct capabilities.

For every profile verify endpoint/auth/tool/stream/usage with primary docs and fixtures before naming it supported. A baseUrl override is not sufficient while model allowlisting and catalog identity remain provider-specific.

Other ecosystem fits

  • OTel: dependency-free hook-to-structural-tracer adapter; pin current GenAI conventions. Do not record prompt/response content by default.
  • Hono: runnable integration recipe and optional helper, no core framework dependency.
  • Durable Objects: atomic quota coordinator example; coordinate policy scope, not one worldwide object.
  • MCP: show the existing ToolExecutor accepting a consumer-owned MCP client. Do not add an MCP transport/client to core; invocation side effects remain the consumer's responsibility.

Acceptance

  • Existing AI SDK generateText/streamText app gains resilience without replacing its UI/tool framework.
  • Peer version matrix and contract type tests; model identity, errors, usage and cancellation round-trip.
  • Core bundle remains free of adapter/OTel/Hono/MCP dependencies.
  • Three external users validate the adapter; one public runnable integration.
  • Provider registration does not bypass hard capability/budget policy.
  • Provider profiles use source-verified wire IDs and pricing provenance.

Semver: optional adapters/registration are additive minors; canonical/internal provider refactor can be batched into major. Supporting every gateway/protocol plus enterprise control-plane features is team-scale; keep the first release narrow.

Activity

  1. added
    enhancement
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions