← Learn AI
C_000247 · mlops and platform · advanced

Model Serving APIs

The HTTP or RPC surface exposing a model, including schema validation, health checks and versioned endpoints.

Step 1 of 4

In words

What it is, why it matters, and what it is like.

Why am I learning this?

A trained model on your computer is like a chef who knows exactly how to cook but has never seen a customer. Without an interface, you cannot give it new data to process, nor can you see if it is still working correctly. When you connect the model to an application—whether that is a website showing recommendations or a system detecting fraud—you need a bridge. This bridge takes the user's information, delivers it to the model, and returns the result. Building this bridge allows you to update the model without stopping the service, check that the system is healthy, and ensure the predictions remain accurate over time.

The idea, in plain terms

Imagine a busy restaurant. The kitchen (the model) has a recipe for predicting loan approval based on three numbers: income, debt, and years at the current job. Customers (applications) do not walk into the kitchen; they stand at a counter (the API).

When a customer hands a slip of paper to the counter with the words 'high income', the counter stops them. It says, 'I need three numbers, not words.' This ensures that only correct information enters the kitchen. This check is called schema validation.

The counter also checks if the kitchen is open. If the chefs are on a break or the stove is broken, the counter tells the customer, 'We cannot take orders right now.' This immediate feedback prevents customers from waiting for an answer that will never come. This status update is what we call a health check.

Furthermore, the counter needs to know two distinct things about the kitchen's state. Is the kitchen *ready* to take new orders? (Are the chefs at their stations and the ingredients prepared?). And is the kitchen *alive*? (Is the power on?). Readiness means 'I can accept work.' Liveness means 'I am not frozen or dead.'

Suppose the restaurant updates its recipe. Instead of stopping service, they might slowly let 5% of customers get the new prediction while everyone else gets the old one. This is a canary release: testing a change on a small group before showing it to everyone. If the new recipe causes errors, the counter detects this drift from expected results and alerts the manager.

Finally, because the kitchen has changed its recipe slightly over time, the counter must remember what format of information it used during training versus what format users send now. Mismatched formats are known as training-serving skew, and the API is where we spot and fix these mismatches before bad predictions go out.

An analogy

Think of the system as a secure bank vault. The model is the safe inside. The API is the heavy steel door with a keypad and a sensor array. You do not touch the money or the algorithms directly; you interact only through the door. When you press a code, the door checks if the numbers make sense (schema validation). If the power goes out, the door signals it is locked down (liveness). If the door opens to let you in, it signals that the interior is accessible and safe for transactions (readiness). The vault does not improvise; if you enter letters instead of numbers, the door refuses entry instantly. Unlike a human guard who might get tired or confused, this steel door follows strict physical rules every single time without fail.

Definition

A model serving API is the standardized interface that allows external applications to send data to a trained model and receive predictions back, while simultaneously managing access control, input validity checks, and system health monitoring.

Where this sits

This concept sits next to Model Registry and Versioning, which is the library where you store different copies of your model so the API can switch between them when needed. It also relates to Monitoring and Alerting, which is the practice of watching the data flowing through this API to spot when predictions start looking unusual or when system errors increase.

Signal from the Frontier

Get the next essay on mind, machine, and meaning

Essays at the intersection of AI, philosophy, and Indian governance. No promotional content.

We'll send a one-click sign-in link to confirm. No password needed.

Views expressed are personal and do not represent the Government of India or the Government of Uttarakhand.