The blog and the Knowledge Center each fetched their markdown from a
SEPARATE GitHub repository at request time (g-but/botsmann-blog-content,
g-but/botsmann-knowledge-content) and rendered it through next-mdx-remote
with a hand-rolled component map per surface. Two maps for one markdown
vocabulary, already drifted: the blog slugged headings with rehype-slug, the
guides with a different inline regex; the guides highlighted code, the blog
did not; each had its own Callout. The content itself lived where nobody
reviewed it, behind a GitHub handle rename that now answers only via a 301.
Both surfaces now read content/*.md from this repo and render through
bip-kit's typed-block parser and reference renderer:
- content/blog/*.md (5 posts) and content/knowledge/**/*.md (10 guides) are
vendered verbatim from the two content repos — word-level parity verified
across all 15 files, zero words lost. Post images moved to public/blog/.
- The three app/blog/<slug>/page.mdx files came along as drafts. They were
never routes: `page.mdx` only serves as a page when pageExtensions includes
mdx, and this app never configured that, so all three were dead files. They
are committed with `published: false` rather than deleted.
- lib/longform/ is the one pipeline both routes call: a fence-aware
normalizer (`# ` → `## `, `*`/`+` bullets → `-`, nested items flattened —
the guides carry 74 indented items and ~130 shell-comment `#` lines inside
fences that a naive normalizer would have corrupted), then parse → blocks +
TOC + reading time.
- setHighlighterLoader(() => import('shiki')) is registered at module scope.
This app builds `output: standalone`, where bip-kit's zero-config shiki
import is invisible to Next's file tracer — without the explicit literal,
production ships unhighlighted while dev looks right.
- The TOC is derived from the same parse that renders the page, so a TOC
anchor can no longer point at a heading id built by a different slug rule.
types/knowledge.ts loses TableOfContentsItem accordingly.
Retired: next-mdx-remote, remark-gfm, rehype-slug, rehype-autolink-headings,
gray-matter (deps), components/blog/{Server,Client}MDXContent + MDXComponents,
components/knowledge/{Callout,CodeBlock,TableOfContents}. next.config drops
the raw.githubusercontent image pattern and the GitHub hosts from CSP
connect-src, and points frame-src at the privacy video players bip-kit uses.
Article typography now flows from the token SSOT: lib/longform/longform.css
maps globals.css onto bip-kit's --bp-* contract, replacing ~40 hardcoded
Tailwind greys. The mapping covers every --bp-* colour and pins the article
light, because Botsmann has no dark theme anywhere (zero `dark:` utilities,
no theme provider, light-only chrome) — letting bip-kit's dark defaults
through would put a dark article inside a white page. When the site grows a
dark tier, this file follows it by changing values in globals.css only.
tests/__tests__/lib/longform-content.test.ts walks every content file through
the real pipeline: committed content is bip-kit's trust boundary and a
malformed chart/stats fence throws at parse time, which without a test would
surface as a 500 on the live page.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
11 KiB
title, description, difficulty, readTime, author, publishedAt, tags, prerequisites, category, published
| title | description | difficulty | readTime | author | publishedAt | tags | prerequisites | category | published | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Hosting Comparison: Self-Hosted vs Cloud vs Serverless | Compare hosting options for AI applications - from Vercel to self-hosted Docker, find the right infrastructure for your needs | Intermediate | 20 min | Botsmann Team | 2026-01-12 |
|
|
infrastructure | true |
Hosting Comparison for AI Applications
Choosing the right hosting infrastructure impacts your costs, performance, and development velocity. This guide compares all major options.
Quick Decision Guide
| If You Need... | Choose |
|---|---|
| Fastest time to deploy | Vercel or Railway |
| Maximum control | Self-hosted VPS |
| Enterprise scale | AWS/GCP/Azure |
| Lowest cost at scale | Self-hosted |
| GPU inference | RunPod, Lambda Labs, or self-hosted |
| Zero maintenance | Vercel + API providers |
Option 1: Serverless Platforms
Vercel
Best For: Next.js apps, rapid iteration, small-medium traffic
| Aspect | Details |
|---|---|
| Pricing | Free tier, Pro $20/mo, Enterprise custom |
| Deployment | Git push → live in seconds |
| Regions | Edge network (global) |
| Limitations | 10s function timeout (Pro: 60s) |
Pros:
- Zero configuration deployment
- Automatic HTTPS, CDN, previews
- Perfect Next.js integration
- Generous free tier
Cons:
- Function timeout limits
- No persistent connections (WebSocket needs workarounds)
- Can get expensive at scale
Monthly Cost Example (100K users): $100-500
# Deploy to Vercel
npm i -g vercel
vercel
Railway
Best For: Full-stack apps, databases included, simple pricing
| Aspect | Details |
|---|---|
| Pricing | $5/mo + usage (~$0.000463/vCPU-min) |
| Deployment | Git push or Docker |
| Databases | Built-in Postgres, Redis, MongoDB |
| Limitations | No GPU support |
Pros:
- Databases included in platform
- Simple, predictable pricing
- WebSocket support
- Docker-native
Cons:
- Smaller ecosystem than Vercel
- No edge functions
- Limited regions
Monthly Cost Example (100K users): $50-200
Cloudflare Workers
Best For: Edge computing, global low latency
| Aspect | Details |
|---|---|
| Pricing | Free 100K req/day, then $5/10M requests |
| Deployment | Wrangler CLI |
| Runtime | V8 isolates (not Node.js) |
| Limitations | 30s CPU time, 128MB memory |
Pros:
- Extremely low latency (edge)
- Very cheap at scale
- Built-in KV storage
Cons:
- Not full Node.js (Workers runtime)
- Memory limitations
- Learning curve
Option 2: Cloud Providers
AWS (Amazon Web Services)
Best For: Enterprise, complex architectures, maximum flexibility
| Service | Use Case | Starting Price |
|---|---|---|
| Lambda | Serverless functions | $0.20/1M requests |
| ECS/Fargate | Container hosting | $0.04/vCPU-hr |
| EC2 | Virtual machines | $0.01/hr (t3.micro) |
| Bedrock | Managed AI models | Pay per token |
Pros:
- Every service imaginable
- Enterprise compliance (HIPAA, SOC2)
- Massive scale capability
- GPU instances available
Cons:
- Complex pricing
- Steep learning curve
- Easy to over-engineer
Monthly Cost Example (100K users): $200-2000
Google Cloud Platform (GCP)
Best For: AI/ML workloads, BigQuery users, Kubernetes
| Service | Use Case | Starting Price |
|---|---|---|
| Cloud Run | Serverless containers | $0.00002400/vCPU-sec |
| GKE | Managed Kubernetes | $0.10/hr (cluster) + nodes |
| Compute Engine | VMs | $0.01/hr |
| Vertex AI | Managed ML | Pay per prediction |
Pros:
- Best Kubernetes support
- Strong AI/ML tooling
- Good free tier
- Competitive pricing
Cons:
- Console can be confusing
- Support not as responsive
- Fewer regions than AWS
Microsoft Azure
Best For: Microsoft shops, OpenAI integration, enterprise
| Service | Use Case | Starting Price |
|---|---|---|
| Functions | Serverless | 1M free/mo |
| Container Apps | Serverless containers | $0.000024/vCPU-sec |
| AKS | Managed Kubernetes | Free control plane |
| OpenAI Service | GPT-4, etc. | Same as OpenAI API |
Pros:
- Native OpenAI integration
- Enterprise identity (Azure AD)
- Hybrid cloud options
- Good enterprise support
Cons:
- Can be expensive
- Complex billing
- Slower innovation than AWS
Option 3: Self-Hosted
VPS Providers
| Provider | Cheapest | Best Value | Notes |
|---|---|---|---|
| Hetzner | $4/mo | $20/mo (8GB) | European, great price |
| DigitalOcean | $4/mo | $24/mo (8GB) | Good docs, simple |
| Linode | $5/mo | $24/mo (8GB) | Akamai-backed |
| Vultr | $5/mo | $24/mo (8GB) | Many regions |
| OVH | €4/mo | €14/mo (8GB) | European, cheap |
Self-Hosted Architecture
┌─────────────────────────────────────────────────┐
│ Cloudflare │
│ (CDN + DDoS Protection) │
└─────────────────────┬───────────────────────────┘
│
┌─────────────────────▼───────────────────────────┐
│ Nginx/Caddy │
│ (Reverse Proxy + SSL) │
└─────────────────────┬───────────────────────────┘
│
┌─────────────────────▼───────────────────────────┐
│ Docker Compose │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ App │ │ Redis │ │ Postgres │ │
│ │ (Next.js)│ │ (Cache) │ │ (DB) │ │
│ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────┘
Pros:
- Full control
- Predictable costs
- No vendor lock-in
- Can run open source models
Cons:
- You handle security, updates
- Requires DevOps knowledge
- No auto-scaling without setup
Monthly Cost Example (100K users): $20-100
Docker Compose Example
version: '3.8'
services:
app:
build: .
ports:
- '3000:3000'
environment:
- DATABASE_URL=postgres://postgres:password@db:5432/app
- REDIS_URL=redis://redis:6379
depends_on:
- db
- redis
db:
image: postgres:16
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=password
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
volumes:
postgres_data:
redis_data:
Option 4: GPU Hosting (for AI Models)
Cloud GPU Providers
| Provider | GPU | Price/hr | Best For |
|---|---|---|---|
| RunPod | A100 80GB | $1.99 | Development |
| Lambda Labs | H100 | $2.99 | Production |
| Vast.ai | Various | $0.30+ | Budget |
| Together.ai | Serverless | Per token | API access |
| Replicate | Serverless | Per second | Easy deployment |
Self-Hosted GPU
| Option | Cost | Notes |
|---|---|---|
| RTX 4090 | $1,600 one-time | Best consumer GPU |
| RTX 3090 | $800 used | Great value |
| A100 (used) | $10,000+ | Data center grade |
Llama 3.1 8B Requirements:
- Minimum: 16GB VRAM or 32GB RAM (CPU inference)
- Recommended: RTX 4090 or better
Cost Comparison Summary
Low Traffic (1K users/month)
| Option | Monthly Cost |
|---|---|
| Vercel Free | $0 |
| Railway | $5 |
| Self-hosted VPS | $5-10 |
Medium Traffic (100K users/month)
| Option | Monthly Cost |
|---|---|
| Vercel Pro | $100-300 |
| Railway | $50-150 |
| AWS | $200-500 |
| Self-hosted | $40-100 |
High Traffic (1M+ users/month)
| Option | Monthly Cost |
|---|---|
| Vercel Enterprise | $1000+ |
| AWS/GCP | $1000-5000 |
| Self-hosted cluster | $500-2000 |
Recommendation by Stage
| Stage | Recommendation |
|---|---|
| Prototype | Vercel free tier |
| MVP | Vercel Pro or Railway |
| Growing | Railway or AWS |
| Scale | Self-hosted or multi-cloud |
| Enterprise | AWS/GCP/Azure |
Migration Considerations
When moving between platforms:
- Containerize Early: Use Docker from day one
- Abstract Providers: Don't hard-code cloud services
- Database Portability: Use standard Postgres
- Environment Variables: All config via env vars
This makes migrating from Vercel → AWS → Self-hosted straightforward.