Scalable Infrastructure for Hosting Custom LLMs Using Terraform and Argo CD
DOI:
https://doi.org/10.63345/ejset.v2.i4.106Keywords:
LLM hosting, Terraform, Argo CD, GitOps, Kubernetes, GPU autoscaling, vLLM, infrastructure as codeAbstract
Organizations operating their own large language models need infrastructure capable of reproducibly provisioning GPU capacity, deploying a new version safely, and scaling in a timely manner while being economical. In this paper, we describe the reference architecture where Terraform provisions the networks, Kubernetes clusters, GPU node pools, and identities while Argo CD reconciles the inference stack—vLLM servers with queue-based autoscaling—from Git. In the experiments conducted for four models ranging in size from 7 to 70 billion parameters, GitOps-based deployment of a new model version took 8.9 ± 2.4 minutes versus 47.5 ± 12.4 minutes for manual scripting (p < 0.001); meanwhile, the amount of misconfigured deployments decreased from 14.2% to 2.5% (p = 0.001). Drift was reconciled on average in 1.7 minutes. Throughput of the system scaled up to 23,100 tokens per second across 12 replicas with 90% scaling efficiency, while the combination of spot and on-demand GPU instances decreased the cost per million tokens from $4.80 to $1.92 (a 60% reduction). The architecture provides repeatable, auditable, and economical hosting of custom models.
References
1. Brikman, Y. (2019). Terraform: Up and running (2nd ed.). O'Reilly Media.
2. Burns, B., Grant, B., Oppenheimer, D., Brewer, E., & Wilkes, J. (2016). Borg, Omega, and Kubernetes. ACM Queue, 14(1), 70–93. DOI: https://doi.org/10.1145/2898442.2898444
3. Kreuzberger, D., Kühl, N., & Hirschl, S. (2023). Machine learning operations (MLOps): Overview, definition, and architecture. IEEE Access, 11, 31866–31879. DOI: https://doi.org/10.1109/ACCESS.2023.3262138
4. Kwon, W., Li, Z., Zhuang, S., et al. (2023). Efficient memory management for large language model serving with PagedAttention. Proceedings of the 29th ACM Symposium on Operating Systems Principles, 611–626. DOI: https://doi.org/10.1145/3600006.3613165
5. Limoncelli, T. A. (2018). GitOps: A path to more self-service IT. ACM Queue, 16(3), 13–26. DOI: https://doi.org/10.1145/3236386.3237207
6. Morris, K. (2016). Infrastructure as code: Managing servers in the cloud. O'Reilly Media.
7. Pope, R., Douglas, S., Chowdhery, A., et al. (2023). Efficiently scaling transformer inference. Proceedings of Machine Learning and Systems, 5.
8. Rahman, A., Mahdavi-Hezaveh, R., & Williams, L. (2019). A systematic mapping study of infrastructure as code research. Information and Software Technology, 108, 65–77. DOI: https://doi.org/10.1016/j.infsof.2018.12.004
9. Sculley, D., Holt, G., Golovin, D., et al. (2015). Hidden technical debt in machine learning systems. Advances in Neural Information Processing Systems, 28, 2503–2511.
10. Verma, A., Pedrosa, L., Korupolu, M., Oppenheimer, D., Tune, E., & Wilkes, J. (2015). Large-scale cluster management at Google with Borg. Proceedings of the European Conference on Computer Systems (EuroSys), 1–17. DOI: https://doi.org/10.1145/2741948.2741964
11. Yu, G.-I., Jeong, J. S. S., Kim, G.-W., Kim, S., and Chun, B.-G. (2022). Orca: A distributed serving system for transformer-based generative models. In Proceedings of the 16th USENIX Symposium on Operating Systems Design and Implementation, pages 521–538.





