Nexus

Providers

Register and manage LLM providers — 30 built-in providers covering all major LLM APIs.

Nexus supports 30+ LLM providers simultaneously. Each provider implements a unified interface for chat completions, streaming, embeddings, and model listing.

Provider Interface

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 Providers

Nexus includes 30 provider implementations out of the box. Each is an independent Go module that can be imported separately.

Major Providers

ProviderPackageChatEmbedVisionToolsThinking
OpenAIproviders/openaiYesYesYesYesYes
Anthropicproviders/anthropicYesYesYesYes
Google Geminiproviders/geminiYesYesYesYes
Cohereproviders/cohereYesYesYes
DeepSeekproviders/deepseekYesYesYes

Cloud Providers

ProviderPackageAuthChatEmbedVisionTools
Azure OpenAIproviders/azureopenaiAPI KeyYesYesYesYes
Amazon Bedrockproviders/bedrockAWS SigV4YesYes
Google Vertex AIproviders/vertexGCP OAuth2YesYesYesYes

Inference Providers

ProviderPackageChatEmbedVisionTools
Groqproviders/groqYesYesYes
Together AIproviders/togetherYesYesYes
Mistralproviders/mistralYesYesYesYes
Fireworks AIproviders/fireworksYesYesYes
Perplexityproviders/perplexityYes
xAI (Grok)providers/xaiYesYesYes
OpenRouterproviders/openrouterYesYesYesYes
Cerebrasproviders/cerebrasYes
SambaNovaproviders/sambanovaYes
Deepinfraproviders/deepinfraYesYesYes
NVIDIA NIMproviders/nvidiaYesYesYes
Lepton AIproviders/leptonYes
Novita AIproviders/novitaYes
Anyscaleproviders/anyscaleYes
Hyperbolicproviders/hyperbolicYes
Nebiusproviders/nebiusYesYesYes
AI21providers/ai21YesYes

Local Providers

ProviderPackageAPI KeyChatEmbedVisionTools
Ollamaproviders/ollamaNot requiredYesYesYesYes
LM Studioproviders/lmstudioNot requiredYesYesYesYes

Embeddings-Only Providers

ProviderPackageEmbed
Voyage AIproviders/voyageaiYes
Jina AIproviders/jinaaiYes

Generic

ProviderPackageDescription
OpenAI-Compatibleproviders/opencompatConnect any OpenAI-compatible API

Quick Example

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"))),
)

Capabilities

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 Health

Nexus tracks provider health automatically — success/failure counts, average latency, and P99 latency. Use this data for smart routing decisions:

nexus.WithHealthTracker(provider.NewMemoryHealthTracker())

On this page