Best Practices for Using Large Language Models at Scale

preprint OA: closed
Full text JSON View at publisher

Abstract

Abstract The proliferation of Large Language Models (LLMs) has transformed numerous domains in natural language processing (NLP) and various artificial intelligent (AI)-driven applications. However, efficiently scaling these models involves challenges related to latency, cost, and system complexity. This paper presents a comprehensive set of best practices structured around key areas including direct access to vector databases, direct invocation of OpenAI LLM APIs, optimal scaling of computational resources, reranking of AI search results, dynamic adjustment of context chunk counts, and dynamic model selection to balance cost and quality. It also explores understanding usage modes for cost optimization, leveraging vector caching to reduce embedding expenses, and addressing networking overhead impacts on latency in large-scale generative AI API calls. Together, these guidelines enable scalable, high-performance, and cost-effective LLM deployments in enterprise environments.
Full text 11,594 characters · extracted from preprint-html · click to expand
Best Practices for Using Large Language Models at Scale | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Short Report Best Practices for Using Large Language Models at Scale Bhargavee Kannikanti, Arjun Coimbatore Nagarasan, Alberto Rosas, and 2 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-8329621/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract The proliferation of Large Language Models (LLMs) has transformed numerous domains in natural language processing (NLP) and various artificial intelligent (AI)-driven applications. However, efficiently scaling these models involves challenges related to latency, cost, and system complexity. This paper presents a comprehensive set of best practices structured around key areas including direct access to vector databases, direct invocation of OpenAI LLM APIs, optimal scaling of computational resources, reranking of AI search results, dynamic adjustment of context chunk counts, and dynamic model selection to balance cost and quality. It also explores understanding usage modes for cost optimization, leveraging vector caching to reduce embedding expenses, and addressing networking overhead impacts on latency in large-scale generative AI API calls. Together, these guidelines enable scalable, high-performance, and cost-effective LLM deployments in enterprise environments. Full Text Additional Declarations The authors declare no competing interests. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-8329621","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Short Report","associatedPublications":[],"authors":[{"id":558373996,"identity":"c2fac25e-dac6-4ab4-bb43-75884ce32529","order_by":0,"name":"Bhargavee Kannikanti","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAqElEQVRIiWNgGAWjYBACAx7mww8SDtiQpIUtzeDDgTQGHjbitfAYSM44cJgELeY8xxKMec6cl7eXb2D88DGHCC2Wvc0HHvPcuG3Yw8bALDlzGzEOO88GtOXDbUagFjZmXuK08BhI83w4Z0+ClrM9QO/fOJBIvBbLnmPAQD6TnNxzLLGZOL+Y8yQDo/KYnW178+GDHz4SowUJMDaQpn4UjIJRMApGAW4AAE4kN4FK/Je7AAAAAElFTkSuQmCC","orcid":"","institution":"","correspondingAuthor":true,"prefix":"","firstName":"Bhargavee","middleName":"","lastName":"Kannikanti","suffix":""},{"id":558373997,"identity":"b1616fb8-98b5-4bfb-b642-4e0482ee0454","order_by":1,"name":"Arjun Coimbatore Nagarasan","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAArElEQVRIiWNgGAWjYFAC5uMfEhhsSNLClsbwgSGNgYeNeC08ZowzGA6ToIW//YzZY56K8/L28g2MHz7mEKFF4kxauTHPmduGPWwMzJIztxFjzQ3mDdK8bbcZgVrYmHmJ0SJ/g8FAmvffOXvitRjcYDGTnNlwIJF4LYZn0pINPhxLTu45lthMnF/kjh8++CChxs62vfnwwQ8fifI+AjA2kKZ+FIyCUTAKRgFuAAClzTM92IeKBwAAAABJRU5ErkJggg==","orcid":"","institution":"","correspondingAuthor":true,"prefix":"","firstName":"Arjun","middleName":"Coimbatore","lastName":"Nagarasan","suffix":""},{"id":558373998,"identity":"0e5f9473-72bf-4255-8e1d-04bdc87da5d8","order_by":2,"name":"Alberto Rosas","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAqklEQVRIiWNgGAWjYFACxsYHEgw2JGlhPmxgwZDGwMNGvBa2NIkKhsMkaOGffcZA4mbbeXl7+QbGDx9ziNAicS7HwHBm223DHjYGZsmZ24ix5gyPQbLEmduMQC1szLzEaJEHajn858w5e+K1GJxhS2yQqDiQSLwWwzPMhxkkKpKTe44lNhPnF7kzjO0/JAzsbNubDx/88JEo7yMAYwNp6kfBKBgFo2AU4AYA56AxYptRbmMAAAAASUVORK5CYII=","orcid":"","institution":"","correspondingAuthor":true,"prefix":"","firstName":"Alberto","middleName":"","lastName":"Rosas","suffix":""},{"id":558373999,"identity":"7421f4f0-e03d-484d-ad3b-3147ee51f5da","order_by":3,"name":"Sriram Kothandaraman","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAq0lEQVRIiWNgGAWjYDACHobEx3//2ZCm5bEBb0MaAw8b8VoYn0nwNhwmQYt8z+EECcmG8/L28g2MHz7mEKHF4GxbgoHhj9uGPWwMzJIztxGjhZ8nISGx4TYjUAsbMy8xWuT7+T8cONhwzp54LQxnGxIbGxsOJBKvxeDMgWRmxobk5J5jic3E+UW+JyH9N2ODnW178+GDHz4S5TAEYGwgTf0oGAWjYBSMAtwAAH2rNPuNJIGSAAAAAElFTkSuQmCC","orcid":"","institution":"","correspondingAuthor":true,"prefix":"","firstName":"Sriram","middleName":"","lastName":"Kothandaraman","suffix":""},{"id":558374000,"identity":"a115339a-81a8-4c34-b2eb-f599073a7690","order_by":4,"name":"Sravan Kumar Kannuri","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAqElEQVRIiWNgGAWjYDACHv4HBxIqbEjSwsP44MOZNAYeNhK0MBvObDtMghb5nrPHpHnbzsvbyzcwfviYQ4QWg7N9adI8524b9rAxMEvO3EaMFn4GM2mestuMQC1szLzEaJHvB2lhO2dPvBaGsz3GhjPaDiQSr8XgzLFEYCAnJ/ccS2wmzi/yPckHgFFpZ9vefPjgh49EOQwBGBtIUz8KRsEoGAWjADcAAFVbM/6C5KPVAAAAAElFTkSuQmCC","orcid":"","institution":"","correspondingAuthor":true,"prefix":"","firstName":"Sravan","middleName":"Kumar","lastName":"Kannuri","suffix":""}],"badges":[],"createdAt":"2025-12-10 16:40:17","currentVersionCode":1,"declarations":{"humanSubjects":false,"vertebrateSubjects":false,"conflictsOfInterestStatement":false,"humanSubjectEthicalGuidelines":false,"humanSubjectConsent":false,"humanSubjectClinicalTrial":false,"humanSubjectCaseReport":false,"vertebrateSubjectEthicalGuidelines":false},"doi":"10.21203/rs.3.rs-8329621/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-8329621/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":98427616,"identity":"fcd93c3e-ec81-442e-b026-bd85071f11d2","added_by":"auto","created_at":"2025-12-17 16:40:53","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":603142,"visible":true,"origin":"","legend":"","description":"","filename":"BestPracticesforUsingLargeLanguageModelsatScalefinal.pdf","url":"https://assets-eu.researchsquare.com/files/rs-8329621/v1_covered_f12261fc-ede0-4b50-8133-2f35eb5d5d91.pdf"}],"financialInterests":"The authors declare no competing interests.","formattedTitle":"\u003cp\u003e\u003cstrong\u003eBest Practices for Using Large Language Models at Scale\u003c/strong\u003e\u003c/p\u003e","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":true,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"","lastPublishedDoi":"10.21203/rs.3.rs-8329621/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-8329621/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eThe proliferation of Large Language Models (LLMs) has transformed numerous domains in natural language processing (NLP) and various artificial intelligent (AI)-driven applications. However, efficiently scaling these models involves challenges related to latency, cost, and system complexity. This paper presents a comprehensive set of best practices structured around key areas including direct access to vector databases, direct invocation of OpenAI LLM APIs, optimal scaling of computational resources, reranking of AI search results, dynamic adjustment of context chunk counts, and dynamic model selection to balance cost and quality. It also explores understanding usage modes for cost optimization, leveraging vector caching to reduce embedding expenses, and addressing networking overhead impacts on latency in large-scale generative AI API calls. Together, these guidelines enable scalable, high-performance, and cost-effective LLM deployments in enterprise environments.\u003c/p\u003e","manuscriptTitle":"Best Practices for Using Large Language Models at Scale","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-12-12 04:04:10","doi":"10.21203/rs.3.rs-8329621/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"f5f53068-4ffa-41f7-a4aa-a77552cc2d54","owner":[],"postedDate":"December 12th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2025-12-12T04:04:10+00:00","versionOfRecord":[],"versionCreatedAt":"2025-12-12 04:04:10","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-8329621","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-8329621","identity":"rs-8329621","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00