Skip to main content

Llama

Llama is a family of decoder-only LLMs focused on efficient inference by training smaller models on more tokens. Architecture highlights: pre-norm, SwiGLU, RoPE.

Adapted for this playbook from the 🤗 Transformers documentation by Hugging Face. Official page: https://huggingface.co/docs/transformers/model_doc/llama. Images © Hugging Face (documentation-images) unless noted. This is not a substitute for the upstream docs — verify against the current version.

Covers Hugging Face pages: model_doc/llama

Llama attention mask illustration — Source: Hugging Face

Source: Hugging Face Transformers documentation (llama-attn-mask.png).

Quick usage​

from transformers import pipeline

pipe = pipeline(task="text-generation", model="huggyllama/llama-7b")
print(pipe("Plants create energy through a process known as", max_new_tokens=40))

Prefer current official Meta / community instruct checkpoints for production; accept Hub gates where required (Installation).

Serving​

Pair with Inference engines (vLLM/SGLang) and Chat templates.

Official API​

Llama model doc.

Discussion

Comments​

Share feedback or questions about this page. No account required.

Loading comments…