Repository navigation
[v4/p5-providers] refactor!: providers are AI SDK V4 factories on the AI SDK request layer - #239
Closed
cunninghamcard-bit wants to merge 1 commit into
Closed
cunninghamcard-bit wants to merge 1 commit into
cunninghamcard-bit wants to merge 1 commit into
Conversation
…est layer One change, without a transition layer: the old provider interface and its configs are removed in the same commit that adds the new ones. Request layer (aimux-provider-utils): - Injectable fetch, resolvable settings (values or functions evaluated per request) and the AI SDK request helpers. API keys and settings load per request, with LoadApiKey and LoadSetting errors. Provider interface: - Provider takes the AI SDK ProviderV4 shape, with a provider registry. Vendor packages, each a factory as in its upstream package: - openai-compatible, with the presets read from the registry table at run time. - The OpenAI family: openai, azure, codex, huggingface, xai. - groq and deepseek. - The Anthropic and Google families: anthropic, anthropic_aws, google, vertex, bedrock, aws_polly, open_responses. - The remaining vendors: mistral, cohere, voyage, elevenlabs, jev and 28 single-modality vendors. Consumers: - FFI, the bindings, the CLI, the web console and replay build providers by name through create_provider. Recordings keep only the provider identity. Retries are call options; provider configs reject the removed keys, and a missing key or an unfilled preset parameter fails at call time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
4 of 12 tasks
11 of 12 tasks
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.
Requested by li
Summary
Before: each vendor is a config struct behind aimux's own provider trait, settings are read once at construction, and consumers build providers through per-vendor constructors.
After: providers take the AI SDK
ProviderV4shape with a provider registry, and every vendor is a factory as in its upstream package. The request layer has injectable fetch and resolvable settings evaluated per request. FFI, the bindings, the CLI, the web console and replay build providers by name throughcreate_provider. Recordings keep only the provider identity.This is one PR on purpose: splitting it would need a temporary adapter between the old and new provider interfaces that the next PR deletes again. The commit message and the sections below go vendor by vendor so it can be reviewed in parts.
Type of change
Checklist
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepasses (cassette playback — no network/keys)README.md,docs/,rfc/,bindings/README.md)Notes for reviewers
Status: Draft, opened early so the series layout can be reviewed. The items under "Planned in follow-up pushes" land on this branch before it is marked ready.
cargo test --workspacehas not been run on this branch yet.aimux-provider-utils); provider interface and registry (aimux-core); openai-compatible and the preset table; the OpenAI family (openai, azure, codex, huggingface, xai); groq and deepseek; the Anthropic and Google families (anthropic, anthropic_aws, google, vertex, bedrock, aws_polly, open_responses); the remaining vendors; consumers (FFI, bindings, CLI, web, replay).specification_versionand drop the boundary rule that forbids it; the preset table withoutBox::leak; restore the OpenAI realtime WebSocket test; the decision URL through the config; asyncsupported_urls; injectable download transport;wrap_provider; provider tools reachable from the provider instance.sigv4_fetch.rsandcodex.rs); V4 alignment: public JSON, tools and lost tests #232 B25, B17, B18, S2-5.RECORDING_SCHEMAto 3 here. This series stays on schema 2, which is what master writes; the full schema 3 comes after the series, with the new C ABI and the binding migration. A follow-up push sets it back to 2 and keeps recordings written by master readable.🤖 Generated with Claude Code
https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa