dev-tools 6 min read

Koyeb - Serverless Deploy for APIs and AI Inference

Deploy APIs, AI inference, and databases on Koyeb's global serverless infrastructure. GPU instances, per-second billing, autoscaling to zero. CLI setup guide.

By
Share: X in
Koyeb serverless infrastructure thumbnail

TL;DR

TL;DR: Koyeb is a serverless platform for deploying APIs, AI inference endpoints, and databases on high-performance GPUs and CPUs across 50+ global locations with per-second billing and autoscaling to zero.

Source and Accuracy Notes

What Is Koyeb?

Koyeb is a serverless infrastructure platform designed for deploying intensive applications — APIs, AI inference endpoints, and databases — on high-performance compute (GPUs, CPUs, and accelerators) from AMD, Intel, and Nvidia.

Key differentiators from the HN launch thread:

  • Global MicroVM deployment — run workloads in 50+ locations worldwide with sub-100ms latency
  • Per-second billing — pay only for what you use, scale to zero when idle
  • GPU instances — RTX A6000 (48GB), L40S (48GB), A100 (80GB) available
  • Autoscaling — sub-200ms cold start, scale from zero to hundreds of instances

The platform recently joined Mistral AI to build “the future of AI infrastructure,” signaling a focus on AI inference workloads.

Prerequisites

Step 1: Install the Koyeb CLI

macOS (Homebrew):

brew install koyeb/tap/koyeb

Upgrade later:

brew upgrade koyeb

From source (Go):

go get github.com/koyeb/koyeb-cli/cmd/koyeb
go install github.com/koyeb/koyeb-cli/cmd/koyeb

Pre-compiled binaries: download from the GitHub Releases page for your platform.

Step 2: Authenticate

Generate a personal access token from your Koyeb dashboard, then run:

koyeb login

You will be prompted:

? Do you want to create a new configuration file in (/Users/you/.koyeb.yaml)? [y/N]
✗ Enter your personal access token: *************
INFO[0006] Creating new configuration in /Users/you/.koyeb.yaml

Verify authentication:

koyeb organization list

Step 3: Deploy Your First Service

Deploy from a Git repository:

koyeb apps create my-api
koyeb services create my-api/web \
  --git github.com/youruser/yourrepo \
  --git-branch main \
  --instance-type nano \
  --regions fra

Deploy a Docker image:

koyeb services create my-api/worker \
  --docker youruser/yourimage:latest \
  --instance-type micro \
  --regions was

Deploy with GPU (AI inference):

koyeb services create inference/llm \
  --docker youruser/llm-server:latest \
  --instance-type gpu-rtx-a6000 \
  --regions lax \
  --port 8000:http

Step 4: Enable Shell Completion

Bash:

# Linux
koyeb completion bash > /etc/bash_completion.d/koyeb

# macOS
koyeb completion bash > /usr/local/etc/bash_completion.d/koyeb

Zsh:

echo "autoload -U compinit; compinit" >> ~/.zshrc
koyeb completion zsh > "${fpath[1]}/_koyeb"

Fish:

koyeb completion fish > ~/.config/fish/completions/koyeb.fish

Step 5: Monitor and Manage

List deployments:

koyeb deployments list --app my-api

View logs:

koyeb logs my-api/web

Scale service:

koyeb services update my-api/web --instance-type nano --min-scale 2 --max-scale 10

Delete service:

koyeb services delete my-api/web

Deeper Analysis

Pricing Model

Koyeb uses per-second billing with no minimum commitment:

| Plan | Base Price | Included Compute | Users | Services | |------|-----------|------------------|-------|----------| | Pro | $29/mo + compute | $10 | 10 | 100 | | Scale | $299/mo + compute | $100 | 50 | 1,000 | | Enterprise | Custom | Custom | Unlimited | Unlimited |

