BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Microsoft Releases Preview of AI Integration Libraries for .NET

Microsoft Releases Preview of AI Integration Libraries for .NET

Last week, Microsoft announced the preview release of two libraries: Microsoft.Extensions.AI.Abstractions and Microsoft.Extensions.AI. These packages, referred to as Unified AI Building Blocks, provide the .NET ecosystem with essential abstractions for integrating artificial intelligence (AI) services into .NET applications and libraries, along with middleware to enhance key capabilities.

As stated in the original announcement, it is developed in collaboration with the .NET community, including Semantic Kernel, these libraries offer a unified layer of C# abstractions. They encourage interaction with AI services such as small and large language models (SLMs and LLMs), embeddings, and middleware.

In the official announcement, Microsoft stated:

Currently, our focus is on creating abstractions that can be implemented by various services, all adhering to the same core concepts. We do not intend to release APIs tailored to any specific provider's services. Our goal is to act as a unifying layer within the .NET ecosystem, enabling developers to choose their preferred frameworks and libraries while ensuring seamless integration and collaboration across the ecosystem.

(Microsoft.Extensions.AI Architecture Diagram, Source: Offical Microsoft DevBlog)

Microsoft highlights several benefits, such as the libraries offering a unified API abstraction for AI services, similar to the company's logging and dependency injection abstractions as explained, the goal is to provide standard implementations for caching, telemetry, tool calling, and other common tasks that work with any provider, delivering consistent APIs and conventions.

The libraries provide flexibility by allowing .NET authors to use AI services without being tied to a specific provider. They enhance ease of use by enabling developers to experiment with different packages using the same abstractions, maintaining a single API throughout applications. Componentization simplifies adding capabilities and testing.

Furthermore, the preview release includes reference implementations for OpenAI, Azure AI Inference, and Ollama. Notably, Microsoft plans to collaborate with package authors across the .NET ecosystem to integrate these abstractions into client libraries, thus eliminating the need for additional packages. The company encourages developers who maintain .NET client libraries for AI services to implement these abstractions.

Regarding the future, Microsoft states the intention to continue releasing the libraries in preview, expecting them to remain so through the .NET 9 release in November as they gather feedback. Near-term plans include collaborating with Semantic Kernel on integration, updating samples like eShop to use the libraries, and working with developers on adoption.

Also, for the near future, the development team emphasizes the following:

Work with everyone across the .NET ecosystem on the adoption of Microsoft.Extensions.AI. The more providers implement the abstractions, the more consumers use it, and the more middleware components are built, the more powerful all of the pieces become.

Community feedback on the preview release has been generally positive, with developers expressing excitement and curiosity about the new libraries. Some have questioned the reasoning behind naming the namespace Microsoft.Extensions.AI and wondered if alternatives like Microsoft.Extensions.LLM was considered, given the focus on large language models.

Others are interested in understanding the specific benefits the package could bring to existing architectures that already use AutoML. There is also anticipation for F# versions of the libraries, with developers eager for their release. Additionally, clarification was asked—and confirmed—on whether the libraries work with the Azure OpenAI library for .NET, noting that developers can use AzureOpenAIClient instead of OpenAIClient.

For interested readers, detailed instructions on how to get started with the Microsoft.Extensions.AI packages are available in the Microsoft official blog post.

About the Author

Rate this Article

Adoption
Style

BT