---
source_url: "https://cloud.google.com/blog/topics/developers-practitioners/introducing-google-cloud-vertex-ai-extensions-for-net"
title: "Introducing Google Cloud Vertex AI Extensions for .NET | Google Cloud Blog"
mirrored_at: 2026-08-31T01:03:19.640Z
host: cloud.google.com
cited_in_42a: true
mirror_canonical: "https://index.42a.ai/cloud.google.com/blog/topics/developers-practitioners/introducing-google-cloud-vertex-ai-extensions-for-net"
---

> **Original source:** https://cloud.google.com/blog/topics/developers-practitioners/introducing-google-cloud-vertex-ai-extensions-for-net

In October 2024, Microsoft [announced](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/) the [Microsoft.Extensions.AI.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.AI.Abstractions/) and [Microsoft.Extensions.AI](https://www.nuget.org/packages/Microsoft.Extensions.AI) libraries for .NET. These libraries provide the .NET ecosystem with essential abstractions for integrating AI services into .NET applications from various providers such as Open AI, Azure, Google.

Today, we’re happy to announce the [Google.Cloud.VertexAI.Extensions](https://www.nuget.org/packages/Google.Cloud.VertexAI.Extensions) library. This is the Vertex AI implementation of **Microsoft.Extensions.AI**. This library enables .NET developers to integrate Google Gemini models on Vertex AI via the **Microsoft.Extensions.AI** abstractions. 

**Note**: This library is currently in pre-release/beta pending user feedback. Please [reach out](https://twitter.com/meteatamel) with any feedback you might have. 

## Core benefits

-   **Unified API**: Delivers a consistent set of APIs and conventions for integrating AI services into .NET applications.
    
-   **Flexibility**: Allows .NET library authors to use AI services without being tied to a specific provider, making it adaptable to any provider.
    
-   **Ease of Use**: Enables .NET developers to experiment with different packages using the same underlying abstractions, maintaining a single API throughout their application.
    

### APIs and functionality

There are three core interfaces: 

-   The `IChatClient` interface defines a client abstraction responsible for interacting with AI services that provide chat capabilities.
    
-   The `IEmbeddingGenerator` interface represents a generic generator of embeddings.
    
-   The `IImageGenerator` interface (experimental) represents a generator for creating images from text prompts or other input.
    

## What’s the Google.Cloud.VertexAI.Extensions library?

The **Microsoft.Extensions.AI** library supports  providers like OpenAI, Azure, and Ollama. The [Google.Cloud.VertexAI.Extensions](https://www.nuget.org/packages/Google.Cloud.VertexAI.Extensions) library is the Vertex AI implementation of **Microsoft.Extensions.AI**. It enables .NET developers to integrate with Google’s Gemini on Vertex AI via the **Microsoft.Extensions.AI** abstractions. 

## What about the Google Gen AI .NET SDK? 

At this point, you might be wondering: **Doesn’t Google already have a .NET SDK for Gemini?**

You’re right. There’s the [Google Gen AI .NET SDK](https://github.com/googleapis/dotnet-genai/) that we [announced](https://cloud.google.com/blog/topics/developers-practitioners/introducing-google-gen-ai-net-sdk) back in October 2025. Developers building applications that will only use Google as an AI provider should continue to use the **Google Gen AI .NET SDK**. Developers building applications that may use different AI providers (Google, OpenAI, Azure ...) will benefit from the **Google.Cloud.VertexAI.Extensions** library.

## Samples

Now that we understand the context, let’s take a look at some samples. 

### Microsoft.Extensions.AI with Ollama

Before we look into **Google.Cloud.VertexAI.Extensions**, let’s actually look at the hello world chat sample with Ollama.

Let’s take a look at the details.

## What’s the Microsoft.Extension.AI library?

**Microsoft.Extensions.AI** is a set of core .NET libraries that provide a unified layer of C# abstractions for interacting with AI services from different providers such as OpenAI, Azure AI Inference, Ollama.

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot1\_nGonzZI.max-1100x1100.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot1_nGonzZI.max-1100x1100.png)

This is Ollama using a Gemma3 model. That was easy enough! 

## Getting started with Google.Cloud.VertexAI.Extensions

To use **Google.Cloud.VertexAI.Extensions**, first, you need to add the package to your project. It’s currently in preview, so make sure to check for the latest beta version.

`dotnet add package Google.Cloud.VertexAI.Extensions --prerelease`

You will also need the **Microsoft.Extensions.AI** package:

`dotnet add package Microsoft.Extensions.AI`

### Chat

To use the `IChatClient` interface, first you need to initialize the client with Vertex AI specific initialization:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot2.max-1100x1100.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot2.max-1100x1100.png)

Then, you can start asking questions to the model:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot3.max-600x600.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot3.max-600x600.png)

Note that this sample is identical to the Ollama one and samples are the same across different providers. That’s the beauty of abstractions! The only unique part for Vertex AI is how the client is initialized.

You can also get back streaming responses:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot4.max-900x900.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot4.max-900x900.png)

You can also keep track of the chat history and send it along:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot5.max-1300x1300.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot5.max-1300x1300.png)

### Embeddings

For embeddings, create an embedding generator:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot6.max-700x700.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot6.max-700x700.png)

Generate embeddings for several inputs:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot7.max-900x900.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot7.max-900x900.png)

### Image Generation

Image generation follows the same pattern. 

Create an image generator for Vertex AI:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot8.max-700x700.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot8.max-700x700.png)

Generate an image:

![https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot9.max-1100x1100.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/screenshot9.max-1100x1100.png)

And you should see a cute baby sea otter!

![https://storage.googleapis.com/gweb-cloudblog-publish/images/otter.max-1100x1100.png](https://storage.googleapis.com/gweb-cloudblog-publish/images/otter.max-1100x1100.png)

Posted in

-   [Developers & Practitioners](https://cloud.google.com/blog/topics/developers-practitioners)