Serving 2 Million Models Without Melting: Scaling the Hugging Face Hub — Arek Borucki, Hugging Face
Jul 28, 2026 · 21:39
Arek Borucki, ML platform and database engineer at Hugging Face, explains how the Hugging Face Hub serves 14 million users and hosts 3 million public models and 1 million datasets while keeping search instant. The Hub uses MongoDB Atlas with Apache Lucene for full-text search, storing metadata separately from model artifacts in S3. Precomputed tokens and denormalized read collections optimize queries, while a seven-node MongoDB cluster distributes reads and reserves a hidden analytics node for heavy queries. Kubernetes autoscaling scales pods from 10 to 500 based on traffic, with CastAI adding nodes when capacity is exhausted, and they are migrating from HPA to KEDA for event-driven scaling on real application metrics. As the catalog grows, sharding will horizontally scale the database across multiple shards, each with its own replication.