[Paper Review] Scalable and Secure AI Inference in Healthcare: A Comparative Benchmarking of FastAPI and Triton Inference Server on Kubernetes
This paper benchmarks FastAPI vs. Triton Inference Server on Kubernetes for healthcare AI, demonstrating a hybrid architecture that combines secure gateway processing with high-throughput backend inference.
Efficient and scalable deployment of machine learning (ML) models is a prerequisite for modern production environments, particularly within regulated domains such as healthcare and pharmaceuticals. In these settings, systems must balance competing requirements, including minimizing inference latency for real-time clinical decision support, maximizing throughput for batch processing of medical records, and ensuring strict adherence to data privacy standards such as HIPAA. This paper presents a rigorous benchmarking analysis comparing two prominent deployment paradigms: a lightweight, Python-based REST service using FastAPI, and a specialized, high-performance serving engine, NVIDIA Triton Inference Server. Leveraging a reference architecture for healthcare AI, we deployed a DistilBERT sentiment analysis model on Kubernetes to measure median (p50) and tail (p95) latency, as well as throughput, under controlled experimental conditions. Our results indicate a distinct trade-off. While FastAPI provides lower overhead for single-request workloads with a p50 latency of 22 ms, Triton achieves superior scalability through dynamic batching, delivering a throughput of 780 requests per second on a single NVIDIA T4 GPU, nearly double that of the baseline. Furthermore, we evaluate a hybrid architectural approach that utilizes FastAPI as a secure gateway for protected health information de-identification and Triton for backend inference. This study validates the hybrid model as a best practice for enterprise clinical AI and offers a blueprint for secure, high-availability deployments.
Motivation & Objective
- Motivate scalable and compliant AI inference in healthcare and pharmaceuticals.
- Evaluate performance trade-offs between a FastAPI gateway and Triton Inference Server in a Kubernetes setup.
- Assess a hybrid architecture that uses FastAPI for security/de-identification and Triton for GPU-backed inference.
Proposed method
- Deploy a DistilBERT sentiment model in a Kubernetes reference architecture.
- Compare CPU-based FastAPI inference with GPU-based Triton inference under varying loads.
- Enable dynamic batching in Triton and measure p50, p95 latencies and throughput.
- Use a predefined model registry and health checks for zero-downtime updates.
- Evaluate security via a FastAPI gateway enforcing OAuth2/JWT and PHI de-identification in preprocessing.
Experimental results
Research questions
- RQ1What are the latency and throughput trade-offs between FastAPI and Triton for healthcare NLP inference on Kubernetes?
- RQ2Does a hybrid architecture improve security and performance for regulated healthcare AI deployments?
- RQ3How does dynamic batching in Triton affect p50, p95 latency, and throughput under concurrent load?
- RQ4What architectural guidelines maximize availability and privacy in clinical AI deployments?
Key findings
- FastAPI achieves lower p50 latency for single-item requests (22 ms) compared to Triton (28 ms) due to lower system overhead.
- Triton with dynamic batching (batch size 16) yields the highest throughput (780 req/s), outperforming both the non-batched Triton (420 req/s) and FastAPI baseline (450 req/s).
- Tail latency is lower for FastAPI (45 ms) than for Triton (60 ms) under the tested conditions.
- Dynamic batching in Triton provides substantial throughput gains with only modest p50 latency increase (34 ms).
- A hybrid architecture with FastAPI as secure gateway and Triton for compute offers a practical best-practice for enterprise healthcare AI deployments.
- PHI de-identification in preprocessing reduces data exposure risks before reaching inference servers.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.