---
title: "Deploy Meta Llama 3.1 405B on Google Cloud Vertex AI"
description: "Meta Llama 3.1 405B Instruct in FP8 can be served on a single Google Cloud A3 node (8x H100 80GB, ~640 GB VRAM) through Vertex AI, using Hugging Face's Text Generation Inference Deep Learning Container."
url: "https://swe.quest/articles/deploy-meta-llama-3-1-405b-on-google-cloud-vertex-ai-013efe3f83445849"
canonical: "https://huggingface.co/blog/llama31-on-vertex-ai"
source: "Hugging Face"
published: "2024-08-19"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["inference","llms","cloud"]
---

# Deploy Meta Llama 3.1 405B on Google Cloud Vertex AI

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-08-19, 12 min read, How-to. Original: [https://huggingface.co/blog/llama31-on-vertex-ai](https://huggingface.co/blog/llama31-on-vertex-ai)

## Summary

Meta Llama 3.1 405B Instruct in FP8 can be served on a single Google Cloud A3 node (8x H100 80GB, ~640 GB VRAM) through Vertex AI, using Hugging Face's Text Generation Inference Deep Learning Container. FP16 weights would need ~810 GB, so FP8 (~405 GB) is the recommended way to fit one node while leaving room for KV cache and CUDA graphs. The walkthrough covers the A3 quota requests, gcloud and SDK setup, registering the model with TGI environment variables (MODEL\_ID, NUM\_SHARD=8, HF token), and deploying to an endpoint, which takes about 25-30 minutes. It then shows how to apply the Llama 3.1 chat template with transformers and send prediction requests to the endpoint from Python.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)

## Prerequisites

- Google Cloud basics ([easy posts on Cloud platforms](https://swe.quest/tags/cloud.md?difficulty=easy))
- LLM inference concepts ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- Python ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))

## Keywords

Llama 3.1, Vertex AI, Text Generation Inference, Hugging Face, NVIDIA H100, FP8, Google Cloud A3

## Related posts

- [Welcome Llama 3 - Meta's new open LLM](https://swe.quest/articles/welcome-llama-3-meta-s-new-open-llm-76a74164d4c8a37c.md): Hugging Face · 2024-04-18 · Medium · 11 min read · LLMs, Inference & serving, Model training, Python
  Meta's Llama 3 ships in 8B and 70B sizes, each with base and instruct variants, plus Llama Guard 2, a safety classifier fine-tuned on Llama 3 8B.
- [Deploy LLMs with Hugging Face Inference Endpoints](https://swe.quest/articles/deploy-llms-with-hugging-face-inference-endpoints-3facefc244b0efa0.md): Hugging Face · 2023-07-04 · Medium · 6 min read · Inference & serving, LLMs, Python, JavaScript
  Falcon 40B Instruct can be deployed to Hugging Face Inference Endpoints through the web UI by choosing a repository, cloud, region and instance.
- [Llama 2 is here - get it on Hugging Face](https://swe.quest/articles/llama-2-is-here-get-it-on-hugging-face-c56eec059476bd0f.md): Hugging Face · 2023-07-18 · Medium · 9 min read · LLMs, Inference & serving, Model training, Python
  Meta's Llama 2 family (7B, 13B, 70B base and RLHF-tuned chat models) is released under a commercially usable license, trained on 40% more tokens than Llama 1 with 4k context and grouped-query attention for the 70B model, and is integrated across the Hugging Face ecosystem.
- [Llama 3.1 - 405B, 70B & 8B with multilinguality and long context](https://swe.quest/articles/llama-3-1-405b-70b-8b-with-multilinguality-and-long-context-5301df1fb1ba738c.md): Hugging Face · 2024-07-23 · Medium · 20 min read · LLMs, Inference & serving, Model training, AI agents
  Meta's Llama 3.1 ships in 8B, 70B and 405B sizes, each with base and instruct variants, plus the Llama Guard 3 and Prompt Guard safety classifiers.
- [Run a vLLM Server on HF Jobs in One Command](https://swe.quest/articles/run-a-vllm-server-on-hf-jobs-in-one-command-72dfec0fae623561.md): Hugging Face · 2026-06-26 · Medium · 7 min read · Inference & serving, LLMs, Cloud platforms
  A single \`hf jobs run\` command using the official vllm/vllm-openai image, a GPU \`--flavor\` and \`--expose 8000\` launches a private, OpenAI-compatible LLM endpoint on Hugging Face infrastructure, billed per second and gated by HF token auth through the jobs proxy.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
