sagelearnai

Where Models Run: APIs, Cloud Platforms and Self-Hosting

The same model can be reached in very different ways: a public API, your cloud provider's managed service inside your network, your data platform, or GPUs you run yourself. Security reviews, data residency, cost shape and quota limits all depend on this choice more than on the model.

Learning objectives

  • Compare four ways of running models: provider API, cloud-managed service, data platform, self-hosted.
  • Map equivalent services across Azure, AWS, Google Cloud, Databricks and Snowflake.
  • Address data residency, processing terms and private networking in a design.
  • Choose between pay-as-you-go, provisioned throughput and batch pricing.

The four hosting models

Provider APICloud-managed serviceData platformSelf-hosted
ExamplesOpenAI, Anthropic, Google AI Studio APIsAzure OpenAI (AI Foundry), Amazon Bedrock, Vertex AIDatabricks Model Serving, Snowflake CortexvLLM, TGI or similar on your GPUs, on-prem or in your cloud account
Where data goesProvider's serviceProvider's service inside your cloud tenancy and regionYour data platform accountNever leaves your network
NetworkPublic internet (some offer private options)Private endpoints / VPC integrationPlatform's networkingFully yours
IdentityAPI keysCloud identity (managed identity, IAM roles)Platform identity and governanceYours
Model choiceThat provider's modelsA catalogue of several providers' modelsA catalogue plus your ownOpen-weight models only
Who runs itProviderCloud providerPlatformYou

Most enterprises in India and elsewhere start with the cloud-managed service of the cloud they already use, because security, networking, billing and procurement are already approved. Data platforms suit teams whose data and governance already live there. Self-hosting comes in for strict residency, very high steady volume or custom models.

Equivalent services

NeedAzureAWSGoogle CloudDatabricksSnowflake
Hosted LLMsAzure OpenAI and model catalogue (AI Foundry)Amazon BedrockVertex AI Model Garden (Gemini and partners)Foundation Model APIs, external modelsCortex LLM functions
Custom / open model servingAI Foundry managed compute, AKSSageMaker endpoints, EKSVertex AI endpoints, GKEModel ServingContainer services
Managed RAG / searchAzure AI SearchBedrock Knowledge Bases, OpenSearchVertex AI Search, Vector SearchVector SearchCortex Search
AgentsAI Foundry Agent ServiceBedrock Agents / AgentCoreVertex AI Agent Builder / Agent EngineAgent FrameworkCortex Agents
GuardrailsAzure AI Content SafetyBedrock GuardrailsModel Armor, safety settingsAI Gateway guardrailsCortex Guard
Gateway / API managementAPI Management (AI gateway features)API Gateway + Bedrock features, or third-partyApigeeAI Gateway— (use your own)

Product names change often; check each vendor's current catalogue. What stays stable is the shape: a model service, a retrieval service, an agent runtime, guardrails and a gateway.

Data residency and processing terms

Questions a security or legal team will ask, and you should answer before they do:

  • Where is data processed and stored? Pick a region in the required geography. Indian deployments commonly use Azure Central/South India, AWS Mumbai or Hyderabad, or Google Cloud Mumbai or Delhi, but check which models are available in that region: newer models often launch in a few regions first, and some services route requests across regions unless configured otherwise.
  • Is our data used for training? Enterprise terms of the major cloud services generally exclude training on customer prompts and outputs; confirm in the agreement, not in a blog post.
  • What is logged and for how long? Some services keep prompts for abuse monitoring for a period; some offer opt-outs for approved customers.
  • Which personal data flows through the model? Under India's DPDP Act and similar laws, you need a lawful basis, purpose limitation and retention rules (Module 6).

Networking and identity

  • Use private endpoints / VPC endpoints so model traffic never crosses the public internet.
  • Use workload identity (managed identities, IAM roles, service accounts), not long-lived API keys in config files. If keys are unavoidable, keep them in a secrets manager and rotate them.
  • Put an egress allow-list on application networks so only approved model endpoints can be reached.
  • Apply per-application quotas so one team can't exhaust a shared deployment.

Pricing models

ModelHow it worksUse when
Pay-as-you-goPer token, shared capacity, rate limits per deploymentStarting out, variable or modest traffic
Provisioned / reserved throughputPay for dedicated capacity by the hour or month (e.g. Azure provisioned throughput units, Bedrock provisioned throughput)Predictable high volume, strict latency SLOs, avoiding noisy neighbours
BatchSubmit jobs, results within hours, typically ~50% cheaperOffline extraction, classification, evaluation runs
Self-hosted GPUsPay for GPU instances whether busy or idleHigh steady utilisation, residency, custom models

Provisioned capacity only saves money if you keep it busy; model it against your peak and average load from the previous lesson.

Self-hosting in brief

The serving stack: an inference server (vLLM, Hugging Face TGI, NVIDIA Triton/TensorRT-LLM) on GPUs, behind your gateway, with autoscaling, monitoring and a model registry. Key techniques that make it affordable (continuous batching, paged KV cache, quantisation) are covered in Module 7. Budget for the people: someone must patch, upgrade, capacity-plan and be on call.

The sentence to say

"I'd default to the managed model service on the client's existing cloud, in an Indian region with private endpoints and managed identity, after confirming the model is available there and that the terms exclude training on our data. I'd move a workload to provisioned throughput or self-hosting only when the numbers justify it."

Self-check

A bank's CISO asks: "where does our customer data go when your copilot answers?" Answer.
  • Through our gateway inside the bank's network, over a private endpoint, to the managed model service in an Indian region; enterprise terms exclude training on prompts and outputs; logging and retention are configured as agreed.
  • PII is masked where it isn't needed, access is per user, and everything is audited. Show the data-flow diagram.
When would you move from pay-as-you-go to provisioned throughput?
  • When traffic is high and predictable enough to keep dedicated capacity busy, or when latency SLOs and noisy neighbours make shared capacity risky. Model it on peak and average load first.

Last reviewed 2026-11-05.