---
title: "Llama 2 is here - get it on Hugging Face"
description: "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."
url: "https://swe.quest/articles/llama-2-is-here-get-it-on-hugging-face-c56eec059476bd0f"
canonical: "https://huggingface.co/blog/llama2"
source: "Hugging Face"
published: "2023-07-18"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 9
tags: ["llms","inference","model-training","python"]
---

# Llama 2 is here - get it on Hugging Face

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-07-18, 9 min read, Announcement. Original: [https://huggingface.co/blog/llama2](https://huggingface.co/blog/llama2)

## Summary

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.

Written by swe.quest, not by the author.

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

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Python ([easy posts on Python](https://swe.quest/tags/python.md?difficulty=easy))
- Hugging Face transformers basics
- LLM fine-tuning concepts ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

Llama 2, Hugging Face Transformers, Text Generation Inference, QLoRA, PEFT, trl, Inference Endpoints, RLHF

## 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.
- [Welcome Gemma - Google’s new open LLM](https://swe.quest/articles/welcome-gemma-google-s-new-open-llm-a7d68dd269473a81.md): Hugging Face · 2024-02-21 · Medium · 9 min read · LLMs, Inference & serving, Model training, Python
  Google's Gemma open LLM family ships in 2B and 7B sizes, each with base and instruction-tuned variants and an 8K context.
- [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.
- [The Falcon has landed in the Hugging Face ecosystem](https://swe.quest/articles/the-falcon-has-landed-in-the-hugging-face-ecosystem-ce9380035627bacb.md): Hugging Face · 2023-06-05 · Medium · 12 min read · LLMs, Inference & serving, Model training, Python
  Falcon-7B and Falcon-40B are Apache 2.0 language models from TII, trained mostly on the deduplicated, filtered RefinedWeb dataset.
- [Deploy Meta Llama 3.1 405B on Google Cloud Vertex AI](https://swe.quest/articles/deploy-meta-llama-3-1-405b-on-google-cloud-vertex-ai-013efe3f83445849.md): Hugging Face · 2024-08-19 · Medium · 12 min read · Inference & serving, LLMs, Cloud platforms
  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.

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)
