Prompt
I'm building an internal app that needs a model API - what hosting setup makes sense?
Latest observation
A good hosting setup depends mostly on latency, privacy/compliance, cost, and how much traffic you expect. For an internal app, these are the common options:
1) Use a managed model API
Best for: fastest time-to-build, low ops burden, variable traffic.
Examples:
- OpenAI API
- Azure OpenAI
- Anthropic API
- Google Gemini API
Pros
- No infrastructure to manage
- Scales automatically
- Usually best reliability
- Easy to start
Cons
- Data leaves your environment
- Ongoing per-token cost
- Less control over model versioning and networking
Good choice if
- You’re prototyping
- Your data isn’t highly sensitive
- You want to ship quickly
2) Host a model in your own cloud account
Best for: more control, private networking, compliance needs, predictable workloads.
Typical setup:
- Run the model on GPU instances in AWS/GCP/Azure
- Put it behind an internal API gateway / load balancer
- Use containers or Kubernetes
- Add autoscaling if needed
Pros
- More control over data and network path
- Can keep traffic within your VPC/VNet
- Easier to meet some compliance requirements
- Can tune for your exact use case
Cons
- You manage deployment, scaling, observability
- GPU costs can be high
- More engineering effort
Good choice if
- You need internal/private deployment
- You have steady usage
- You want tighter integration with your infra
3) Self-host open-source models on your own infra
Best for: maximum control, cost optimization at scale, air-gapped or strict environments.
Typical stack:
- vLLM, TGI, or llama.cpp for serving
- Open-source model like Llama, Mistral, Qwen, etc.
- GPU servers or sometimes CPU for smaller models
Pros
- Maximum control
- Can avoid sending data to third parties
- Potentially cheaper at scale
- Can run in restricted environments
Cons
- Highest operational burden
- Need to handle model quality, upgrades, patching, safety, performance
- May require more GPU capacity than expected
Good choice if
- Security/privacy is the top priority
- You have ML/platform expertise
- You expect enough volume to justify ops work
What usually makes sense for an internal app?
Most teams start with:
Managed API + a thin internal backend
- Your app calls your own backend
- Backend calls the model provider
- Add logging, auth, rate limiting, prompt templates, and guardrails
This gives you:
- Simple architecture
- Provider abstraction
- Easier future migration if needed
Recommended decision rule
Choose managed API if:
- Speed matters most
- Data sensitivity is moderate
- You don’t want to operate GPU infra
Choose cloud-hosted model if:
- You need private networking or stronger compliance
- Usage is steady enough to justify infra
- You want more control without full self-hosting complexity
Choose self-hosted if:
- You need strict data locality / air-gapped deployment
- You have strong infra/MLOps support
- You want to optimize cost at high usage volume
A practical architecture I’d recommend
For most internal apps:
- Frontend
- Your backend service
- Auth
- Prompt assembly
- Policy checks
- Logging/metrics
- Model provider
- Managed API or your self-hosted endpoint
- Storage
- Conversation history / documents / audit logs
Add:
- Secrets management
- Request/response redaction
- Timeout/retry handling
- Rate limiting
- Evaluation set + monitoring
If you tell me these 4 things, I can recommend a specific setup
-
How sensitive is the data?
(public / internal / confidential / regulated) -
Expected usage?
(few users, daily use, heavy production traffic) -
Do you need low latency or can it be a few seconds?
-
What cloud/environment are you already on?
(AWS, Azure, GCP, on-prem)
If you want, I can give you a concrete hosting recommendation for your situation, including a suggested stack and rough cost range.