swink-agent-adapters
LLM provider adapters for swink-agent — one StreamFn per backend with identical streaming, tool-call, and error semantics.
Features
- Anthropic (
anthropic) — Messages API with streaming, tool use, and extended thinking - OpenAI (
openai) — Responses API and Chat Completions with streaming tool calls - Google Gemini (
gemini) — streaming generation with function calling - Ollama (
ollama) — local OpenAI-compatible inference servers - Azure OpenAI (
azure) — AAD token auth viaswink-agent-auth - AWS Bedrock (
bedrock) — SigV4-signed event streams (Claude, Titan, Llama) - Mistral (
mistral) and xAI (xai) — first-party and OpenAI-compatible endpoints - Proxy (
proxy) — route through a gateway or replay recorded fixtures in tests - Catalog lookup:
build_remote_connection_for_model("claude-sonnet-4-6")returns a readyModelConnection - Cargo features are fully opt-in — enable only the providers you ship
Quick Start
[]
= "0.9.0"
= { = "0.9.0", = ["anthropic", "openai"] }
= { = "1", = ["full"] }
use *;
use build_remote_connection_for_model;
async
Architecture
Each provider is a thin StreamFn implementation that maps the vendor's native streaming wire format onto swink-agent's unified AssistantMessageEvent stream. Shared plumbing (model presets, retry policies, credential resolution) lives in the crate root; per-provider modules contain only wire-level conversion. Providers that need OAuth or signed requests pull swink-agent-auth or the aws-sigv4 stack in through feature-gated dependencies, so a build with just anthropic stays small.
No unsafe code (#![forbid(unsafe_code)]). No global state — every adapter owns its reqwest::Client and is constructed explicitly through a preset or builder.
Part of the swink-agent workspace — see the main README for workspace overview and setup.