Start studying
Module 14 · MLOps / LLMOps Module contents
Module 14  ·  Card 1 / 22beginner

APIs

An API is the contract other software uses to talk to your model.

REST over HTTP with JSON is the usual shape.

A request carries the input and a response carries the prediction.

The API hides the model entirely behind a stable interface.

That separation lets you swap the model without changing any caller.

Learn in depth ↓
Module 14 · MLOps / LLMOps · 22 concepts
In depth  /  15 lines

APIs, in more detail

An API is the contract other software uses to talk to your model.

It is the boundary between the model and everything that depends on it.

REST over HTTP with JSON is the usual shape and is understood everywhere.

A request carries the input, and the response carries the prediction.

The caller never sees the model, the framework or the weights.

That separation is the point, since you can swap the model without touching a caller.

Version the API, because a change in output shape breaks everyone downstream.

Validate the input and return a clear error rather than a stack trace.

Return structured errors that a caller can act on programmatically.

Include a request identifier in the response so a complaint can be traced to a log line.

Set timeouts, since a model call that hangs will take the caller down with it.

For slow work, return a job identifier and let the caller poll or receive a callback.

Streaming responses suit language models, because the first token arrives long before the last.

Document the shape, the limits and the error cases, since undocumented APIs get used wrongly.

Health and readiness endpoints let the platform know whether to send traffic.

Want the full technical article? Wikipedia ↗
Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
What does putting a model behind an API let you do?
MLOps / LLMOps

22 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close