Many AI providers offer OpenAI-compatible APIs. Instead of maintaining separate SDKs for each, tryAGI.OpenAI includes CustomProviders factory methods that return a pre-configured OpenAiClient pointing to the correct base URL and with the right defaults.
varclient=CustomProviders.Groq(apiKey);IChatClientchatClient=client.AsChatClient("llama-3.3-70b-versatile");awaitforeach(varupdateinchatClient.GetStreamingResponseAsync("Tell me a joke.")){Console.Write(update.Text);}
// Ollama (default: http://localhost:11434)varollamaClient=CustomProviders.Ollama();IChatClientchat=ollamaClient.AsChatClient("llama3.2");// LM Studio (default: http://localhost:1234)varlmStudioClient=CustomProviders.LmStudio();IChatClientchat2=lmStudioClient.AsChatClient("your-model-name");
CustomProviders vs dedicated SDKs
Aspect
CustomProviders
Dedicated SDK
Installation
tryAGI.OpenAI (one package)
tryAGI.{Provider} (per provider)
API coverage
OpenAI-compatible endpoints only
Full provider API
MEAI support
IChatClient + IEmbeddingGenerator
Provider-specific interfaces
Provider-specific features
Limited to OpenAI compatibility
Full access
Use CustomProviders when you only need chat/embeddings and the provider is OpenAI-compatible.
Use a dedicated SDK when you need the provider's full API or unique features.