Courseiva
AI-102Chapter 10 of 16Objective 4.1

Generative AI: Model Selection and Deployment on Azure

Without understanding how to select and deploy generative AI models properly, you will waste thousands of pounds on the wrong tool, launch a chatbot that gives nonsense answers, or lock your company into a platform that doesn't scale. This chapter fixes that by teaching you the exact framework Azure uses to help you choose the right model for your job and get it running in production.

12 min read
Advanced
Updated Jul 23, 2026
Reviewed by Johnson Ajibi· Senior Network & Security Engineer · MSc IT Security

A simple way to picture Generative AI: Model Selection and Deployment on Azure

The 3-Bedroom House Renovation Analogy

You have a budget of exactly £15,000 to renovate a 3-bedroom house and need to choose a central heating system. Do you buy a basic boiler you install yourself from a DIY store for £800, a mid-range combi boiler a plumber fits for £3,500, or a smart, app-controlled heating system with zone control and a 5-year warranty for £7,200? Your choice depends on the size of the house, how much you care about fine-grained control, and whether you have a plumber on speed dial or plan to do the work yourself. The boiler itself is the model; the plumber or the DIY installation is the deployment environment. If the house is a summer holiday shack you visit twice a year, the basic boiler is fine. If it's a family home with elderly parents who need precise room temperatures, the smart system is worth the premium. And if you have no idea about pipework, you absolutely must use a professional plumber (Azure AI Studio) rather than attempting to install a boiler on your own kitchen wall. The point is this: picking the cheapest, most powerful, or most popular boiler without considering your actual house layout, your skill level, and your long-term budget is a recipe for a freezing winter. In exactly the same way, picking a generative AI model without considering your data volume, latency needs, and your team's expertise will cost your project dearly.

After you pick the right boiler, you need to deploy it. You can install it inside the house (like deploying a model on your own server), or you can use a heat-as-a-service company that pipes hot water into your home from a central plant (like using an API endpoint). Both work, but they change everything about your responsibilities: who maintains the kit, who pays for fuel, and who you call when the radiators are cold at 2am.

How It Actually Works

Let's start with the basics. Generative AI is a type of artificial intelligence that creates new content — text, images, code, music — rather than just classifying or predicting things. Think of it as an extremely fast, pattern-matching mimic. It learns from millions of examples (called training data) and then uses that knowledge to generate brand-new outputs that look like the originals.

A model is the mathematical brain that does this work. It's a huge file containing billions of numbers (parameters) that represent the patterns learned during training. The most famous generative AI models today are large language models (LLMs) like GPT-4, Claude, or Llama. They are called 'language models' because they are trained on text, but they can be fine-tuned for images, code, or audio.

Now, why can't you just download any model and plug it into your business? Because models come in different sizes, speeds, costs, and specialties. Selecting the right one is like choosing between a bicycle, a family car, and a cement truck for your commute. Each does a different job. Azure hosts dozens of models through a service called Azure AI Studio — it's a central marketplace where you can browse, test, and deploy models.

What are the key factors when selecting a model? - Task type: What do you want the model to do? Summarise documents? Generate images? Answer customer questions? Write code? Different models are optimised for different tasks. - Performance: How accurate and coherent must the output be? A model that writes marketing copy might need high creativity; a model that answers medical questions must be extremely factual and safe. - Cost: Models are often billed per token. A token is a chunk of text (roughly 3/4 of a word). More capable models cost more per token. Running a GPT-4 level model for a small internal tool might bankrupt your project. - Latency: How fast do you need the answer? Real-time customer chat needs sub-second responses, which smaller models provide. A background document analysis can wait 10 seconds. - Data privacy: Do you need the model to run inside your own virtual network, or is it acceptable to send data to a shared Azure endpoint? Some industries (finance, healthcare) require models deployed within a private environment. - Customisation: Can you fine-tune the model on your own data? Foundation models are general-purpose; you may need to train them on your company's documents to make them useful.

