Skip to content

Iris Providers

Each provider package implements core.Provider and exposes provider-specific models and options.

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)
}
ProviderPackagePrimary Use
OpenAIproviders/openaiGPT-4o, GPT-5, embeddings, vision
Anthropicproviders/anthropicClaude 3.5 Sonnet, Opus, Haiku
Geminiproviders/geminiGemini Pro, Flash, multimodal
xAIproviders/xaiGrok models
Z.aiproviders/zaiGLM models
Perplexityproviders/perplexityInternet-connected reasoning
Ollamaproviders/ollamaLocal model hosting
HuggingFaceproviders/huggingfaceModel discovery, hosted inference
VoyageAIproviders/voyageaiEmbeddings and reranking
// From environment variable
provider := openai.New(os.Getenv("OPENAI_API_KEY"))
// From environment (auto-detect)
provider, err := openai.NewFromEnv()
// With options
provider := openai.New(apiKey,
openai.WithBaseURL("https://custom-endpoint.example.com/v1"),
openai.WithOrganization("org-xxx"),
openai.WithHTTPClient(customClient),
)
// Ollama (local server)
provider := ollama.New("http://localhost:11434")

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
}
ProviderChatStreamingToolsVisionEmbeddingsReasoning
OpenAI
Anthropic-
Gemini-
xAI--
Z.ai----
Perplexity----
Ollama-
HuggingFace---
VoyageAI-----

Shared utilities used by all providers:

PackagePurpose
providers/internal/normalizeError normalization across providers
providers/internal/toolcallsTool-call assembler for streaming
  • core package for the shared types and client.
  • tools package for tool registration and middleware.