🤖 AI/ML

Llama

Meta Llama

Meta's open-source large language model. Free for researchers and developers.

📖 Detailed Explanation

Llama (Large Language Model Meta AI) is a series of open-source large language models developed by Meta (formerly Facebook). Along with GPT-4 and Claude, it is one of the most influential LLMs today, and because it is provided free of charge to researchers and developers, it has become a core pillar of the open-source AI ecosystem.

It started with Llama 1 in 2023 and has developed rapidly through Llama 2, Llama 3, and the latest Llama 3.2. In particular, Llama 3.2 adds 11B and 90B vision models to support multimodal capabilities, and the 1B/3B lightweight models can run even on mobile edge devices. In April 2025, Llama 4 was released, introducing a MoE (Mixture of Experts) architecture.

Llama is based on the Transformer decoder architecture and applies modern techniques such as RMSNorm, the SwiGLU activation function, and Rotary Positional Embedding (RoPE). It supports a 128K context length and supports 8 languages, including English, German, and French.

In practice, Llama is an open-source model that can be used commercially, and it is used for building in-house AI services, domain-specific fine-tuning through LoRA/QLoRA, and edge device deployment. It is supported by all major clouds, including AWS, Google Cloud, and Azure.

💻 Code Example

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Llama 3.2 모델 로드 (HuggingFace에서 접근 권한 필요)
model_name = "meta-llama/Llama-3.2-3B-Instruct"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

# 대화 형식으로 프롬프트 구성
messages = [
    {"role": "system", "content": "당신은 친절한 AI 어시스턴트입니다."},
    {"role": "user", "content": "머신러닝과 딥러닝의 차이점을 설명해주세요."}
]

# 토큰화 및 생성
input_ids = tokenizer.apply_chat_template(
    messages,
    return_tensors="pt"
).to(model.device)

outputs = model.generate(
    input_ids,
    max_new_tokens=512,
    temperature=0.7,
    do_sample=True,
    top_p=0.9
)

response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

# vLLM을 사용한 고성능 서빙 (프로덕션 환경)
# from vllm import LLM, SamplingParams
# llm = LLM(model=model_name)
# outputs = llm.generate(prompts, SamplingParams(temperature=0.7))

📊 Performance & Cost

These are the Llama model specs and benchmarks as of January 2025.

Model Parameter Context Features
Llama 3.3 70B 70B 128K IFEval 92.1, MATH 77.0
Llama 3.2 90B Vision 90B 128K Multimodal (image + text)
Llama 3.2 11B Vision 11B 128K Lightweight multimodal
Llama 3.2 3B 3B 128K For edge/mobile
Llama 3.2 1B 1B 128K On-device optimization
Item Specs/Pricing Notes
License Llama Community License Free commercial use under 700 million MAU
70B VRAM (FP16) ~142GB Requires 2x H100 80GB
70B VRAM (Q4) ~40GB RTX 4090 24GB + RAM offloading
API cost (Groq) $0.60 / 1M tokens 276 tokens/sec inference speed

🗣️ Say It Like This in Practice

💬 In a Meeting
"We plan to build our own chatbot service based on Llama 3.2 70B. We can reduce OpenAI API costs by more than 80% per month, and LoRA fine-tuning to fit our domain is also possible."
💬 In an Interview
"Llama is an open-source model that can be used commercially, so startups can build LLM services cost-effectively. The Llama 3.2 90B Vision model shows performance on par with GPT-4o on the ChartQA benchmark."
💬 In a Technical Discussion
"For on-device AI, the Llama 3.2 1B or 3B model is suitable. It supports a 128K context and is small enough to run on mobile, so it can be used for offline summarization and translation features."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

⚠️ Common Mistakes & Cautions

❌
Using it while ignoring the license terms

Llama is not fully open source. Services with 700 million or more monthly active users require a separate license from Meta.

✅
Correct usage

Check the Llama Community License, and for large-scale services, contact Meta to inquire about a license. Serving with vLLM or TGI can increase throughput by more than 10 times.

🔗 Related Terms

📚 Learn More