GPU pricing (per second):

  • RTX A6000 (48GB): $0.000208/sec ($0.75/hr)
  • L40S (48GB): $0.000333/sec ($1.20/hr)
  • A100 (80GB): $0.000444/sec ($1.60/hr)

All plans include autoscaling and scale-to-zero. You only pay for running instances.

Architecture: MicroVMs vs Containers

Koyeb runs workloads on MicroVMs (lightweight virtual machines) rather than traditional containers. This provides:

  • Stronger isolation — each workload runs in its own kernel
  • Bare-metal performance — no container overhead
  • Sub-200ms cold starts — faster than traditional VMs

The HN comments compare Koyeb to Fly.io, noting both use global distribution but Koyeb emphasizes GPU availability and AI inference workloads.

Regional Deployment Strategy

Koyeb offers 50+ regions. You can:

  • Single region — lowest cost, simplest
  • Multi-region — high availability, lower latency
  • Global — deploy to all regions automatically

Example multi-region deploy:

koyeb services create my-api/web \
  --docker youruser/api:latest \
  --regions fra,was,nrt \
  --min-scale 1 --max-scale 5

Practical Evaluation Checklist

Before adopting Koyeb, verify:

  • [ ] Latency requirements — test your target regions with koyeb metrics
  • [ ] GPU availability — check if your preferred GPU is in your target region
  • [ ] Cold start tolerance — sub-200ms is fast, but test your specific workload
  • [ ] Egress costs — review data transfer pricing for high-traffic APIs
  • [ ] Persistent storage — Koyeb offers NVMe volumes; verify size limits for your use case
  • [ ] Build time limits — free tier includes 5 concurrent builds; check if sufficient

Security Notes

  • API tokens — store in ~/.koyeb.yaml with chmod 600; never commit to git
  • Secrets management — use koyeb secrets create for environment variables, not hardcoded values
  • Network isolation — services run in isolated MicroVMs; no shared kernel with other tenants
  • RBAC — Scale and Enterprise plans include role-based access control
  • Audit logs — Enterprise plan provides audit trail for compliance

FAQ

Q: How does Koyeb compare to Fly.io or Railway?

A: Koyeb focuses on high-performance compute (GPUs, accelerators) and AI inference workloads. Fly.io emphasizes edge deployment for web apps. Railway is more developer-friendly for full-stack apps. Koyeb’s MicroVM architecture provides stronger isolation than containers.

Q: Can I deploy a database on Koyeb?

A: Yes, Koyeb offers managed PostgreSQL with autoscaling. You can also deploy your own database in a container, but managed Postgres handles backups, replication, and scaling automatically.

Q: What happens when my service scales to zero?

A: When traffic drops to zero, Koyeb stops billing after a configurable idle period (default: 5 minutes). The next request triggers a cold start (sub-200ms). You can disable scale-to-zero for latency-critical services.

Q: Do I need to manage Kubernetes or infrastructure?

A: No. Koyeb is fully serverless. You deploy code or containers, and Koyeb handles scheduling, scaling, load balancing, and networking. No cluster management required.

Q: Can I use custom domains?

A: Yes. Add custom domains via koyeb domains create yourdomain.com and configure DNS. Koyeb provides automatic TLS certificates via Let’s Encrypt.

Conclusion

Koyeb fills a specific niche: high-performance serverless infrastructure for AI inference, APIs, and data-intensive workloads that need GPU access and global distribution. The per-second billing and autoscaling to zero make it cost-effective for spiky workloads.

Best for:

  • AI inference endpoints needing GPU access
  • APIs requiring low-latency global distribution
  • Teams that want serverless without Kubernetes complexity
  • Workloads with variable traffic patterns

Consider alternatives if:

  • You need edge functions (Cloudflare Workers, Deno Deploy)
  • You’re building a simple static site (Vercel, Netlify)
  • You want full Kubernetes control (EKS, GKE)

Start with the free tier, deploy a test service, and measure cold start times for your specific workload before committing.