Skip to content

Provider Setup Overview ​

Provider setup has one shape:

  1. Install the provider package.
  2. Let the source generator include its provider manifest in the application.
  3. For DI hosts, call AddHpdGeneratedProviders().
  4. Configure an optional agent default or provide Clients.* per run.
  5. Put secrets in environment variables or an explicit secret resolver.
  6. Run the agent with RunAsync(...).

Provider Capability Snapshot ​

Provider keys do not all mean the same thing. Some keys only create chat clients; some keys create multiple client families; some features such as hosted files or native realtime require a specific family slot.

Provider keyChatSTTTTSRealtimeImagesEmbeddingsHosted filesNotes
openaiyesyesyesyesyesyesyesChat and non-audio families come from HPD-Agent.Providers.OpenAI; audio families come from the OpenAI audio provider package.
azure-openaiyesnononoyesyesyesTraditional Azure OpenAI resource path; ModelName is a deployment name.
azure-aiyesnonononononoAzure AI Projects / Foundry chat path; endpoint/auth requirements differ from azure-openai.
anthropicyesnonononononoChat provider package.
cohereyesnonononoyesnoNet10-only chat and embeddings provider package. Streaming produces a single final update.
dashscopeyesnonononoyesnoNet10-only chat and embeddings provider package backed by the Cnblogs DashScope MEAI adapter.
cerebrasyesnonononononoChat provider package backed by Cerebras' OpenAI-compatible chat completions API.
deepseekyesnonononononoChat provider package backed by DeepSeek's OpenAI-compatible chat completions API.
deepinfrayesnonononononoChat provider package backed by the shared OpenAI-compatible chat-completions client.
fireworksyesnonononononoNet10-only chat provider package backed by the shared OpenAI-compatible chat-completions base.
sambanovayesnonononononoChat provider package backed by SambaNova's OpenAI-compatible chat completions API.
hyperbolicyesnonononononoChat provider package backed by Hyperbolic's OpenAI-compatible chat completions API.
ovhcloudyesnonononononoChat provider package backed by OVHcloud AI Endpoints' OpenAI-compatible chat completions API.
nscaleyesnonononononoChat provider package backed by Nscale's OpenAI-compatible chat completions API.
veniceyesnonononononoChat provider package backed by Venice.ai's OpenAI-compatible chat completions API.
perplexityyesnonononononoChat provider package backed by Perplexity's OpenAI-compatible Sonar API.
lmstudioyesnonononononoLocal chat provider package backed by LM Studio's OpenAI-compatible local server.
nebiusyesnonononononoChat provider package backed by Nebius Token Factory's OpenAI-compatible API.
nvidia-nimyesnonononononoChat provider package backed by NVIDIA NIM's OpenAI-compatible API.
siliconflowyesnonononononoChat provider package backed by SiliconFlow's OpenAI-compatible API.
scalewayyesnonononononoChat provider package backed by Scaleway Generative APIs' OpenAI-compatible API.
zaiyesnonononononoChat provider package backed by Z.AI's OpenAI-compatible API.
minimaxyesnonononononoChat provider package backed by MiniMax's OpenAI-compatible API.
togetheryesnonononoyesnoNet10-only chat and embeddings provider package. Supports token streaming, function tools, reasoning content, and JSON object responses.
xaiyesnonononononoChat provider package backed by the shared OpenAI-compatible chat-completions client. Images, embeddings, audio, files, batches, and deferred completions are deferred.
groqyesnonononononoNet10-only chat provider package backed by Groq's OpenAI-compatible chat completions API.
moonshotyesnonononononoNet10-only chat provider package backed by Moonshot/Kimi's OpenAI-compatible chat completions API.
replicatenonononoyesnonoNet10-only image generation provider package backed by bounded Replicate model predictions.
google-aiyesnonononononoChat provider package.
ollamayesnonononononoLocal or server-backed chat; no API key required.
huggingfaceyesnonononononoChat provider package.
mistralyesnonononononoChat provider package.
bedrockyesnonononononoUses AWS SDK credential behavior.
onnx-runtimeyesnonononononoLocal ONNX Runtime GenAI chat provider.
elevenlabsnoyesyesnonononoRealtime Scribe is exposed through the speech-to-text family, not Clients.Realtime.

Use this table to choose the provider family slot. Then open the provider-specific page for package names, environment variables, and typed options.

Fluent setup should be the first choice in application code:

csharp
using HPD.Agent;
using HPD.Agent.Providers.Anthropic;

var agent = await new AgentBuilder()
    .WithAnthropic(model: "claude-3-5-sonnet-latest")
    .BuildAsync();

var result = await agent.RunAsync("Summarize provider setup in one sentence.");
Console.WriteLine(result.Text);

JSON or configuration setup is useful when agent definitions are stored outside code. Use Clients.Chat:

json
{
  "Clients": {
    "Chat": {
      "ProviderKey": "anthropic",
      "ModelName": "claude-3-5-sonnet-latest"
    }
  }
}

Provider-specific construction and transport options live on the same family config through ProviderConfig. For example, audio providers use provider configuration for voice, output format, speech speed, transcript options, and realtime provider ids. Chat providers use provider configuration only for controls that are native to that provider or SDK.

Provider and model selection uses AgentRunConfig.Clients.Chat.ProviderKey and ModelName. Runtime chat behavior uses ChatClientConfig: temperature, top-p, max output tokens, stop sequences, response format, tools, tool mode, seed, and generic reasoning options. Agent-level defaults belong in AgentConfig.Clients.Chat; per-run replacements belong in AgentRunConfig.Clients.Chat.

