Expand description
Cognate Providers — concrete LLM provider implementations.
§Providers
| Provider | Struct | Chat | Stream | Tools | Embeddings |
|---|---|---|---|---|---|
| OpenAI | OpenAiProvider | ✓ | ✓ | ✓ | ✓ |
| Anthropic | AnthropicProvider | ✓ | ✓ | ✓ | — |
§Resilience
- All providers have built-in exponential-backoff retry via
RetryConfig. - Token-bucket rate limiting is available on
OpenAiProviderandAnthropicProvider. FallbackProvidertransparently retries with a secondary provider on any retryable error.
Re-exports§
pub use anthropic::AnthropicProvider;pub use costs::ModelCost;pub use fallback::FallbackProvider;pub use openai::OpenAiProvider;pub use retry::with_retry;pub use retry::RetryConfig;pub use sse::SseStream;
Modules§
- anthropic
- Anthropic provider implementation.
- costs
- Model pricing constants.
- fallback
- Transparent provider fallback.
- openai
- OpenAI provider implementation.
- retry
- Retry logic with exponential backoff
- sse
- Server-Sent Events (SSE) streaming parser
Constants§
- DEFAULT_
TIMEOUT - Default request timeout applied when no explicit timeout is configured.
Functions§
- create_
http_ client - Build a
reqwestclient with standard Cognate defaults.