Nexus supports 30+ LLM providers simultaneously. Each provider implements a unified interface for chat completions, streaming, embeddings, and model listing.
Provider Interface01
Every provider implements provider.Provider:
type Provider interface {
Name() string
Complete(ctx context.Context, req *CompletionRequest) (*CompletionResponse, error)
Stream(ctx context.Context, req *CompletionRequest) (Stream, error)
Embed(ctx context.Context, req *EmbeddingRequest) (*EmbeddingResponse, error)
Models(ctx context.Context) ([]Model, error)
Capabilities() Capabilities
}
Built-in Providers02
Nexus includes 30 provider implementations out of the box. Each is an independent Go module that can be imported separately.
Major Providers
| Provider | Package | Chat | Embed | Vision | Tools | Thinking |
| OpenAI | providers/openai | Yes | Yes | Yes | Yes | Yes |
| Anthropic | providers/anthropic | Yes | — | Yes | Yes | Yes |
| Google Gemini | providers/gemini | Yes | Yes | Yes | Yes | — |
| Cohere | providers/cohere | Yes | Yes | — | Yes | — |
| DeepSeek | providers/deepseek | Yes | — | — | Yes | Yes |
Cloud Providers
Inference Providers
Local Providers
| Provider | Package | API Key | Chat | Embed | Vision | Tools |
| Ollama | providers/ollama | Not required | Yes | Yes | Yes | Yes |
| LM Studio | providers/lmstudio | Not required | Yes | Yes | Yes | Yes |
Embeddings-Only Providers
Generic
| Provider | Package | Description |
| OpenAI-Compatible | providers/opencompat | Connect any OpenAI-compatible API |
Quick Example03
import (
"github.com/xraph/nexus/providers/openai"
"github.com/xraph/nexus/providers/anthropic"
"github.com/xraph/nexus/providers/groq"
)
gw := nexus.New(
nexus.WithProvider(openai.New(os.Getenv("OPENAI_API_KEY"))),
nexus.WithProvider(anthropic.New(os.Getenv("ANTHROPIC_API_KEY"))),
nexus.WithProvider(groq.New(os.Getenv("GROQ_API_KEY"))),
)
Capabilities04
Each provider reports what it supports:
caps := provider.Capabilities()
caps.Chat // chat completions
caps.Stream // streaming responses
caps.Embed // embeddings
caps.Vision // image inputs
caps.Tools // tool/function calling
caps.Thinking // extended thinking (Anthropic, DeepSeek R1)
Provider Health05
Nexus tracks provider health automatically — success/failure counts, average latency, and P99 latency. Use this data for smart routing decisions:
nexus.WithHealthTracker(provider.NewMemoryHealthTracker())