How to size infrastructure for AI features: CPU or GPU inference, RAM and VRAM, storage, on-premises versus cloud, shared hosting limits, cost checks and data residency in India.
Once a business decides to add an AI feature, a practical question follows quickly: where will it run? The options range from a basic shared hosting plan to a rented cloud GPU or a server in your own office. Each has very different costs, limits and responsibilities, and the right answer depends far more on the specific workload than on what is fashionable.
Choosing badly shows up in two ways. Over-provisioned infrastructure quietly consumes the budget every month, while under-provisioned infrastructure leads to slow responses, crashes under load and a feature users stop trusting. This guide walks through the decisions in order, so you can arrive at a sensible starting point and adjust from there.
First question: do you need to host a model at all?
Many AI features do not run a model on your own infrastructure. If your application sends text to a hosted model API and receives a response, your server is only doing ordinary web work: handling requests, calling the API, storing results. A standard virtual private server or well-configured hosting plan is enough.
You need to host a model yourself when one or more of these apply:
- Data must not leave your environment for legal, contractual or confidentiality reasons.
- Request volume is high enough that per-call API pricing becomes more expensive than running your own instance.
- You need a specialised or fine-tuned open model that is not offered as an API.
- The feature must work in a location with limited or no internet access.
If none apply, start with an API and revisit the decision when usage grows.
CPU or GPU for inference?
Not every model needs a GPU. Classic machine learning models such as gradient-boosted trees for credit scoring or demand forecasting run well on CPUs. Small neural networks for text classification, embeddings for search, or OCR on modest volumes can also run acceptably on modern multi-core CPUs, especially with optimised runtimes and quantised models.
GPUs become necessary when:
- You run language models with billions of parameters and need responses within a few seconds.
- You process images or video continuously, for example from several cameras.
- You serve many concurrent users, where a GPU's ability to process requests in batches pays off.
- You fine-tune or train models, even small ones.
The practical approach is to benchmark. Run your actual model with realistic inputs on a CPU instance and on the smallest suitable GPU instance, measure latency and throughput, and compare cost per thousand requests.
Sizing RAM, VRAM and storage
Memory is usually the first constraint. A useful rule of thumb for model weights is parameters multiplied by bytes per parameter:
- 16-bit precision: about 2 bytes per parameter, so a 7-billion-parameter model needs roughly 14 GB.
- 8-bit quantisation: about 1 byte per parameter, roughly 7 GB.
- 4-bit quantisation: about half a byte per parameter, roughly 3.5 to 4 GB.
On top of the weights, allow headroom for the working memory used during generation, which grows with context length and the number of simultaneous requests. For GPU inference this must fit in the GPU's VRAM; for CPU inference it must fit in system RAM, with enough left over for the operating system and your application.
Storage matters more than people expect. Model files are large, you may keep several versions, and loading from slow disks makes restarts painfully slow. Use SSD or NVMe storage, keep model files separate from application code, and include them in your backup and recovery plans. If you store embeddings for document search, plan for the vector index to grow with your content.
On-premises, cloud or shared hosting
| Option | Suits | Watch out for |
|---|---|---|
| Shared hosting | Websites that call external AI APIs at low volume | No GPU, limited RAM and CPU, short execution time limits, often no long-running processes or queue workers |
| VPS or dedicated CPU server | API-based features, classic ML, small models, queue workers | You manage updates, security and monitoring |
| Cloud GPU instances | Self-hosted language and vision models, variable demand, experiments | Hourly cost when left running, availability of GPU types in your chosen region |
| Own GPU server on-premises | Steady high usage, strict data control, offline sites | Upfront cost, power and cooling, hardware failures, staff skills |
Shared hosting deserves a specific warning. It is fine for a website that sends a request to an AI API and shows the answer, but it is not designed for running models. Long-running PHP or Python processes are often killed, memory per account is limited, and you cannot install GPU drivers. If your feature needs background processing or a self-hosted model, move that part to a VPS or cloud instance and keep the website where it is if you prefer.
A cost checklist before you commit
- Estimate volume: requests per day, peak requests per minute, average input and output size.
- Measure cost per request on each candidate option, including API fees if applicable.
- Check idle cost. A GPU instance left running overnight with no traffic still bills; use scheduling or autoscaling where possible.
- Include data transfer and storage charges, snapshots and backups.
- Compare reserved or committed-use pricing only after usage is stable.
- Count people time: patching, monitoring, on-call and upgrades.
- Plan for growth over twelve months, not just launch week.
- Price in GST and currency conversion for services billed in US dollars.
Data residency and compliance in India
Where your data is processed matters. The Digital Personal Data Protection Act, 2023 sets obligations for organisations handling personal data of individuals in India, and sector regulators can impose stricter rules; for example, the Reserve Bank of India requires payment system data to be stored in India. Schools, hospitals and financial services firms often have contractual or regulatory expectations about where data sits.
Practical steps:
- Choose cloud regions located in India for storage and processing where your requirements call for it; the major providers operate Indian regions.
- Check where a third-party AI API processes and retains data, and whether it is used for training.
- Minimise personal data sent to models; mask names, phone numbers and identifiers where the task allows.
- Document the data flow so you can answer questions from customers, auditors or the Data Protection Board.
This is a general overview, not legal advice; confirm specific obligations for your sector with a qualified adviser.
How NextWebGen can help
NextWebGen sets up and manages servers and cloud infrastructure for web applications, including those with AI features. We can help you benchmark options, choose a hosting setup that fits your workload and budget, and keep it secure and monitored afterwards. Learn about our server management services.



