Llama 3 is Meta's April 2024 open-weights model family, released at 8B and 70B parameters. This article is about getting one of them running on AWS with the least ceremony: a pre-configured Meetrix AMI that you launch from AWS Marketplace with CloudFormation, which gives you an OpenAI-compatible HTTP API on your own domain. If you would rather read the full launch reference with every stack parameter and screenshot, that is the Llama 3 developer guide.
One honest caveat before you spend money. Llama 3 is no longer Meta's newest family. Llama 3.1, 3.2 and 3.3 followed within the year, and Llama 4 shipped in April 2025. If you are starting a fresh project, look at Llama 4 Scout on AWS first. Llama 3 is still the right call when an existing integration is pinned to it, or when you want 8B-class behaviour on a single modest GPU.
Video Guide
What You Get From the Llama 3 AMI
Two listings, one per model size. Both ship the model, an inference server and an OpenAI-compatible API behind a reverse proxy, so you skip the part that normally eats the afternoon: CUDA drivers, the serving stack, TLS.
The API exposes /v1/completions, /v1/chat/completions, /v1/embeddings and /v1/models. In practice that means an existing OpenAI SDK client works against your server after you change the base URL and nothing else. The product page for the stack is at Meetrix Llama 3.
Which GPU Instance Llama 3 Needs
This is the part people get wrong, so do the arithmetic before you launch. Model weights take roughly two bytes per parameter at 16-bit, and about half a byte at 4-bit. The KV cache and runtime overhead come on top of that.
| Model | Weights at 16-bit | Weights at 4-bit | What that means on AWS |
|---|---|---|---|
| Llama 3 8B | about 16 GB | about 5 GB | A single-GPU instance. g4dn.xlarge (one 16 GB T4) is the developer guide's baseline |
| Llama 3 70B | about 140 GB | about 35 to 40 GB | Multi-GPU. Four 24 GB GPUs hold it at 4-bit; 16-bit needs an 8-GPU instance |
A 16 GB T4 holds 8B comfortably at 4-bit and only just at 16-bit, with almost nothing left for the KV cache, so I would not size a busy 8B endpoint below that. The 70B model is a different class of purchase. Check the instance hourly price before you subscribe, because a multi-GPU instance left running over a weekend is the surprise on most first invoices. The AWS G4 instance page lists GPU memory per size.
Before the stack will launch you also need quota for GPU instances. New accounts usually start at zero for the On-Demand G and VT family, which shows up as a vCPU limit error when CloudFormation tries to create the instance. Our guide to increasing your AWS vCPU quota walks through the request, and it can take a day to be approved.
Install Llama 3 on AWS, Step by Step
Prerequisites
An AWS account with permission to subscribe to Marketplace products and create CloudFormation stacks, a domain name (Route 53 is easiest, because SSL is set up for you), an EC2 key pair, and the GPU quota above.
- Open one of the two Marketplace listings above and click Continue to Subscribe, then Accept Terms. Wait for the subscription to finish processing.
- Click Continue to Configuration. Choose CloudFormation Template for Llama 3 deployment as the fulfillment option and pick your region. Not every region has GPU capacity, so choose one where your instance type is available.
- Click Continue to Launch, choose Launch CloudFormation in the action dropdown, and click Launch.
- On the stack page, keep Template is ready selected and click Next. Give the stack a name, your admin email, the instance type, key name, SSH location and CIDR blocks. Restrict the SSH location to your own IP, because the default is open to everyone.
- Acknowledge that the stack creates IAM resources, then submit it.
- When the stack reaches
CREATE_COMPLETE, copy the public IP from the Outputs tab and create a DNS record for your domain pointing at it. - Open DashboardUrl (or DashboardUrlIp) from the same Outputs tab.
502 Bad Gateway right after launch
sudo systemctl restart llama.service.
If the domain is not in Route 53, or DNS had not propagated when the instance came up, automatic SSL will not complete. SSH into the server and run the certificate generation again once the record resolves.
Calling the Llama 3 API
Once the dashboard loads, test the endpoint with a plain chat completion before wiring it into anything:
curl https://your-domain.example/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "<id from /v1/models>", "messages": [{"role": "user", "content": "What is the capital of France?"}]}' Fetch /v1/models first and copy the model id from the response. A mismatched model name is the most common reason a first request fails. The developer guide has a ready-made Node.js test script that exercises all four endpoints.
Llama 3 vs ChatGPT, and Where Llama 3 Fits Now
The real difference between running Llama 3 and calling ChatGPT is not a benchmark score. It is who holds the data and who pays for idle time. With the AMI, prompts never leave your VPC, there is no per-token bill, and you pay for the GPU whether anyone is using it or not. With a hosted API you pay only for tokens, and someone else keeps the model current.
That trade tips toward self-hosting when you have steady volume, data you cannot send out, or a need to fine-tune. It tips toward the API when traffic is spiky and small. If you are choosing between open models rather than between self-hosting and an API, our Llama vs Mistral vs DeepSeek comparison covers that, and Ollama vs vLLM explains the serving layer if you plan to run it yourself instead of using the AMI. Coming from the previous generation? The Llama 2 install guide follows the same launch flow. For a chat front end on top of the endpoint, Open WebUI with Ollama on AWS is the usual pairing.
Keeping the Instance Cost Under Control
- Stop the EC2 instance when nobody needs it. You keep the EBS volume and pay only for storage while it is stopped, and the dashboard comes back when you start it again.
- Put a billing alarm on the account before the first launch. A GPU instance is the one resource here that can quietly cost real money.
- Restrict the SSH security group to your own IP and keep the API behind a key or an allow-list if the endpoint is public.
- If you are low on disk, the root volume can be enlarged from the EBS console, then reboot and restart
llama.service.
For the model source and license terms, see Meta's Llama 3 page and the official repository. If you hit anything this article does not cover, write to hello@meetrix.io.
Frequently Asked Questions
How do I install Llama 3 on AWS?
Subscribe to the Llama 3 8B or 70B AMI on AWS Marketplace, launch it through the CloudFormation template, point your domain at the instance, and open the dashboard URL from the stack outputs. Expect the model to need a few minutes to load before the API answers.
Which EC2 instance do I need for Llama 3?
The developer guide recommends g4dn.xlarge (one 16 GB T4 GPU) as a baseline, which suits the 8B model. The 70B model needs far more GPU memory, roughly 35 to 40 GB at 4-bit and about 140 GB at 16-bit, so plan a multi-GPU instance.
Why does the stack fail with a vCPU quota error?
New AWS accounts start with a zero or very low limit for G and VT GPU instances. Request an increase for the On-Demand G and VT instances quota in Service Quotas, then recreate the stack.
Is the Llama 3 API compatible with OpenAI clients?
Yes. The AMI exposes /v1/completions, /v1/chat/completions, /v1/embeddings and /v1/models, so the OpenAI SDKs work once you change the base URL to your own domain.
What does a 502 Bad Gateway mean after launch?
Usually the model service is still loading. Wait a few minutes and reload. If it persists, SSH in and run sudo systemctl restart llama.service.
Should I install Llama 3 or a newer Llama?
Meta has since released Llama 3.1, 3.2, 3.3 and Llama 4. If you have no reason to stay on Llama 3, start with a newer model. Llama 3 still makes sense for existing integrations and 8B-class hardware.
How do I get technical support?
Reach out to Meetrix Support at hello@meetrix.io for assistance with your Llama 3 deployment.
Ready to Deploy Your Own Llama 3 Instance?
Launch the pre-configured Llama 3 AMI in your own AWS account and call it through an OpenAI-compatible API.
Deploy Llama 3 from AWS Marketplace