Deployment is the process of making your selected model available for use by applications. In Azure, you have three main deployment options.

First, Model-as-a-Service (MaaS) through a serverless API endpoint. This is the simplest option: you call a REST API, send your input, and get back an output. Azure handles all the infrastructure. It's perfect for prototyping and low-volume use. You pay per token used, with no upfront cost.

Second, managed compute deployments. Here you reserve dedicated virtual machines (VMs) or GPU clusters to run the model. You pay for the compute even when idle, but you get predictable performance, low latency, and full control over the model's runtime. This is for high-volume, production-critical workloads.

Third, you can deploy your own containerised model using Azure Kubernetes Service (AKS) or Azure Container Instances. This is for scenarios where you have built a custom model or need extreme customisation.

Once deployed, you must manage the model's lifecycle. That means monitoring performance, updating the model when a new version is released, rolling back if it degrades, and scaling up or down based on demand. Azure AI Studio provides tools for all of this: you can track metrics, set up alerts, and create deployment slots for safe updates.

The key principle is this: selection and deployment are two halves of a single decision. Picking a model that is too large for your latency budget is as bad as deploying a perfect model on infrastructure that costs more than your entire IT budget. You must balance both together.

Flowchart showing the end-to-end process of selecting and deploying a generative AI model on Azure, from requirements definition to ongoing lifecycle management.

Walk-Through

1

1. Define your requirements

Write down exactly what your application needs: task type (chat, summarisation, code gen), latency target (e.g., less than 3 seconds), daily request volume (e.g., 10,000), data privacy level (public or private), and budget. Without this, you cannot evaluate models.

2

2. Browse and evaluate models in Azure AI Studio

Go to the model catalogue in Azure AI Studio. Filter by task, size, and cost. Use the built-in playground to test each model with real data from your business. Measure accuracy and latency for your specific use case.

3

3. Choose a deployment method

Based on your volume and budget, decide: serverless API for low volume or prototyping; managed compute for predictable, high-volume workloads; containerised for custom models or full control. Check Azure's pricing calculator to compare costs.

4

4. Configure content safety and compliance

Enable Azure AI Content Safety to filter harmful inputs and outputs. Set up data encryption at rest and in transit. If required, configure private endpoints to keep data inside your virtual network. Review and apply responsible AI transparency notes.

5

5. Deploy and test in a staging environment

Create a deployment slot in Azure AI Studio for staging. Send real test requests. Monitor latency, token usage, and error rates. Adjust model parameters (temperature, max tokens) based on test results.

6

6. Promote to production and set up monitoring

Swap the deployment slot to production. Set up Azure Monitor and Application Insights to track performance metrics, usage spikes, and anomalies. Create alerts for cost overruns and error rate thresholds.

What This Looks Like on the Job

Imagine you work at a mid-sized UK insurance company called 'SafeGuard Insurance Ltd'. The CEO wants a chatbot that can answer customer questions about policy documents in real-time, across web and mobile. The chatbot must be accurate to avoid legal liability, respond in under 3 seconds, and process 10,000 conversations per day. Your IT team knows nothing about running AI infrastructure.

Your first task is model selection. You go to Azure AI Studio and browse the model catalogue. You see small models like Phi-3 (fast, cheap, but less accurate) and large models like GPT-4o (extremely accurate but slower and costly per token). Given the legal risk, you cannot afford hallucination. You choose GPT-4o, but you are worried about latency.

You then test the model with sample insurance questions. Using the playground in AI Studio, you send 50 different policy queries. The model answers well, but responses take 4 seconds each — too slow for the 3-second target. You switch to GPT-4 Turbo, a slightly smaller model, and latency drops to 2.5 seconds with minimal accuracy loss. That is your selection.

Now deployment. You have three options on Azure. Given your team is not operations-savvy, you choose Model-as-a-Service (serverless). You create an API endpoint in AI Studio, configure it with a content filter to block toxic or off-topic questions, set up a rate limit of 100 requests per minute per user, and enable logging to capture all responses for compliance. The whole setup takes two hours.

