# Hosted API or Open Weights for Enterprise?

> Hosted API or your own servers for open weights? The data, cost and upkeep trade-offs for an enterprise, explained simply for your AI interview.

**In short:** For most enterprises a hosted API is the quicker start. Self-hosting open weights gives control over data, versions and cost at steady high volume, but your own team then runs the servers, the updates and the safety checks.

AI and LLM interview question Q336, Inference, performance and cost. Intermediate, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/hosted-api-vs-self-hosted-open-weights

## Say it in 30 seconds

A hosted API is a model a vendor runs for us. We pay per use, and they handle the servers and updates, so it is the fastest start. Open weights mean we run the model ourselves, on servers we control, such as GPU servers we run in our own private cloud network. That gives control over data and versions, but my team then owns the GPUs, the patches and the tests. I choose by the data rules first, then traffic, then who can run it.

## Say it in 2 minutes

A hosted API means I call a model that a vendor runs on its own servers. I pay for what I use, and the vendor handles the chips, scaling and updates. It is the fastest way to start, and for many teams it is the right answer.

Open weights are different. The trained numbers are published, so we can run the model on servers we control, in our own building or on GPU servers inside our private cloud network. That gives control over where the data goes, which version runs and when it changes. The price is upkeep: GPUs, serving software, security patches and tests after every change.

The choice depends on three things: the data rules, the traffic and the team. If patient notes can't leave our network, a plain outside API is out. If traffic is small, a per-use bill is often lower than two servers that sit idle at night, because a rented server costs the same whether it is busy or not.

So I start with the rules, size the traffic at peak, then check who will run the servers. I would not call self-hosting cheaper or safer by default. It depends on the setup, and I say so in the interview. In the interview I would name the upkeep as the first cost, before any per-token price.

## What is the choice between a hosted API and open weights, in plain words?

A hosted API (a door your app uses to send requests) is a model that a vendor runs on its own servers. Your app sends a request over the internet and gets an answer back, and you pay for what you use. The vendor looks after the chips, the scaling and the updates.

Open weights means the trained numbers inside a model are published. A company can download them and run the model itself, in its own building or in a cloud account it controls. Then it owns the servers, the updates and the tests.

Think of a hospital deciding whether to send its blood samples to an outside lab or run its own. The outside lab is quick to start and follows its own rules. The hospital's own lab takes staff and equipment, but the hospital sets the schedule and keeps the samples in the building. The hospital group in our worked example faces that same choice for its AI: whose servers see the data?

- **Hosted API:** A model a vendor runs. You call it over the internet and pay per use.
- **Open weights:** A model whose trained numbers are published, so you can download it and run it under its licence.
- **Self-hosting:** Running the model on servers you control, and taking on the upkeep.
- **GPU:** A chip built to run model maths fast. Large models often need several.
- **Token:** A small piece of text, about a word or part of one, that the model reads and bills by.

## Who sees the data, and who sets the model's version?

Start with the data path. With a hosted API, your text goes to the vendor's servers. Since March 2023, OpenAI says data sent to its API is not used to train its models, unless you opt in. Its documentation also lists abuse monitoring logs, which keep records of use so OpenAI can enforce its usage rules. By default those logs can hold prompts and responses, and they are kept for up to 30 days.

Read the contract. How long logs are kept, which regions run the service and who can read the records are set there, and they can differ by vendor and by plan.

A cloud account is a middle option. AWS says the model makers get no access to Bedrock's logs or to customer prompts and completions. You still send your data to AWS's service, so the boundary moves into your cloud contract rather than disappearing.

> "As of March 1, 2023, data sent to the OpenAI API is not used to train or improve OpenAI models (unless you explicitly opt in to share data with us)." (OpenAI, on its API data)
>
> "they don't have access to Amazon Bedrock logs or to customer prompts and completions" (AWS, on Bedrock data protection)

Model version is the other control. A vendor can retire a model on its own calendar. A model in a cloud account follows the cloud platform's own retirement schedule, and that can differ from the vendor's.

*Diagram, Three ways to serve a model: Three ways to serve a model, sorted by who holds the servers. Strict data rules are checked first, so they narrow the list before cost is even counted. Only the options that pass move to the pick.*
1. The data rules are checked against the vendor's API first.
2. The same check applies to a model run inside your cloud account.
3. Then the check asks whether your own servers can meet the rules.
4. A vendor API passes only if its data terms meet the rules.
5. A cloud account passes if its region and contract do.
6. Your own servers pass only if your team can run them well.

> **Tip:** Answer the rules first: whose servers see the data, and who signs off a model change. Cost comes after that.

## What does running open weights yourself really cost?

Downloading open weights is the easy part, but running them costs money. A rented GPU server is charged for every hour it runs, busy or idle. Serving software loads the model and answers requests. vLLM, a serving library, describes itself as a "fast and easy-to-use library for LLM inference and serving", and it offers an "OpenAI-compatible API server", so app code can often keep the same request shape.

*Diagram, What you take on when you self-host: Downloading the model is the easy step. Your team then owns the serving software, the GPU servers, the quality tests and the security patches. The service works only while all four keep running.*
1. The model files arrive, and your team takes them on.
2. The service works only while all four parts keep running.

