As we saw in Hello World, we can
use OpenAI or Azure OpenAI with Microsoft Agent
Framework.
But we are in no way limited to
those.
The reason why I chose those and spent
more time than other models is that this
is what I'm going to use throughout this
course.
And I'm especially going to use Azure OpenAI
because that's my preferred provider.
Azure OpenAI is pay-as-you-go, so
it's cheaper, but it requires a little more
setup, while OpenAI, as I mentioned in the
video, needs five US dollars up front before
you can begin to use it.
But again, there's so many more models, Google's
models, Anthropic models, Mistral, and so on.
And I'm going to go through how each
of these are being connected using Microsoft Agent
Framework, so you have a reference if you
want to use some of the others.
So let's get through this.
So OpenAI, we saw, very simple, OpenAI Client,
Chat Client, and so on.
And we only used this one specific NuGet
package.
Azure OpenAI, a little more complicated because we
needed two NuGet packages, and we needed to
put in an endpoint as well.
Google is probably the one that are the
least supported at the moment, as of this
recording being 6th of January, 2026.
There is a new official Google NuGet package
underway, but so far we have only been
to an unofficial package.
As soon as the official package goes live,
I will believe that it's just as capable
as the rest.
But for now, we have this generative AI
Chat Client package that we need to NuUp.
And while it looks like it can do
the same here, it has certain limitations when
you come to more advanced stuff.
In terms of getting your API keys, you
do that in aistudio.google.com or you
can also use the Google Cloud Platform.
Then we have Anthropic.
Anthropic have an official Microsoft Agent Framework package,
just like OpenAI have.
And in that, we just need to new up
an Anthropic Client, and in that we need
to give the API key.
And when we then use the agent, we
need to give some extra information, because we
can't give the model in the client itself.
We need to give it in something called
Chat Options here.
And a very important thing for Anthropic is
you also always need to give how many
tokens per call you can use.
So we do almost the same, but we
just need to give some additional Chat Client
agent options here with some model ID and
options.
But beyond that, it's exactly the same.
Mistral from France have also only an unofficial
package, but you can use it together with
the agent's AI.
And you just new up a Mistral client, give
your API key, and write mistral-client.completions
.create-ai-agent, because this completions is an
iChat client.
You go to admin.mistral.ai in order
to get your models and API keys.
XAI or Grok is possible to use as
well.
And Grok is one of those models that
have just adhered to the OpenAI spec instead
of making their own API.
So what you do is you just use
the OpenAI package, and instead of just giving
the API key, you also need to give
some options where you point to an endpoint,
meaning you point to XAI's endpoint instead of
OpenAI's endpoint.
But beyond that, it works exactly the same
way as OpenAI.
And you will see this throughout some of
these models that they have just taken the
same approach as OpenAI.
Microsoft Foundry is a bigger thing.
You still use two NuGet packages, but instead
of the OpenAI package, you use the Azure
AI package.
So this is something called persistent agents, meaning
that in the other cases, we have in
memory made our agent.
In Microsoft Foundry, you actually make an agent,
and it becomes a permanent thing up in
that portal.
You use something called AI project client in
order to do this, and you can't get
an API key for it.
You need to use a role-based access
system from Azure to work with them.
Once you do that, you get your client,
and it can create agents, and there are
even version histories, so you can go back
and forward between agents, and you can set
up your models on what agents should be
used.
Once you have done all that, you can
just get your AI agent like normal, and
you don't need to create it every single
time.
If you have the name and it already
exists, you can just get the agent in
that manner.
There will be separate lectures on Microsoft Foundry
because it's a much bigger thing, but for
now, we can just see that it is
possible to work with them, but they work
slightly different than the rest.
Then we have Amazon Bedrock, which is part
of the Amazon AWS system.
They have their own official NuGet package for
ME-AI, meaning Microsoft Extensions AI, and we
use them together with Agents AI, and once
you do that, you can make a new
client.
In order to do that, you need to
make an environment variable, so it needs to
be in environment values.
You can't really set it on the client
itself, but no big deal.
Then you need to know what region you
are in and get this runtime client.
Once you have one of those, you can
turn it into these iChat clients, and once
you have that, you get the normal Microsoft
agent.
Then we have Ollama, which is an offline
model, so you go and download the Olama
service.
You instal it in your machine, and you
run some commands to download the offline models.
Once you have done that, you make an
Olama client using something called OllamaSharp.
This is technically unofficial, but as it's offline,
it doesn't really matter too much.
This client is by default also an iChat
client, and instead of some endpoint up in
the cloud, you hook it up to a
local host or wherever you host the Olama
service.
You tell what model you want, and then
you just take this client and turn it
into an iChat client agent, and from there
on, it's exactly the same.
Another offline thing you can do is Microsoft
version called Foundry Local.
In Foundry Local, you have Winget, or you
can download it from a website, and you
can instal the Microsoft Foundry Local as a
Windows service.
Once you have that, you have a NuGet
package dedicated for that from Microsoft, and behind
the scenes, it's using the OpenAI spec, so
we just use the Microsoft Agent Framework OpenAI
NuGet package.
In order to do this, we then use
something called a Foundry Local Manager that says
it wants to start the model.
So we have our model name, we start
that model, and we get a manager back
that it has now started the model, where
we will get the information about the model,
like, for example, its real ID.
This is just the alias of the model,
like the open source chat GPT.
Once you have that, you need to make
an OpenAI client, and all OpenAI clients need
an API key, but you can just paste
anything in here.
In this case, no API key, and the
endpoint will be given on the fly by
the manager, so it will be some local
host and a port that it assigns on
the fly.
And once we have that, it is exactly
the same as we normally do.
We get our chat client with our model,
and we get our agent, so we can
do our run async.
Then we have OpenRouter.
OpenRouter is one of these companies that have
made deals with all the different providers, so
you can use Anthropic, you can use OpenAI,
you can use Grok, you can use all
the different models from almost any provider out
there.
And they have, as well, taken the OpenAI
as a NuGet package, so you just new
up with OpenAI, and you put in your
endpoint being OpenRouter.ai.api.v1. And once
you have that, it works exactly the same.
Same goes for another of these multi-LLM
providers, together.ai. It's exactly the same, but
just with a different URL.
We also have Cohere, works exactly the same
way as well.
They have their own models only, and they
are fairly limited, but they are good for
small education scenarios.
We have HuggingFace, which is one of these
free offerings, so you can technically work on
all this for free.
They don't have some of the big models.
It's more the more open source, the more
small models that exist out there, and they
are by far the biggest provider of models.
You can use them using OpenAI, so it's
exactly the same setup, just with a different
endpoint.
The final one we have is GitHub Models,
which is probably the best way of getting
hold of OpenAI and all the bigger models
for free, because as part of GitHub, you
can get with some fairly heavy rate limits,
but I guess you could manage throughout this
course to stay on GitHub Models if you
wish to.
You go up and make a personal access
token up in GitHub, and then you use
Azure AI Inference as a connector, so you
make one of these chat completion clients that
needs a URL, which is the inference URL
for GitHub, the Azure key credentials, which is
your GitHub personal access token, and then you
can say, as AI client, in order to
get your AI client here, and then it's
run like normal, but it requires a bit
more and more different NuGet packages.
That's the negative part about this, plus the
quite heavy rate limits.
Of course, if you pay, you can use
it without rate limits, but if you want
it free, it is one of the options
to actually get OpenAI for free.
And that's all the different providers I have
tried over the times.
There are probably many more, and they are
probably mostly just some OpenAI spec version, so
as you can see, you can easily hook
up to almost anything in this agent framework,
so it's no way a vendor login to
Microsoft or to OpenAI in any way.
So that was the bonus.
Let's go back to some of the more
educational parts of the agent framework before we
dive into some of the deeper topics.