Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 12 min read How-to mediumAdept

Deploy Meta Llama 3.1 405B on Google Cloud Vertex AI

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.

Related posts

  • Welcome Llama 3 - Meta's new open LLM

    Hugging Face mediumAdept

    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. Key changes from Llama 2 are a 128K-token vocabulary that encodes text more efficiently but enlarges the embedding matrices, Grouped-Query Attention in the 8B model, an 8K context, and pretraining on 15T tokens. Instruct tuning combined SFT, rejection sampling, PPO and DPO. The post gives the instruct prompt format, Transformers 4.40 usage with bf16 or 4-bit loading (about 16 GB vs 7 GB), deployment via TGI, Vertex AI or SageMaker, and a QLoRA fine-tune with the TRL CLI that takes about 4 hours on a single A10G.

  • Deploy LLMs with Hugging Face Inference Endpoints

    Hugging Face mediumAdept

    Falcon 40B Instruct can be deployed to Hugging Face Inference Endpoints through the web UI by choosing a repository, cloud, region and instance. For best performance the suggested 4x T4 instance should be switched to a single A100. Once the endpoint is live it can be called with cURL, and generation is controlled through parameters such as temperature, max_new_tokens (max 512), top_k/top_p, repetition_penalty and stop sequences. Tokens can be streamed to clients using huggingface_hub's InferenceClient in Python or HfInferenceEndpoint from @huggingface/inference in JavaScript, with code that skips special tokens and stops on stop sequences.

  • Llama 2 is here - get it on Hugging Face

    Hugging Face mediumAdept

    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. Inference runs through transformers 4.31 or Text Generation Inference and Inference Endpoints, with recommended GPU sizes per model (A10G for 7B, A100 for 13B, 2-4x A100 for 70B). The 7B model can be fine-tuned on a single 16GB T4 using QLoRA and trl's SFTTrainer. The chat prompt format uses [INST] and <<SYS>> delimiters, and prompts must match the training template exactly for system prompts and multi-turn conversations to work.

  • Llama 3.1 - 405B, 70B & 8B with multilinguality and long context

    Hugging Face mediumAdept

    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. All models support 128K context, 8 languages and tool calling, and the license now permits using outputs for distillation and synthetic data. Concrete memory figures are given: the 405B model needs 810 GB in FP16 or 405 GB in FP8, and KV cache at 128K tokens reaches 123 GB for 405B and rivals the weights' size for 8B. There are also fine-tuning estimates for full, LoRA and Q-LoRA, Transformers usage and 4-bit loading, and the prompt format with the new ipython role and built-in tool-calling tokens.

  • Run a vLLM Server on HF Jobs in One Command

    Hugging Face mediumAdept

    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. The guide covers querying via curl and the OpenAI Python client, and scaling to Qwen3.5-122B on 2×H200 with `--tensor-parallel-size`, using capped `--max-model-len` and `--max-num-seqs` to avoid out-of-memory errors. It also shows a Gradio chat UI, SSH debugging, and enabling tool-call parsing to back the Pi coding agent. HF Jobs suits experiments, evals and batch generation, while Inference Endpoints fit production workloads that need scale-to-zero and finer access control.

The quest for software engineering knowledge.

Look:
Layout: