Microsoft today announced the preview release of Microsoft.Extensions.AI, a set of core .NET libraries designed to assist developers in building AI applications. Microsoft.Extensions.AI provides a unified API abstraction for AI services, including small and large language models (SLMs and LLMs), embeddings, and middleware. Additionally, it offers standard implementations for caching, telemetry, tool calling, and other common tasks.
In this preview phase, Microsoft is providing reference implementations for OpenAI, Azure AI Inference, and Ollama. Microsoft highlights the following core benefits of Microsoft.Extensions.AI:
Unified API: Delivers a consistent set of APIs and conventions for integrating AI services into .NET applications. Flexibility: Allows .NET library authors to utilize AI services without being tied to a specific provider, enabling adaptability to any provider. Ease of Use: Empowers .NET developers to experiment with different packages using the same underlying abstractions, maintaining a single API throughout their applications. Componentization: Simplifies the addition of new capabilities and facilitates the componentization and testing of applications.
You can download the Microsoft.Extensions.AI packages from the following links:
Microsoft.Extensions.AI.AzureAIInference Microsoft.Extensions.AI.OpenAI Microsoft.Extensions.AI.Ollama
Library developers can consider implementing the Microsoft.Extensions.AI interfaces in their libraries, enabling users to easily integrate their NuGet package via the abstractions. Libraries that consume AI services can utilize the new abstractions instead of hardcoding to a specific AI service, providing end developers with the flexibility to choose their preferred service. App developers can leverage these abstractions to simplify integration within their apps and ensure portability across models and services.
Microsoft anticipates that the Microsoft.Extensions.AI library will remain in preview through the .NET 9 release. The Microsoft.Extensions.AI team plans to collaborate with Semantic Kernel to integrate Microsoft.Extensions.AI as its foundational layer.
Microsoft.Extensions.AI is a promising addition to the .NET ecosystem, empowering developers to build AI-powered applications more efficiently. Its focus on flexibility and ease of use is likely to be welcomed by the developer community.
Source: Microsoft