Expand description
LLM provider adapters for swink-agent.
Provides StreamFn implementations for nine LLM providers.
No provider is enabled by default; enable only what you need:
| Feature | Provider |
|---|---|
anthropic | Anthropic Claude |
openai | OpenAI GPT |
ollama | Ollama (local) |
gemini | Google Gemini |
azure | Azure OpenAI / AI Foundry |
bedrock | AWS Bedrock |
mistral | Mistral AI |
xai | xAI Grok |
proxy | Custom SSE proxy |
Use full or all to compile every provider adapter.
§Quick Start
use swink_agent_adapters::build_remote_connection_for_model;
let conn = build_remote_connection_for_model("claude-sonnet-4-6")?;Modules§
- classify
- HTTP status code classification for LLM provider error handling.
- convert
- Shared message conversion utilities for LLM adapters.
- sse
- Shared SSE (Server-Sent Events) stream parser and adapter helpers.
Structs§
- Anthropic
Stream Fn - A
StreamFnimplementation for the Anthropic Messages API. - Azure
Stream Fn - Bedrock
Stream Fn - Gemini
Stream Fn - Mistral
Stream Fn - A
StreamFnimplementation for the Mistral chat completions API. - Ollama
Stream Fn - A
StreamFnimplementation for Ollama’s/api/chatendpoint. - Open
AiStream Fn - A
StreamFnimplementation for OpenAI-compatible chat completions APIs. - Proxy
Stream Fn - A
StreamFnimplementation that proxies LLM calls over HTTP/SSE. - Remote
Preset Key - XAiStream
Fn
Enums§
- Azure
Auth - Authentication method for Azure
OpenAIdeployments. - Remote
Model Connection Error
Functions§
- all_
remote_ presets - Returns all remote presets from the catalog, regardless of feature flags.
- build_
connection_ from_ preset - build_
remote_ connection - build_
remote_ connection_ for_ model - Builds a
ModelConnectionfor a model identified by itsmodel_id(e.g."claude-sonnet-4-6","gpt-5.4"). - build_
remote_ connection_ with_ credential - Builds a
ModelConnectionfor a preset key using an explicitly provided credential instead of reading it from the process environment. - is_
provider_ compiled - Returns
trueif the adapter for the given provider key is compiled in. - preset
- Looks up a remote preset by its
model_id(e.g."claude-sonnet-4-6"). - remote_
presets - Returns remote presets filtered to only those whose provider adapter is
compiled in. Use
all_remote_presetsto enumerate the full catalog regardless of compiled adapter support.