In C# code, use the provider's typed config with SetProviderConfig(...) when available. In stored JSON, use the ProviderConfig object.

Fluent Helpers And Family Config ​

Most application code should use provider builder extensions because they keep setup short and strongly typed:

csharp
using HPD.Agent;
using HPD.Agent.Providers.Audio.OpenAI;

var agent = await new AgentBuilder()
    .WithOpenAITextToSpeech(model: "tts-1", voice: "nova")
    .BuildAsync();

Those helpers do not create a different system. They populate the same Clients.* family config that JSON uses:

Setup styleBest forTradeoff
Fluent builder extensionNormal C# apps, samples, tests, local setup.Requires referencing the provider package in code.
Clients.* JSON/configStored agent definitions, FFI, generated configs, control planes.More verbose; provider configurations are stored in ProviderConfig.
Manual ChatClientConfig + SetProviderConfig(...)Advanced C# composition or dynamic family wiring.More ceremony, but exact control over the family slot.

For audio, provider setup and runtime behavior are separate. .WithOpenAITextToSpeech(...) chooses a TTS provider; WithAudioRuntimeAttachment(...) or WithAudio() decides when assistant text is synthesized, where artifacts go, and whether playback/projection is enabled.

Provider Keys ​

Use these current chat provider keys:

ProviderKeyPrimary setup page
OpenAIopenaiOpenAI And Azure OpenAI
Azure OpenAIazure-openaiOpenAI And Azure OpenAI
Azure AIazure-aiAzure AI
AnthropicanthropicAnthropic
CoherecohereCohere
DashScopedashscopeDashScope
CerebrascerebrasCerebras
DeepSeekdeepseekDeepSeek
DeepInfradeepinfraDeepInfra
Fireworks AIfireworksFireworks AI
SambaNovasambanovaSambaNova
HyperbolichyperbolicHyperbolic
OVHcloud AI EndpointsovhcloudOVHcloud AI Endpoints
NscalenscaleNscale
Venice.aiveniceVenice.ai
PerplexityperplexityPerplexity
LM StudiolmstudioLM Studio
Nebius Token FactorynebiusNebius Token Factory
NVIDIA NIMnvidia-nimNVIDIA NIM
SiliconFlowsiliconflowSiliconFlow
Scaleway Generative APIsscalewayScaleway Generative APIs
Z.AIzaiZ.AI
MiniMaxminimaxMiniMax
Together AItogetherTogether AI
xAIxaixAI
GroqgroqGroq
MoonshotmoonshotMoonshot
ReplicatereplicateReplicate
Google AIgoogle-aiGoogle AI
OllamaollamaOllama
Hugging FacehuggingfaceHugging Face
MistralmistralMistral
Amazon BedrockbedrockAmazon Bedrock
ONNX Runtimeonnx-runtimeONNX Runtime
OpenAI audioopenaiOpenAI Audio
ElevenLabs audioelevenlabsElevenLabs Audio

OpenRouter and Azure AI Inference legacy are outside the primary setup path. OpenRouter currently has a provider implementation but no package-level fluent AgentBuilder helper. Azure AI Inference is obsolete and should be treated as legacy-only.

Agent Definition Style ​

HPD separates provider selection from agent definition.

Use AgentBuilder when the app owns the agent definition in code. Use stored agent definitions when a hosted app needs to create, update, list, or select agent configs at runtime. Use an IAgentFactory override when construction depends on application services or policy that should not be stored as JSON.

This is different from frameworks where each provider produces a different agent subclass. In HPD, provider packages create family-specific clients; the Agent runtime still owns sessions, threads, middleware, events, tools, and hosting behavior.

Setup Caveats ​

Agent construction validates provider-independent structure. Provider-specific configuration is validated and credentials are resolved when a run acquires its provider client. Secret resolution can use explicit runtime secrets, environment variables, custom resolvers, or configuration.

Setup pathBehavior
OpenAI, Azure OpenAI, Anthropic, Cohere, DashScope, Cerebras, DeepSeek, DeepInfra, Fireworks AI, SambaNova, Hyperbolic, OVHcloud AI Endpoints, Nscale, Venice.ai, Perplexity, Nebius Token Factory, NVIDIA NIM, SiliconFlow, Scaleway Generative APIs, Z.AI, MiniMax, Together AI, xAI, Groq, Moonshot, Google AI, Hugging Face, MistralEnv-backed fluent and Clients.Chat setup can use the documented aliases. Missing credentials fail when a run first acquires that provider client, not during BuildAsync().
LM StudioLocal fluent setup works without credentials when the LM Studio local server is running. Endpoint and optional API-key aliases are available for proxied or secured local setups.
BedrockRegion env is accepted; credentials normally flow through the AWS SDK default credential chain.
OllamaEndpoint env aliases apply to fluent .WithOllama(...); JSON/config setup should include Endpoint when not using localhost.
ONNX RuntimeLocal model paths are required for live inference. Compatible ONNX Runtime GenAI instruct models can opt into structured tool calling.

See Providers, Clients, And Secrets, Provider Families, and Provider Keys And Environment Variables.

For per-run provider/model switching, named static credentials, serialization rules, and client-cache behavior, see Runtime Provider Selection And Authentication.

Built for production .NET agent applications.