Llama – Meta's open model family
Llama is Meta’s family of open-weights large language models, first released in February 2023 and now the most widely deployed open model lineage in the world. Where the Meta AI company profile covers why Meta releases these models open-weight and what it means strategically, this article is the technical and practical deep dive: what each generation actually changed at the architecture level, how the models benchmark against closed alternatives, where you can run them, what the licence actually says when you read it verbatim, and when Llama is the right base for a production system versus when you should pick Mistral, Qwen or Gemma instead.
If you are choosing a foundation model to build on, the Llama question is specific: it is not “is this a good model” but “is this the right open base for my workload, at what cost, under what licence constraints, and on which inference stack.” This article answers those four questions with version-stamped numbers, because Llama’s capabilities change quarterly and any benchmark without a date attached is close to useless.
Llama as a strategic phenomenon
The Llama story begins with an accident. In February 2023 Meta released the first LLaMA models to researchers under a restrictive non-commercial licence, intending controlled academic access. Within a week the weights leaked publicly via BitTorrent. That leak, more than any deliberate decision, kick-started the open-weight era: suddenly capable foundation-model weights were in the wild, runnable on consumer hardware, and the global developer community began fine-tuning, quantising and building on them at a pace no closed model could match.
Meta’s response was to lean in rather than litigate. In July 2023 it released Llama 2 under a genuinely permissive commercial licence – free to use, modify and deploy commercially, with restrictions only on the very largest companies. This converted an accidental leak into a deliberate strategy. The cadence since has been relentless:
- Llama 1 – February 2023, research-only, leaked.
- Llama 2 – July 2023, first permissive commercial licence (7B, 13B, 70B).
- Llama 3 – 18 April 2024, 8B and 70B, the release that redefined what open models could do at their parameter scale.
- Llama 3.1 – 23 July 2024, added the 405B flagship and extended context to 128K.
- Llama 3.2 – September 2024, added small models (1B, 3B) and the first vision models (11B, 90B).
- Llama 3.3 – December 2024, a 70B that matched the 405B’s quality through better post-training.
- Llama 4 – 5 April 2025, the multimodal mixture-of-experts generation (Scout, Maverick, Behemoth).
Why does Meta keep shipping? The short answer, covered in depth in the company profile, is that Meta’s revenue comes from advertising, not from selling model access, so commoditising the foundation-model layer hurts its competitors more than it hurts Meta. The Llama releases are an investment in keeping the model layer cheap and open – which prevents any rival from building a proprietary-model moat that Meta would then have to pay a platform tax to cross. We unpack the decoder-only transformer architecture all these models share in the GPT architecture explainer.
The Llama 3 architecture
The Llama 3 generation, which remains heavily used in production well into 2026, is a clean example of a modern decoder-only transformer with a handful of specific engineering choices that matter.
Decoder-only transformer. Like every frontier conversational model, Llama 3 is a decoder-only transformer trained on next-token prediction. Llama 3 was pre-trained on over 15 trillion tokens – roughly seven times the data of Llama 2 – with four times more code, and it switched tokeniser from Llama 2’s SentencePiece to a 128,000-token vocabulary based on OpenAI’s tiktoken, which improves encoding efficiency across languages.
Grouped-Query Attention. The key efficiency choice across Llama 3 is Grouped-Query Attention (GQA). Standard multi-head attention gives every query head its own key and value heads, which is expensive in memory at inference time. GQA divides the query heads into groups that share a single key and value head – the Llama 3.1 8B model, for instance, uses 32 query heads but only 8 key/value heads, a group size of 4. This cuts the memory footprint of the attention cache substantially with minimal quality loss, which is a large part of why Llama models run efficiently on constrained hardware.
The context-length story. Llama 3 launched on 18 April 2024 with an 8,192-token context window – competitive but not remarkable. The transformative change came three months later: Llama 3.1, released 23 July 2024, applied RoPE (rotary positional embedding) scaling to extend context to 128,000 tokens on essentially the same underlying architecture. That 16× expansion, combined with the simultaneous release of the 405B, is what turned Llama from a strong small-context model into a genuine frontier-capable platform.
The sizes. Llama 3.1 shipped in three sizes, all with 128K context and both base and instruction-tuned variants: 8B (lightweight, best for simple generation and edge deployment), 70B (the cost-effective workhorse for most production use cases), and 405B (the flagship, trained on a 24,000-GPU cluster, designed to compete with the closed frontier).
Llama Guard. Alongside the models, Meta ships Llama Guard – a separate safety-classifier model that screens inputs and outputs for policy violations. This matters for production: because the base models are open and uncensored relative to consumer chat products, Llama Guard is the supported way to add a content-safety layer you control, rather than relying on safety baked into a closed API.
Llama 4 and the multimodal era
Llama 4, released 5 April 2025, is the current generation and a genuine architectural break from the Llama 3 line. Two things changed fundamentally: the models became natively multimodal, and they moved to a mixture-of-experts (MoE) architecture. We cover the full Llama 4 lineup and its strategic context in the Meta AI company profile; here is the technical summary.
Mixture-of-Experts. Where Llama 3 models are dense (every parameter is used for every token), Llama 4 models are sparse MoE: the model has many “expert” sub-networks but activates only a few per token. This decouples total knowledge capacity from inference cost. The two released variants:
- Llama 4 Scout – 17 billion active parameters across 16 experts, 109 billion total. Natively multimodal, with an industry-leading 10-million-token context window, and designed to run on a single H100 GPU.
- Llama 4 Maverick – 17 billion active parameters across 128 experts, 400 billion total. 1-million-token context, native multimodal, the performance-tier model.
A third model, Llama 4 Behemoth (288B active, ~2 trillion total), is described by Meta as a “teacher” used to distil the smaller models and, as of mid-2026, has not been publicly released.
Native multimodality. Llama 4 accepts image inputs natively, processed through the same model rather than bolted on as a separate vision encoder. This is the architectural catch-up to GPT-4o and Gemini, though the depth of visual reasoning still trails those frontier closed models.
Capability versus closed models. At launch, Meta’s published benchmarks showed Maverick outperforming GPT-4o and Gemini 2.0 Flash on standard evaluations, with an experimental chat variant reaching an ELO around 1417 on the LMArena leaderboard. The honest framing for 2026: Llama 4 Maverick is competitive with the previous generation of frontier models (GPT-4o class) but lags the current frontier (GPT-5.5, Claude Opus 4.x, Gemini 3.x) on the hardest reasoning, agentic and coding tasks.
Llama benchmarks versus closed alternatives
This is where version-stamping is non-negotiable. Here are the best-known numbers, dated, with the comparison context that makes them meaningful.
Llama 3.1 405B (July 2024), instruction-tuned:
- MMLU (5-shot): 87.3% – at release this matched or beat GPT-4-Turbo (86.5%), Claude 3 Opus (86.8%) and Gemini 1.5 Pro (85.9%).
- GPQA (0-shot, graduate-level reasoning): ~50.7% – matched Claude 3 Opus (50.4%), edged GPT-4-Turbo (48.0%).
- HumanEval (0-shot, coding): 89.0% – beaten only by Claude 3.5 Sonnet (92) and GPT-4o (90) at the time.
- MATH (0-shot): 73.8% – beaten only by GPT-4o (76.6%).
The significance in July 2024 was historic: for the first time, an open-weights model matched the best closed models on standard text benchmarks. The 128K context and the ability to self-host made it a genuine alternative rather than a second-tier option.
Llama 3.3 70B (December 2024): a “1-to-1 architectural update” that improved post-training without changing the architecture, gaining roughly 4% across benchmarks (notably +9% on MATH, +8% on HumanEval) – enough for a 70B to approach the quality of the 405B and match closed models like GPT-4o, Claude 3.5 Haiku and Gemini Flash. This is the model many teams actually deploy, because it delivers near-flagship quality at a fraction of the serving cost.
The 2026 reality check. Against the current frontier, Llama 3.1 405B and Llama 4 Maverick both trail. On the hardest current benchmarks – FrontierMath, Terminal-Bench, SWE-Bench Verified, GPQA Diamond at the level GPT-5.5 and Claude Opus 4.x now reach – the gap is real and meaningful. Llama’s value proposition in 2026 is not “matches the absolute frontier”; it is “delivers 80-90% of frontier quality, openly, at a fraction of the cost, with full control.” For comparison points we cover Claude and Gemini in their own profiles.
Where Llama runs
A defining advantage of open weights is that you are not locked to one provider. Llama runs in three broad configurations.
Cloud inference providers. A competitive market of hosting companies serves Llama models via API, often far cheaper than frontier closed APIs and with no vendor lock-in (you can switch providers, since they all serve the same open weights). The notable ones: Together AI, Fireworks AI, Groq (custom LPU hardware for very low latency), Cerebras (wafer-scale chips for high throughput), AWS Bedrock, Google Vertex AI, and OpenRouter as an aggregator. Pricing for Llama 4 Maverick sits around $0.49 per million tokens, roughly one-fifth the cost of comparable closed-frontier APIs.
Self-hosted. This is where Llama’s openness pays off fully. The main runtimes: vLLM (the standard for high-throughput GPU serving in production), llama.cpp (CPU and consumer-GPU inference, the engine behind much of the local ecosystem), and Ollama (the easiest local-deployment wrapper for developers). We cover these in depth in the llama.cpp inference engine analysis and the practical Llama 3 vs Llama 4 local-deployment guide.
Fine-tuning. Because the weights are open, the full fine-tuning toolkit is available: full fine-tuning, LoRA and QLoRA for parameter-efficient adaptation, and quantisation (FP8, AWQ, GPTQ, GGUF) to shrink models for constrained hardware. The Llama 3.1 licence explicitly permits using model outputs to improve other models, which is a meaningful difference from more restrictive open licences.
The Llama licence – actually reading it
The brief here is correct: most coverage summarises the licence and gets the nuance wrong. The Llama models are released under the Llama Community License (Llama 4 uses the “Llama 4 Community License Agreement”), which is source-available, not OSI-approved open source. Two clauses matter most.
The 700M MAU restriction, verbatim:
“If, on the Llama 4 version release date, the monthly active users of the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700 million monthly active users in the preceding calendar month, you must request a license from Meta, which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the rights under this Agreement unless or until Meta otherwise expressly grants you such rights.”
The practical reading: the threshold is measured across the entire corporate group (“Licensee’s affiliates”), which means it sums all of a company’s products. This excludes a handful of the largest tech companies (Apple, Google, Microsoft, ByteDance, Tencent, Amazon) at the corporate level. For the other 99.9% of organisations, this clause never binds.
Attribution – “Built with Llama”. The licence requires that if you distribute or make available Llama or a derivative, you display “Built with Llama” prominently, include the licence, and name any Llama-derived model with “Llama” at the start of its name. In practice: prominent attribution on the product, the licence text shipped with redistributed weights, and derivative models named like “Llama-3-MyFineTune”.
Acceptable Use Policy. A separate AUP prohibits a list of harmful uses (illegal activity, weapons, CSAM, fraud, and similar) and – critically – can be updated by Meta without changing the licence text itself. This is the part of the agreement most likely to change, and it belongs in any compliance review that depends on Llama.
The honest summary in plain English: Llama is free for commercial use for essentially everyone, requires visible “Built with Llama” attribution, requires you not to use it for the prohibited activities in the AUP, and only restricts companies with more than 700 million monthly active users. It is not, by the Open Source Initiative’s definition, open source – it is permissive source-available, and the distinction matters mainly for the largest companies and for purists.
Llama in production
The practical decision framework, by scenario.
Cost economics. The core production argument for Llama is cost. At roughly one-fifth the per-token price of frontier closed APIs via providers like Together or Fireworks, and effectively free at the margin if you self-host on owned hardware, Llama wins decisively for high-volume workloads where token cost dominates: large-scale summarisation, classification, content pipelines, retrieval-augmented generation at scale. The break-even math favours self-hosting once volume is high enough to saturate a GPU.
When Llama is the right base for fine-tuning. If you need a model tuned to a specific domain, voice, or task, and you want to own the result, Llama is the default open base – the largest fine-tuning ecosystem, the most tooling, the widest hardware support. For data-residency or compliance-sensitive work (health, finance, government), self-hosted fine-tuned Llama is often the only configuration that survives review, because data never leaves your infrastructure.
When to pick something else. Llama is not always the right open model:
- Mistral (the European open-model lab) often leads on efficiency-per-parameter and has strong Apache-2.0-licensed models with no MAU restriction at all – worth choosing when you want a cleaner licence or a smaller efficient model. See the Mistral AI profile.
- Qwen (Alibaba) has been highly competitive on benchmarks, particularly for multilingual and coding tasks, and frequently tops open-model leaderboards.
- Gemma (Google’s open models) is a strong choice for smaller, efficient models well-integrated with the Google ecosystem.
- A frontier closed model (GPT-5.5, Claude Opus 4.x) remains the right choice when you need the absolute best reasoning, agentic capability, or polished instruction-following and cost is secondary.
The most resilient production architecture in 2026 is rarely “all Llama” or “all closed.” It is a routing layer: Llama (self-hosted or via cheap inference providers) for the high-volume bulk of requests, and a frontier closed model for the hardest 10-15% where quality justifies the cost. Llama’s role is to make the bulk of your inference cheap, controllable, and free of vendor lock-in.
Frequently asked questions
What is Llama?
Llama is Meta’s family of open-weights large language models, first released in February 2023. Unlike closed models such as GPT-5.5 or Claude, Llama’s weights can be downloaded, fine-tuned, and run on your own hardware. It is the most widely deployed open model lineage in the world and the foundation of much of the open-source AI ecosystem.
Is Llama free to use?
Yes, for essentially all organisations. Llama is free for commercial and non-commercial use under the Llama Community License, with one restriction: companies with more than 700 million monthly active users must request a separate licence from Meta. You must also display “Built with Llama” attribution and follow Meta’s Acceptable Use Policy. It is “source-available” rather than formally open source by the OSI definition.
What is the latest version of Llama?
As of 2026 the current generation is Llama 4, released 5 April 2025, in two available variants: Scout (17B active / 109B total parameters, 10M-token context, single-GPU) and Maverick (17B active / 400B total, 1M-token context, performance tier). Both are natively multimodal mixture-of-experts models. A third model, Behemoth (~2T total parameters), is used as a teacher model and has not been publicly released.
What is the difference between Llama 3 and Llama 4?
Llama 3 models are dense decoder-only transformers (every parameter used per token) and text-only in the base versions, with vision added in 3.2. Llama 4 moved to a sparse mixture-of-experts architecture (only a few “expert” sub-networks active per token, decoupling capacity from cost) and is natively multimodal, accepting image inputs directly. Llama 4 also dramatically extended context, with Scout reaching 10 million tokens.
How does Llama 3.1 405B compare to GPT-4o?
At its July 2024 release, Llama 3.1 405B matched or beat the frontier closed models on standard text benchmarks: MMLU 87.3% (vs GPT-4-Turbo’s 86.5%), GPQA ~50.7%, HumanEval 89.0%, MATH 73.8%. It was the first open model to genuinely rival the best closed models. Against the 2026 frontier (GPT-5.5, Claude Opus 4.x) it now trails on the hardest reasoning and agentic tasks, but it remains competitive for most production workloads at far lower cost.
What is Grouped-Query Attention in Llama?
Grouped-Query Attention (GQA) is an efficiency technique where multiple query heads share a single key and value head, instead of each query head having its own. Llama 3.1 8B, for example, uses 32 query heads but only 8 key/value heads. This cuts the memory needed for the attention cache at inference time with minimal quality loss, which is a major reason Llama models run efficiently on constrained hardware.
Where can I run Llama models?
Three ways. Cloud inference via providers like Together AI, Fireworks, Groq, Cerebras, AWS Bedrock and OpenRouter (cheap, no lock-in since they serve the same open weights). Self-hosted via vLLM (production GPU serving), llama.cpp (CPU and consumer GPU), or Ollama (easiest local setup). And fine-tuned on your own infrastructure with LoRA, QLoRA or full fine-tuning. Llama 4 Maverick runs around $0.49 per million tokens via cloud providers.
What does the “700M MAU” clause in the Llama licence mean?
It means any company whose products collectively exceed 700 million monthly active users must obtain a separate licence from Meta before using Llama, granted at Meta’s sole discretion. The count is summed across the entire corporate group (“Licensee’s affiliates”). This effectively targets only a handful of the largest tech companies; for everyone else, the clause never applies.
Is Llama actually open source?
Not by the Open Source Initiative’s formal definition. The Llama Community License is “source-available”: the weights are downloadable and free to use commercially, but the licence includes restrictions (the 700M MAU clause and naming/attribution requirements) that the OSI does not recognise as open source. In practical terms it is highly permissive for almost all users, but the precise term is “open weights” or “source-available,” not “open source.”
Should I use Llama, Mistral, Qwen, or Gemma?
Llama has the largest ecosystem, most tooling, and widest hardware support – the safe default open base. Choose Mistral for cleaner Apache-2.0 licensing (no MAU restriction) and strong efficiency. Choose Qwen for top-tier multilingual and coding benchmarks. Choose Gemma for small efficient models in the Google ecosystem. For absolute frontier quality where cost is secondary, a closed model like GPT-5.5 or Claude Opus 4.x is still the better choice.
What is “Built with Llama” attribution?
The Llama licence requires that if you use or distribute Llama or a derivative, you prominently display “Built with Llama,” include the licence text when redistributing weights, and name any Llama-derived model with “Llama” at the beginning (for example “Llama-3-MyFineTune”). It is a lightweight requirement but a mandatory one for commercial deployments.
Why does Meta release Llama for free?
Meta’s revenue comes from advertising on its products, not from selling AI model access. By making capable foundation models a free commodity, Meta prevents competitors (OpenAI, Google, Anthropic) from building a proprietary-model moat that Meta would have to pay to cross – the “platform tax” argument. Releasing Llama keeps the model layer cheap and open, which serves Meta’s strategic interest. The full strategic logic is covered in the Meta AI company profile.