Meta
Search
Home

Get started
Overview
Models
Overview
Llama 4
Llama Guard 4
Llama 3.3
Other models
Use our models
Cloud partners
Edge partners
Download
Meta
Hugging Face
Kaggle
Building with Llama
How to guides
Overview
Prompt Engineering (Updated)
Fine-tuning
Quantization
Distillation
Validation
Vision Capabilities
Responsible Use
Integration guides
Overview
LangChain Integration
LlamaIndex Integration
Deployment guides
Overview
Private cloud
Production pipelines
Infrastructure migration
Versioning
Accelerator management
Autoscaling
Regulated industry self-hosting
Security in production
Cost projection and optimization
Comparing costs

Stay updated
Get started
Model Cards & Prompt formats

Meta Llama 2

Model Card

You can find details about this model in the model card.

Special Tokens used with Meta Llama 2

<s></s>: These are the BOS and EOS tokens from SentencePiece. When multiple messages are present in a multi turn conversation, they separate them, including the user input and model response.

[INST][/INST]: These tokens enclose user messages in multi turn conversations.

<<SYS>><</SYS>>: These enclose the system message.

Meta Llama 2

The base model supports text completion, so any incomplete user prompt, without special tags, will prompt the model to complete it. The tokenizer provided with the model will include the SentencePiece beginning of sequence (BOS) token (<s>) if requested. Review this code for details.

<s>{{ user_prompt }}

Meta Llama 2 Chat

Code to produce this prompt format can be found here. The system prompt is optional.

Single message instance with optional system prompt.

<s>[INST] <<SYS>>
{{ system_prompt }}
<</SYS>>

{{ user_message }} [/INST]

Multiple user and assistant messages example.

<s>[INST] <<SYS>>
{{ system_prompt }}
<</SYS>>

{{ user_message_1 }} [/INST] {{ model_answer_1 }} </s>
<s>[INST] {{ user_message_2 }} [/INST]
On this page
Meta Llama 2
Model Card
Special Tokens used with Meta Llama 2
Meta Llama 2
Meta Llama 2 Chat
Meta
post image
post image
post image
post image
Products
Muse Code
Meta Model API
Models
Muse Spark 1.2
Muse Spark 1.1
Muse Glimmer
Muse Voice Transcribe
Llama 4
Llama 3
Documentation
Meta Model API Docs
Muse Glimmer Docs
Llama Docs
Resources
Cookbook
Blog
Videos
Case studies
FAQs
Community
Meta-Models Github
Llama GitHub
Hugging Face
Terms & policies
Terms of Service
Privacy Policy
Cookie Policy
Products
Muse Code
Meta Model API
Models
Muse Spark 1.3
Muse Spark 1.2
Muse Spark 1.1
Muse Glimmer
Muse Image
Muse Voice Transcribe
Llama 4
Llama 3
Documentation
Meta Model API Docs
Muse Glimmer Docs
Llama Docs
Resources
Cookbook
Blog
Videos
Case studies
FAQs
Community
Meta-Models Github
Llama GitHub
Hugging Face
Terms & policies
Terms of Service
Privacy Policy
Cookie Policy