Skip to main content

Posts

Showing posts with the label Gemini and Groq

Calling Multiple AI Providers from .NET: OpenAI, Gemini, Groq and Fallbacks

Multiple AI Providers in .NET with IChatClient In a previous article, I looked at the first step in building an AI-enabled .NET application: connecting an application to a large language model through IChatClient . That approach works well when an application has one AI provider and one primary model. Production applications are usually less predictable. A provider can become temporarily unavailable. A model can hit a rate limit. A particular workload may be too expensive for a premium model. Another model may be faster for a simple classification task. An organization may also need a second provider because of availability, compliance, data-governance, or vendor-dependency requirements. This raises a practical architectural question: How can a .NET application use multiple AI providers without spreading provider-specific code throughout the application? In this article, we'll build that architecture around Microsoft.Extensions.AI and IChatClient . We...