Hosted services usually charge for each request, so the bill grows with traffic. Self-hosting pays for capacity, so the bill stays flat while the servers can keep up. The cost per answer falls as traffic grows, but only while the servers stay busy.

A regional hospital group (made-up) wants a tool that summarises discharge notes (the summary a doctor writes when a patient goes home) for nurses. It handles about 1,800 notes a day, roughly 5 million tokens of text. These are made-up numbers, and the steps show how the decision runs.

1. **Check the rule first:** Patient notes may not leave the group's own network. A plain outside API fails that rule, so it is out for this data.
2. **Size the traffic at peak:** Load peaks on weekday mornings, when nurses clear the overnight admissions. The servers must handle that peak, not the daily average.
3. **Price both paths honestly:** Two GPU servers inside the group's own network cost the same whether 5 million or 15 million tokens pass through them. Even if the rule allowed an API, the answer would still depend on how busy the servers are and who runs them.
4. **Name the upkeep:** A small team covers night-time callouts when a server fails, installs the security patches, and runs the quality tests after each model change. If that team does not exist, the option that looks cheap is not cheap.
5. **Plan every model change:** Before a switch, the team re-runs the notes test set and checks nurse ratings. The old version stays live until the new one passes.

## How do licences and model changes shape the choice?

A licence sets what you may do with the weights. OpenAI's release page says gpt-oss is "Available under the flexible Apache 2.0 license". Meta's Llama 4 licence has a size limit: a business whose products or services had more than 700 million monthly active users in the calendar month before the Llama 4 release must ask Meta first.

> "is greater than 700 million monthly active users in the preceding calendar month, you must request a license from Meta" (Meta, Llama 4 licence (the 700 million users rule))
>
> "Partner-operated platforms, Claude Models on Google Cloud (Google managed) and Amazon Bedrock, set their own retirement schedules" (Anthropic, on partner platforms)

Change control is the other half. Hosted models retire on the vendor's calendar, and Anthropic says requests to retired models fail. With self-hosting you pick the upgrade date, but you also own the old model's security fixes and the tests for the new one.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] The two axes: who holds the servers, and who holds the data.
- [ ] Data rules first, then traffic, then the team that will run it.
- [ ] The middle option: a managed model service in your own cloud account, such as Bedrock.
- [ ] The cost shape: per use on an API, capacity when you self-host.
- [ ] Licence limits and retirement dates, read before launch.
- [ ] The upkeep you take on: serving, patches and tests after each change.

**Common traps**

- Trap: "Self-hosting is always cheaper and safer." Better: It depends on traffic, the rules and the team. Idle servers still cost money, and you carry the security fixes.
- Trap: "A no-training promise means the data never leaves." Better: Training is one question. Where the data goes and how long logs are kept are others, and they sit in the contract.
- Trap: "Open weights means free to use." Better: The download can be free, but the licence sets limits, and the servers and staff cost money.

## Can you spot the hidden cost?

**Spot the hidden cost:** A pilot runs on two GPU servers rented by the hour from a cloud provider, and traffic is light most nights. Which cost keeps running?

A. Tokens billed for each request
B. Servers billed by the hour, busy or idle
C. A monthly seat fee for each user
D. A price rise on the next model version

**Answer:** B. Rented servers bill by the hour whether they are busy or idle. Per-token and per-seat fees belong to hosted services, so they are not the cost of your own servers.

**Quick check:** A hospital group's rules say patient notes must stay on its own network. Which option fits that rule first?

A. A hosted API with a strong no-training promise
B. Open weights on servers the hospital runs itself
C. The newest closed model, for its benchmark score
D. A closed model on a public chat app, shared with millions of users

**Answer:** B. A rule that notes stay on the hospital's own network points to servers it controls. A no-training promise is a contract term, and a benchmark score says nothing about where the text goes.

## Can you answer these from memory?

**Flash cards**

- **What is a hosted API?** A model a vendor runs. You send requests and pay per use.
- **What are open weights?** Published trained numbers, so you can download and run the model yourself.
- **What decides the choice first?** The data rules. Then traffic, then the team that will run the servers.
- **How does the bill differ?** Hosted APIs bill per use. Your own servers bill for capacity, busy or idle.
- **Why is retirement a risk?** Vendors retire models on a schedule. Anthropic says requests to retired models fail.
- **What does self-hosting add to your job?** Serving, GPUs, security patches, licence checks and tests after every change.

## Likely follow-up questions

- Q025 Open-weight vs closed API models: trade-offs? https://designervenkat.online/interview/ai/open-weight-vs-closed-api-models
- Q310 Hosted fine-tuning API vs self-hosted training? (full answer coming)
- Q332 Cold starts and autoscaling? (full answer coming)
- Q334 How do you cut cost on a cloud-hosted LLM workload? (full answer coming)
- Q339 Why do output tokens cost more? (full answer coming)

## Learn it in depth

- [Self-Hosted Models](https://designervenkat.online/learn/ai-engineering/self-hosted-models)
- [Closed vs Open Source Models](https://designervenkat.online/learn/ai-engineering/closed-vs-open-source-models)
- [Open-weight model families](https://designervenkat.online/learn/ai-engineering/open-weight-model-families)
