Scaling LLM Inference to Serve 400M+ Monthly Search Queries
perplexity · Tech · 2024 · source Agentic: no · promotional bias: high · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: AI search inference serving
Perplexity needed to serve hundreds of millions of monthly search queries with multiple LLMs while balancing latency-sensitive user experience against inference cost.
Constraints:
- Each search query triggers multiple AI inference requests.
- More than 20 AI models must run simultaneously under strict cost and interactivity SLAs.
- Different model sizes and use cases require different batching, scheduling, and parallelism choices.
Architecture
Perplexity deployed models on NVIDIA H100 GPU pods managed by Triton Inference Server and TensorRT-LLM inside Kubernetes. Smaller classifier models detect user intent, route tasks to specific model pods, and an in-house front-end scheduler routes traffic based on load and usage while Triton batches requests and reports GPU utilization. For latency-sensitive models, the team uses tensor parallelism across four or eight GPUs; for other settings, data or pipeline parallelism can maximize throughput.
Diagram confidence: explicit (topology described by the source).
flowchart LR A["Search query workflow"] --> B["Intent classifier models"] B --> C["Front-end scheduler"] C --> D["Kubernetes cluster"] D --> E["H100 GPU pods"] C --> F["Triton Inference Server"] F --> E E --> G["TensorRT-LLM"] G --> H["Llama model deployments"]
Components
| Component | Role | Interacts with |
|---|---|---|
Search query workflow |
User-facing Perplexity search flow that triggers multiple inference requests. | Intent classifier models |
Intent classifier models |
Smaller models that detect task type and select routing destinations. | Search query workflow, Front-end scheduler |
Front-end scheduler |
In-house scheduler that routes traffic to pods based on load, usage, and SLAs. | Intent classifier models, Kubernetes cluster, Triton Inference Server |
Kubernetes cluster |
Hosts GPU pods and scales deployments for fluctuating traffic. | Front-end scheduler, H100 GPU pods |
H100 GPU pods |
One-or-more H100 GPU deployments serving model workloads. | Kubernetes cluster, Triton Inference Server, TensorRT-LLM |
Triton Inference Server |
Inference middleware that batches requests, serves backends, and exports GPU metrics. | Front-end scheduler, H100 GPU pods, TensorRT-LLM |
TensorRT-LLM |
Optimized LLM runtime used for Llama-based serving. | H100 GPU pods, Triton Inference Server, Llama model deployments |
Llama model deployments |
8B, 70B, 405B and other user-facing language models. | TensorRT-LLM |
Data flow
A search query produces multiple inference requests. Smaller classifier models determine user intent, route tasks such as completion to H100 GPU pods, Triton/TensorRT-LLM serve optimized Llama-family and other models, the Kubernetes front-end scheduler balances load against SLA targets, and inference metrics feed scheduling and scaling decisions.
3 supporting quotes
Why this architecture
The architecture lets Perplexity route heterogeneous requests to model deployments that meet each use case's cost and latency targets, while using GPU metrics, batching, and parallelism to keep utilization high.
3 supporting quotes
Models used: classifier models · Llama 3.1 8B · Llama 3.1 70B · Llama 3.1 405B · embedding models under 1B parameters · more than 20 AI models
Scale
- Perplexity handles more than 435 million queries each month.“an AI-powered search engine that handles more than 435 million queries each month.”article, stated
- The inference team serves over 20 AI models simultaneously.“the inference team at Perplexity serves over 20 AI models simultaneously.”article, stated
- A benchmarked load-balancing chart used a moderate request rate of 16 QPS.“during an internal Perplexity benchmark at a moderate request rate of 16 QPS”article, stated
- Tensor parallelism across four H100 GPUs reduced relative cost per million tokens by up to 3x for latency-sensitive requests.“Sharding the Llama 8B model using tensor parallelism across four NVIDIA Hopper GPUs reduces Perplexity’s relative cost per million token by up to 3x”article, stated
- Perplexity estimated approximately $1 million in annual savings for the Related-Questions feature.“the team estimated that they were able to save approximately $1 million annually by serving models that power their Related-Questions feature”article, stated
Alternatives considered (roads not taken)
Use third-party LLM provider APIs
Rejected because: Perplexity hosts models when doing so meets strict SLAs at lower cost.
Use low tensor parallelism for latency-sensitive large models
Rejected because: The team found four- and eight-GPU tensor parallelism lowered serving cost within a fixed GPU budget for strict SLAs.
One scheduling policy for all traffic
Rejected because: Scheduling algorithms affect worst-percentile inter-token latency, so Perplexity continuously optimizes request routing.
Patterns
model-routing (model-operations)
Classifier models route each user task to the appropriate model pod.
latency-optimization (production-operations)
Perplexity tunes scheduling, batching, parallelism, and model placement to meet interactivity SLAs.
cost-aware-routing (production-operations)
Hosting and parallelism choices are made by comparing SLA compliance and cost against third-party APIs.
eval-driven-development (evaluation)
A/B tests determine SLA configurations and user-experience tradeoffs for model serving.
Tradeoffs
Serving strategy
Chose host optimized models on H100/Triton/TensorRT-LLM over defaulting to third-party LLM APIs.
Rationale: Self-hosted/cloud-hosted optimized deployments can lower cost while meeting strict SLAs.
Parallelism choice
Chose higher tensor parallelism for latency-sensitive requests over throughput-oriented data or pipeline parallelism for all cases.
Rationale: For strict interactivity SLAs, higher tensor parallelism reduced serving cost within fixed GPU budget.
Future serving architecture
Chose disaggregated serving exploration over coupling prefill and decode on the same GPU type.
Rationale: Separating prefill and decode can improve throughput and let each phase use different hardware.
Gotchas (what bit them)
Inference requests vary by latency sensitivity.
Root cause: Some models are hidden inside workflows while user-facing models directly affect experience.
Resolution: Use low batch sizes for small real-time retrieval models and deeper performance analysis for user-facing Llama models.
Load-balancing policy can dominate tail latency.
Root cause: Different scheduling algorithms affect worst-percentile inter-token latency.
Resolution: Continuously optimize scheduler behavior and account for sequence-length variation.
Throughput-maximizing parallelism may not minimize cost for latency-sensitive requests.
Root cause: Strict SLAs change the economics of tensor, data, and pipeline parallelism.
Resolution: Use tensor parallelism of four or eight GPUs for latency-sensitive models while using data/pipeline parallelism where throughput matters more.
Evaluation
Perplexity evaluates serving configurations with A/B testing, SLA compliance, GPU utilization, inter-token latency, time to first token, tokens per second per user, cost per million queries/tokens, and cost versus third-party APIs.
Metrics: inter-token latency · time to first token · tokens per second per user · cost per million queries · cost per million tokens · GPU utilization · SLA compliance
Outcomes
- Perplexity serves more than 435 million queries each month.
- The platform serves over 20 AI models simultaneously.
- Tensor parallelism reduced relative cost per million tokens by up to 3x for a latency-sensitive Llama 8B case.
- Perplexity estimated approximately $1 million annual savings for Related Questions by serving models itself.
This source is vendor-authored by NVIDIA, so it is strong on stack details and savings claims but naturally emphasizes NVIDIA components.