CertBrain
CoursesBlog
Sign in
← Back to decks
Sign in to save your progress, vote, and build your own decks.Sign in

Running Models in Production

Once a model is chosen, applications need a way to send it requests and get answers back. There are two main ways to do that: call a managed API service, where someone else runs the model, or host the model yourself behind your own API. The exam tests the trade-offs between the two: effort…

7 cards
Study this deck

Running Models in Production

Once a model is chosen, applications need a way to send it requests and get answers back. There are two main ways to do that: call a managed API service, where someone else runs the model, or host the model yourself behind your own API. The exam tests the trade-offs between the two: effort, control and how you pay.

What "Using a Model in Production" Means

In production, an application, such as a website, a mobile app or a back-office system, sends input to the model and receives a prediction or generated content. This is inference. The model sits behind an API (application programming interface), a defined way for software to send requests and get responses. The question is who runs the machines behind that API, and who looks after them. The answer affects how fast you can launch, how much control you keep, and how the bill is calculated.

Managed API Services

With a managed API service, the provider hosts and operates the model. You send a request and get a response; you never see a server. Amazon Bedrock works this way for foundation models. Its on-demand option charges for what you use: for text models, that's measured in tokens (small chunks of text). The provider handles scaling up when traffic spikes, patching, and keeping the model available. The trade-off is less control: you use the models and settings the service offers.

Self-Hosted APIs

With a self-hosted API, you deploy the model onto infrastructure you choose and pay for, such as an Amazon SageMaker AI endpoint or Amazon EC2 instances. You pick the model, including an open-source or custom one, its exact version, the instance types, and how it sits in your network. You usually pay for the instances while they run, whether or not requests arrive, and you take on more of the work of sizing, scaling and updating. SageMaker AI reduces that work compared with raw EC2, but you still make the capacity decisions.

Choosing Between Them

Managed API (e.g. Amazon Bedrock)Self-hosted (e.g. SageMaker AI endpoint, EC2)
Setup effortLowestHigher
Control over model and infrastructureLimited to what's offeredHigh
Typical cost modelPay per request or per tokenPay for running instances
Who scales and maintains itThe providerMostly you
Can run your own custom modelOnly where the service supports itYes

On the Exam

Watch for the constraint in the scenario. "Fastest to launch", "no infrastructure to manage" or "unpredictable, low volume" point to a managed API. "Must run our own custom or open-source model", "full control of the environment" or "steady, very high volume on dedicated capacity" point to self-hosting. A common trap is assuming self-hosting is always cheaper. At low or spiky volume, paying for idle instances usually costs more than paying per request. Many real systems mix both: a managed API for general tasks and a self-hosted endpoint for one specialised model.

Quiz me on this
A startup is adding a chatbot to its app. Traffic is unpredictable and usually low, and the team has no one to manage servers. Which way of using a foundation model fits BEST?
  1. Host an open-source model on a fleet of Amazon EC2 instances it manages itself
  2. Deploy a model to a SageMaker AI endpoint sized for peak traffic
  3. Train a custom model and run it on dedicated instances
  4. ✓ Call the model through a managed API service such as Amazon Bedrock
A bank has fine-tuned an open-source model and must control the exact model version, instance type and network placement for compliance reasons. Which approach meets these requirements?
  1. Use a provider model through a managed API, keeping the service's default settings
  2. ✓ Deploy the model to a self-hosted endpoint, such as a SageMaker AI endpoint
  3. Deploy the model with SageMaker Serverless Inference, which picks the compute for you
  4. Import the model into Amazon Bedrock and call it on demand
Which statement BEST describes how costs usually differ between a managed API service and a self-hosted model endpoint?
  1. ✓ Managed APIs bill per request or token; self-hosting bills for running instances
  2. Managed APIs always cost more than self-hosted endpoints, whatever the traffic volume
  3. Self-hosted endpoints stop costing anything once the model has finished deploying
  4. Both always bill one fixed monthly fee, no matter how much they are used
Managed API service
The provider hosts, scales and maintains the model; you just send requests and usually pay per request or token.
Self-hosted API
You deploy the model on infrastructure you choose, such as a SageMaker AI endpoint or EC2, gaining control but paying for running capacity.
Inference
Using a trained model to make predictions or generate content from new input.
When does self-hosting make sense?
When you must run your own custom or open-source model, or need full control of the environment it runs in.