Iris Providers
Providers
Section titled “Providers”Each provider package implements core.Provider and exposes provider-specific models and options.
Provider Interface
Section titled “Provider Interface”All providers implement:
type Provider interface { ID() string // "openai", "anthropic", etc. Models() []ModelInfo // Available models Supports(feature Feature) bool // Feature capability check Chat(ctx context.Context, req *ChatRequest) (*ChatResponse, error) StreamChat(ctx context.Context, req *ChatRequest) (*ChatStream, error)}Provider Packages
Section titled “Provider Packages”| Provider | Package | Primary Use |
|---|---|---|
| OpenAI | providers/openai | GPT-4o, GPT-5, embeddings, vision |
| Anthropic | providers/anthropic | Claude 3.5 Sonnet, Opus, Haiku |
| Gemini | providers/gemini | Gemini Pro, Flash, multimodal |
| xAI | providers/xai | Grok models |
| Z.ai | providers/zai | GLM models |
| Perplexity | providers/perplexity | Internet-connected reasoning |
| Ollama | providers/ollama | Local model hosting |
| HuggingFace | providers/huggingface | Model discovery, hosted inference |
| VoyageAI | providers/voyageai | Embeddings and reranking |
Provider Setup
Section titled “Provider Setup”Cloud Providers (API Key)
Section titled “Cloud Providers (API Key)”// From environment variableprovider := openai.New(os.Getenv("OPENAI_API_KEY"))
// From environment (auto-detect)provider, err := openai.NewFromEnv()
// With optionsprovider := openai.New(apiKey, openai.WithBaseURL("https://custom-endpoint.example.com/v1"), openai.WithOrganization("org-xxx"), openai.WithHTTPClient(customClient),)Local Providers
Section titled “Local Providers”// Ollama (local server)provider := ollama.New("http://localhost:11434")Feature Capabilities
Section titled “Feature Capabilities”Check provider support before using features:
if provider.Supports(core.FeatureToolCalling) { // Safe to use tools}
if provider.Supports(core.FeatureReasoning) { // Safe to use reasoning effort}
if provider.Supports(core.FeatureEmbeddings) { // Safe to use embeddings}Capability Matrix
Section titled “Capability Matrix”| Provider | Chat | Streaming | Tools | Vision | Embeddings | Reasoning |
|---|---|---|---|---|---|---|
| OpenAI | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| Anthropic | ✓ | ✓ | ✓ | ✓ | - | ✓ |
| Gemini | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| xAI | ✓ | ✓ | ✓ | ✓ | - | - |
| Z.ai | ✓ | ✓ | - | - | - | - |
| Perplexity | ✓ | ✓ | - | - | - | - |
| Ollama | ✓ | ✓ | ✓ | ✓ | ✓ | - |
| HuggingFace | ✓ | ✓ | - | - | ✓ | - |
| VoyageAI | - | - | - | - | ✓ | - |
Internal Packages (v0.12.0+)
Section titled “Internal Packages (v0.12.0+)”Shared utilities used by all providers:
| Package | Purpose |
|---|---|
providers/internal/normalize | Error normalization across providers |
providers/internal/toolcalls | Tool-call assembler for streaming |
Next steps
Section titled “Next steps”corepackage for the shared types and client.toolspackage for tool registration and middleware.