Skip to content

Commit d3a1065

Browse files
johanrinclaude
andcommitted
Add blog post on Model Router in Microsoft Foundry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a2ecb99 commit d3a1065

8 files changed

Lines changed: 113 additions & 0 deletions

File tree

218 KB
Loading
168 KB
Loading
446 KB
Loading
137 KB
Loading
215 KB
Loading
96.2 KB
Loading
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: How to Use Model Router on Microsoft Foundry
3+
date: 2026-02-15
4+
draft: false
5+
images: ["post-cover.png"]
6+
description: Learn what LLM routing is and how to deploy Azure Model Router on Microsoft Foundry to automatically route prompts to the most cost-efficient model.
7+
categories: ["Tutorials", "AI"]
8+
tags:
9+
[
10+
"Model Router",
11+
"Microsoft Foundry",
12+
"Azure",
13+
"AI",
14+
"Tutorial",
15+
"LLM Routing",
16+
]
17+
---
18+
19+
Imagine you're building an app that calls an LLM. You default to Claude Opus 4.6 for everything. It works great. Until you see the bill.
20+
21+
Here's the thing: not every prompt needs the most powerful model. A simple "summarize this email" doesn't require the same firepower as "analyze this entire codebase and suggest improvements."
22+
23+
What if the system could make that call for you, in real time?
24+
25+
In my [previous post](https://johanrin.com/posts/deploy-mcp-server-microsoft-foundry/), I showed you how to deploy an MCP server on Microsoft Foundry. Today, let's explore another powerful feature: **Model Router**, Microsoft Foundry's built-in approach to intelligent LLM routing.
26+
27+
**In this post, you'll learn how to:**
28+
29+
- Understand what LLM routing is and why it matters
30+
- Deploy Azure Model Router on Microsoft Foundry
31+
- Test it with different prompt complexities
32+
- Know when to use it (and when not to)
33+
34+
Let's dive in.
35+
36+
## What is LLM Routing?
37+
38+
LLM routing is a layer that picks the right model for each prompt, automatically. Think smart dispatcher, matching each request to the right model.
39+
40+
The core idea is simple: match each prompt to the best model for the job, at the lowest price.
41+
42+
There are different ways to implement this, but in this post I'll focus on **fully managed routing**, the approach used by Microsoft Foundry Model Router and Amazon Bedrock Intelligent Prompt Routing.
43+
44+
## Meet Azure Model Router
45+
46+
Azure Model Router is Microsoft's managed solution for LLM routing. You deploy a single endpoint that dynamically routes each prompt in real time to the most suitable LLM. It's deployed on [Microsoft Foundry](https://johanrin.com/posts/getting-started-with-microsoft-foundry/) just like any other model.
47+
48+
At the time of writing, the latest version of the Model Router encapsulates the following models:
49+
50+
| Provider | Models |
51+
| --------- | ------------------------------------------------------------------------------------------------------------ |
52+
| OpenAI | gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-chat, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini, o4-mini |
53+
| Microsoft | gpt-oss-120b |
54+
| DeepSeek | DeepSeek-V3.1 |
55+
| Meta | Llama-4-Maverick-17B-128E-Instruct-FP8 |
56+
| xAI | grok-4, grok-4-fast-reasoning |
57+
| Anthropic | claude-opus-4-1, claude-sonnet-4-5, claude-haiku-4-5 |
58+
59+
> **Note:** Anthropic models require a separate deployment before they can be used with Model Router.
60+
61+
## Hands-On Tutorial
62+
63+
Now that we know what Azure Model Router is, let's deploy it on [Microsoft Foundry](https://ai.azure.com/nextgen).
64+
65+
Click on **Discover** in the navigation bar and select the **Models** section.
66+
67+
![Microsoft Foundry Discover page showing 11,300 AI models available for deployment](images/discover-page-models.png)
68+
69+
Search for "model router" and select it.
70+
71+
![Searching for Azure Model Router in the Microsoft Foundry model catalog](images/discover-page-models-model-router.png)
72+
73+
Here you'll find all the details about the Model Router. Click **Deploy** to deploy it with the default settings.
74+
75+
![Azure Model Router details page with Deploy button on Microsoft Foundry](images/discover-page-models-model-router-details.png)
76+
77+
Now let's test the Model Router in the playground.
78+
79+
We'll start with a simple prompt: just saying hello.
80+
81+
![Model Router routing a simple hello prompt to gpt-4.1-nano in the playground](images/model-router-hello.png)
82+
83+
The Model Router recognizes a straightforward prompt and routes it to gpt-4.1-nano. As expected, nothing complicated.
84+
85+
Now let's try something more challenging: asking it to summarize its own documentation.
86+
87+
![Model Router routing a complex summarization prompt to gpt-oss-120b](images/model-router-summary.png)
88+
89+
This time, the router selected gpt-oss-120b instead. Since the request was more complex, the Model Router chose a more capable model.
90+
91+
Comparing both models, the second one is more capable but also more expensive. That's the trade-off the router is making for you, automatically.
92+
93+
![Cost and capability comparison between gpt-4.1-nano and gpt-oss-120b on Microsoft Foundry](images/models-comparison.png)
94+
95+
## When to Use It (and When Not To)
96+
97+
Model Router shines when you're handling high-volume workloads with diverse prompt complexity.
98+
99+
However, if you're building a single-purpose app or need deterministic model selection, it's not the right fit. You're better off picking a specific model and sticking with it.
100+
101+
Also worth noting: you're **limited to the models encapsulated by Model Router**. If your use case requires a specific model, deploy that model directly.
102+
103+
One use case I find particularly interesting: testing. If you're unsure how complex your prompts actually are, the Model Router can help you measure that. Let it route for a while, observe which models it selects, and use that data to inform your final model choice.
104+
105+
## Conclusion
106+
107+
In the middle of the "best model" race, it's easy to forget that not every prompt needs the latest and greatest. LLM routing exists to solve exactly that, matching each request to the right model and saving you money in the process.
108+
109+
Azure Model Router is Microsoft's take on this, and it's surprisingly easy to get started with. Give it a try and let me know if it was cost-effective for your use case!
110+
111+
That's it for today. Hope you learned something!
112+
113+
If you have any questions, feel free to reach out on my socials!
61.6 KB
Loading

0 commit comments

Comments
 (0)