You then build the chatbot. Your front-end developer writes a simple function that calls the GPT-4 Turbo API with the user's question and the insurance policy context. You test it. Everything works.

But after one week, usage spikes because a competitor announced a price rise and customers flood your chatbot. The serverless endpoint handles it automatically — Azure scales up. However, your monthly bill shoots from £200 to £2,800. You see the cost in Azure Cost Management and decide to switch to a provisioned throughput unit model. You purchase 10 PTUs (provisioned throughput units) for GPT-4 Turbo, paying a flat monthly fee of £1,500. This caps your maximum cost and provides reserved capacity. You redeploy, and now your chatbot runs predictably and economically.

What did you do as an IT professional? You evaluated models, tested latency, chose an appropriate deployment model, configured content safety, monitored cost, and optimised pricing. That is the everyday reality of model selection and deployment on Azure.

How AI-102 Actually Tests This

The AI-102 exam objective 4.1 focuses on planning, selecting, and deploying generative AI models. Expect between 5 and 8 questions on this topic across the exam, mostly in the multiple-choice and multiple-select formats.

The exam loves testing your ability to distinguish between model deployment options. You will see scenarios where you must choose between serverless API, managed compute, and containerised deployment. The trap is that serverless is always the cheapest for low volume but can be expensive at scale — the exam expects you to know that provisioned throughput (PTUs) is the cost-control mechanism for predictable workloads.

Another common question type asks you to select the right model for a given task. The exam will present a table with model characteristics (size, speed, cost, supported languages) and ask which model to use. Always match the task's latency requirement, data privacy needs, and budget to the model's properties. They love to include a powerful but slow model as a distractor.

You must memorise these concepts:

Token-based billing and how to calculate approximate cost

Content filtering and safety systems (built into Azure AI Content Safety)

The difference between fine-tuning and RAG (Retrieval Augmented Generation)

Deployment slots for version management

Scaling rules: scale up vs. scale out

The role of Azure AI Studio in the model selection workflow

Typical exam traps include:

