惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
腾讯CDC
博客园 - 司徒正美
A
About on SuperTechFans
H
Help Net Security
J
Java Code Geeks
C
Check Point Blog
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
MyScale Blog
MyScale Blog
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Fortinet All Blogs
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
博客园 - 【当耐特】
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Architecture Teardown: How Replicate and Modal Host AI Mo...
ANKUSH CHOUD · 2026-05-06 · via DEV Community

ANKUSH CHOUDHARY JOHAL

Architecture Teardown: How Replicate and Modal Host AI Models Using Kubernetes 1.34

Replicate and Modal have emerged as two of the most popular platforms for hosting and serving AI models, each catering to slightly different developer workflows. While Replicate focuses on simplified model deployment via its Cog containerization tool, Modal offers a code-first serverless platform for AI workloads. Both platforms rely heavily on Kubernetes 1.34 as their underlying orchestration layer, leveraging its cutting-edge features for GPU management, pod scheduling, and scalable inference. This teardown breaks down how each platform architects its hosting stack on K8s 1.34, highlighting shared patterns and key differentiators.

Replicate's K8s 1.34 Architecture

Replicate’s core workflow revolves around Cog, a tool that packages AI models into standardized Docker containers with pinned dependencies and model weights. When a user deploys a model, Replicate’s control plane creates a Kubernetes Deployment for each model version, with pods running the Cog container. K8s 1.34’s Dynamic Resource Allocation (DRA) for GPUs is a critical component here: unlike legacy device plugin approaches, DRA allows Replicate to request fractional GPU resources, pack multiple small inference workloads onto a single GPU, and dynamically adjust allocations based on real-time demand.

Replicate also leverages K8s 1.34’s improved scheduler latency, which reduces pod startup time for inference requests by up to 30% compared to older K8s versions. For model weight storage, Replicate uses a combination of container image caching (via node-local image registries) and persistent volumes for large model weights, with K8s 1.34’s CSI driver improvements reducing mount latency. To handle traffic spikes, Replicate uses the K8s Horizontal Pod Autoscaler (HPA) v2 with custom metrics for request queue depth, paired with K8s 1.34’s priority preemption to bump low-priority batch training jobs in favor of high-priority inference pods.

Modal's K8s 1.34 Architecture

Modal takes a code-first approach: developers decorate Python functions with @stub.function(gpu="A100") to request GPU resources, and Modal handles provisioning. Under the hood, each Modal function maps to a K8s Deployment, with pods running sandboxed containers (using gVisor, paired with K8s 1.34’s enhanced seccomp and SELinux profiles for isolation). Modal’s custom scheduler integrates with K8s 1.34’s scheduler framework to optimize for GPU topology: it uses K8s 1.34’s Topology Manager to align GPUs with nearby CPU cores and memory, reducing NUMA-related latency for inference workloads.

Modal also leans on K8s 1.34’s cgroups v2 default support to enforce strict resource isolation between tenant workloads, preventing noisy neighbor issues in its multi-tenant environment. For scaling, Modal uses K8s 1.34’s Custom Metrics API to feed function invocation queue depth and GPU utilization into its autoscaler, with support for scale-to-zero when no requests are pending. Ephemeral containers, promoted to stable in K8s 1.34, allow Modal’s engineering team to debug live inference pods without disrupting running workloads.

Shared K8s 1.34 Features

Both platforms rely on a core set of K8s 1.34 features to deliver reliable, cost-effective AI hosting:

  • Dynamic Resource Allocation (DRA): Fine-grained GPU sharing, fractional GPU requests, and support for mixed GPU workloads (inference + training) on the same node.
  • cgroups v2: Better resource isolation, support for hierarchical memory limits, and improved I/O throttling for inference pods.
  • Scheduler Framework Improvements: Reduced scheduling latency, better scoring for GPU nodes, and support for custom scheduling plugins.
  • Custom Metrics API: Integration with autoscalers for scaling based on inference-specific metrics (latency, queue depth, GPU utilization).
  • Ephemeral Containers: Live debugging of running pods without terminating workloads, critical for troubleshooting production inference issues.

Key Architectural Differences

While both use K8s 1.34 as a foundation, their higher-level architectures reflect their target use cases:

  • Model-centric vs. Function-centric: Replicate treats each model version as a standalone K8s Deployment, while Modal maps individual Python functions to deployments. This makes Replicate better for pre-trained model hosting, and Modal better for custom inference logic with pre/post-processing.
  • Containerization: Replicate requires Cog for containerization, which enforces standardized model packaging. Modal uses its own container builder that integrates with its Python SDK, allowing more flexibility for custom dependencies.
  • Scaling Logic: Replicate scales based on HTTP request volume to model endpoints, while Modal scales based on function invocation queue depth and GPU utilization for arbitrary Python workloads.

Challenges and Tradeoffs

Adopting K8s 1.34 comes with its own set of challenges for both platforms. Upgrading from older K8s versions requires validating compatibility with NVIDIA GPU drivers (525+ is required for K8s 1.34 DRA support) and container runtimes like containerd. Cold start latency remains a concern: both platforms use pod pre-warming and K8s 1.34’s faster image pulling to reduce startup times, but large model weights can still add seconds to cold starts. Cost management relies on K8s 1.34’s resource quotas and limit ranges to prevent runaway pod spawning, paired with node auto-scaling to match demand.

Conclusion

Replicate and Modal demonstrate the power of Kubernetes 1.34 for AI model hosting, leveraging its advanced GPU management, scheduling, and scaling features to deliver reliable, low-latency inference. While their higher-level abstractions differ, their shared use of K8s 1.34’s core features highlights the orchestration platform’s growing role as the backbone of modern AI infrastructure. As K8s continues to evolve, expect both platforms to adopt newer features like GPU partitioning and serverless integration to further optimize AI workload hosting.