SyncAI.news, a Varaisys broadcasting
1 Billion Classifications
HF

Hugging Face Blog

· 1 min read

AI LabsHugging Face Blog

1 Billion Classifications

You’ve optimized your model. Your pipeline is running smoothly. But now, your cloud bill has skyrocketed. Running 1B+ classifications or embeddings per day isn’t just a technical challenge—it’s a financial one. How do you process at this scale without blowing your budget? Whether you're running large-scale document classification or bulk embedding pipelines for Retrieval-Augmented Generation (RAG), you need cost-efficient, high-throughput inference to make it feasible, and you get that from having a well optimized configuration.

These tasks often use encoder models, which are much smaller than modern LLMs, but at the 1B+ inference request scale it's still quite a non-trivial task. Just to be clear, that's English Wikipedia 144x over. I haven’t seen much information on how to approach this with cost in mind and I want to tackle that. This blog breaks down HOW to calculate cost and latency for large scale classification and embedding. We’ll analyze different model architectures, benchmark costs across hardware choices, and give you a clear framework for optimizing your own setup. Additionally we should be able to build some intuition if you don't feel like going through the process yourself.

You might have a couple questions:

  • What is the cheapest configuration to solve my task for 1B inputs? (Batch Inference)
  • How can I do that while also considering latency? (Heavy Usage)

Here is the code to make it happen: https://github.com/datavistics/encoder-analysis

tl;I'm not gonna reproduce this, tell me what you found;dr

With this pricing I was able to get this cost:

Use Case Classification Embedding Vision-Embedding
Model lxyuan/distilbert-base-multilingual-cased-sentiments-student Alibaba-NLP/gte-modernbert-base vidore/colqwen2-v1.0-merged
Data tyqiangz/multilingual-sentiments sentence-transformers/trivia-qa-triplet openbmb/RLAIF-V-Dataset
Hardware Type nvidia-L4 ($0.8/hr) nvidia-L4 ($0.8/hr) nvidia-L4 ($0.8/hr)
Cost of 1B Inputs $253.82 $409.44 $44,496.51

Original source

This story was published by Hugging Face Blog. SyncAI.news shows a preview; the complete article is on the publisher's site.

Read the full story on huggingface.co

Similar News