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 API | Cloud-managed service | Data platform | Self-hosted | |
|---|---|---|---|---|
| Examples | OpenAI, Anthropic, Google AI Studio APIs | Azure OpenAI (AI Foundry), Amazon Bedrock, Vertex AI | Databricks Model Serving, Snowflake Cortex | vLLM, TGI or similar on your GPUs, on-prem or in your cloud account |
| Where data goes | Provider's service | Provider's service inside your cloud tenancy and region | Your data platform account | Never leaves your network |
| Network | Public internet (some offer private options) | Private endpoints / VPC integration | Platform's networking | Fully yours |
| Identity | API keys | Cloud identity (managed identity, IAM roles) | Platform identity and governance | Yours |
| Model choice | That provider's models | A catalogue of several providers' models | A catalogue plus your own | Open-weight models only |
| Who runs it | Provider | Cloud provider | Platform | You |
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
| Need | Azure | AWS | Google Cloud | Databricks | Snowflake |
|---|---|---|---|---|---|
| Hosted LLMs | Azure OpenAI and model catalogue (AI Foundry) | Amazon Bedrock | Vertex AI Model Garden (Gemini and partners) | Foundation Model APIs, external models | Cortex LLM functions |
| Custom / open model serving | AI Foundry managed compute, AKS | SageMaker endpoints, EKS | Vertex AI endpoints, GKE | Model Serving | Container services |
| Managed RAG / search | Azure AI Search | Bedrock Knowledge Bases, OpenSearch | Vertex AI Search, Vector Search | Vector Search | Cortex Search |
| Agents | AI Foundry Agent Service | Bedrock Agents / AgentCore | Vertex AI Agent Builder / Agent Engine | Agent Framework | Cortex Agents |
| Guardrails | Azure AI Content Safety | Bedrock Guardrails | Model Armor, safety settings | AI Gateway guardrails | Cortex Guard |
| Gateway / API management | API Management (AI gateway features) | API Gateway + Bedrock features, or third-party | Apigee | AI 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
| Model | How it works | Use when |
|---|---|---|
| Pay-as-you-go | Per token, shared capacity, rate limits per deployment | Starting out, variable or modest traffic |
| Provisioned / reserved throughput | Pay 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 |
| Batch | Submit jobs, results within hours, typically ~50% cheaper | Offline extraction, classification, evaluation runs |
| Self-hosted GPUs | Pay for GPU instances whether busy or idle | High 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.
"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.