Thinking serverless is always the best option (it isn't for high volume)

Confusing fine-tuning with prompt engineering

Assuming all models cost the same per token

Forgetting to consider data residency when selecting a deployment region

Key definitions to memorise:

Token: unit of text input/output used for billing

Provisioned throughput units (PTUs): pre-purchased capacity for predictable performance and cost

Content filter: a safety layer that blocks harmful content from being generated

Model-as-a-Service (MaaS): accessing a model via API without managing infrastructure

Managed compute: dedicated infrastructure for model hosting

The exam will also test your knowledge of responsible AI principles: you must be able to describe how content filters, transparency notes, and bias assessments are part of model selection and deployment. Look for questions where the 'wrong' answer ignores ethics or safety — those are always traps.

Key Takeaways

Model selection must balance task type, accuracy, latency, cost, and data privacy to avoid deploying the wrong tool for the job.

Azure offers three deployment options: serverless API (MaaS), managed compute (VMs), and containerised (AKS), each with different cost and control trade-offs.

Serverless deployment is ideal for prototyping and low-volume workloads because you pay only for tokens used.

Provisioned throughput units (PTUs) provide predictable performance and cap costs for high-volume production workloads.

Content filters in Azure AI Services are mandatory, not optional, and must be configured as part of any generative AI deployment.

Deploying a model is not a one-time event — you must monitor performance, handle version upgrades, and plan for model lifecycle management.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Serverless API

Pay per token used; no idle cost

Ideal for low-volume or prototype workloads

Azure handles all infrastructure scaling

Managed Compute

Pay for reserved compute even when idle

Ideal for high-volume, predictable workloads

You control scaling, but must configure it

GPT-4 (Large Model)

Higher accuracy, better at complex reasoning

Slower response time (typically 3-5 seconds)

More expensive per token

GPT-3.5 (Small Model)

Good for simple tasks, less accurate on complex

Faster response time (under 2 seconds)

Cheaper per token

Fine-tuning

Modifies model weights using your data

Requires significant GPU compute and time

Model becomes specialised but loses general ability

RAG (Retrieval Augmented Generation)

Does not change model weights

Adds external data to prompts at inference time

Model stays general, can use up-to-date information

Watch Out for These

Mistake

You always need the most powerful, largest model available because it will give the best results.

Correct

Larger models are slower, more expensive, and can actually be worse for simple tasks because they overcomplicate outputs. The best model is the smallest one that meets your accuracy requirements.

People see impressive demos of GPT-4-level models and assume bigger is better. In reality, most business tasks (classification, simple Q&A, summarisation) are perfectly handled by smaller, cheaper, faster models.

Mistake

Once you deploy a model, you can leave it running forever with no changes.

Correct

Models need ongoing monitoring, retraining, and updating. Model versions get deprecated. Data patterns change. Performance drifts. You must have a lifecycle management plan.

Beginners think of AI models like software versions — you install it and it works. But models degrade over time as new data differs from training data. Azure forces version updates, and failing to handle that breaks applications.

Mistake

Serverless deployment has no cost advantages over other options.

Correct

Serverless deployment is the cheapest option for low-volume or sporadic workloads because you pay only for tokens used. For high-volume, predictable workloads, provisioned throughput (PTUs) is cheaper.

People misunderstand the pricing model. They see serverless as 'per-use' and assume it's always expensive. But for a pilot or internal tool with 100 requests a day, it costs pennies.

Mistake

You can deploy any third-party model directly in Azure without any configuration.

Correct

Only models available in the Azure AI Studio model catalogue can be deployed via MaaS. Other models must be containerised (e.g., using Docker) and hosted on Azure compute, which requires more setup.

Azure is not an open marketplace. It curates model providers. Beginners assume 'any model' can be dropped in, but there are strict compatibility and licensing requirements.

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between serverless and provisioned throughput in Azure OpenAI?

Serverless bills you per token used, so costs vary with usage. Provisioned throughput (PTUs) lets you prepay for a set amount of capacity, giving predictable performance and capping cost. Serverless is best for variable or low usage; PTUs are best for steady, high-volume workloads.

Do I need to train a model from scratch to use generative AI on Azure?

No. Azure offers pre-trained foundation models (like GPT-4 or Llama) that you can use via API or fine-tune on your own data. You only need to train from scratch if you have a highly specialised domain with unique data that no existing model covers.

Can I deploy a model from Hugging Face directly on Azure?

Yes, but not via the simple serverless option. You must containerise the model and deploy it on Azure Kubernetes Service (AKS), Azure Container Instances, or a virtual machine. Azure also has a curated list of Hugging Face models available in AI Studio for easier deployment.

How do I choose between GPT-4 and GPT-3.5 for my chatbot?

If you need high accuracy, handle complex queries, or want to reduce hallucinations, choose GPT-4. If latency and cost are more important and your queries are simple or domain-limited, GPT-3.5 is sufficient. Test both with your actual data before deciding.

What happens if my model goes over budget on serverless deployment?

You will continue to be billed per token until you hit a hard cap. To avoid surprise bills, set a monthly budget alert in Azure Cost Management and configure a rate limit or a spending limit on the API endpoint. Azure does not automatically stop your endpoint.

What is a 'token' and how does it affect pricing?

A token is a small piece of text — roughly 3/4 of a word. Models charge per input token (what you send) and per output token (what the model generates). Longer prompts and longer responses cost more. For example, the word 'understand' is about 2-3 tokens.

Terms Worth Knowing

Keep going

You've finished Generative AI: Model Selection and Deployment on Azure. Continue through the AI-102 study guide to build a complete picture of the exam.

Done with this chapter?