← Master Index
Vol. 22 Module 22.1 Lecture

Meta (Llama, Segment Anything, Meta AI)

Frontier LLM Providers

How This Lesson Fits the Module & Volume

Closed labs (OpenAI → xAI) sell access. Meta is the center of gravity for downloadable frontier-class weights: the Llama family, plus vision Segment Anything (SAM), plus the consumer Meta AI assistant in WhatsApp/Instagram/Facebook/Ray-Ban-class surfaces. This lecture is the vendor card for engineers choosing self-host vs Meta AI vs a Llama inference host—not a new transformer derivation.

Vol. 18.4 hardware tiers matter here: Llama on Tier 1 (hosted API) vs Tier 2+ local GPUs. Module 22.5 (Hugging Face, Groq, Together, etc.) is where many teams actually serve Llama. Meta AI is a product; Llama is a weight family; SAM is a segmentation model. Do not collapse the three.

Learning Objectives

By the end of this lesson, students should be able to:

  • Separate Llama (open weights + license), SAM (vision segmentation), and Meta AI (consumer assistant).
  • Explain that Llama is not automatically OSI “open source”—read the current Meta license and acceptable use.
  • Fill a qualitative Pricing / Strengths / Weaknesses card vs closed APIs.
  • Sketch a self-host or OpenAI-compatible host call for an instruct Llama checkpoint.
  • Know when Meta AI (WhatsApp/IG) is irrelevant to a B2B backend.
  • Cross-link Vol. 11.5 Llama, Vol. 7 SAM, and Vol. 18 hardware/SDK patterns without inventing unpublished Llama internals.
Definition

Meta in this catalog means three public AI lines. Llama is Meta’s decoder-only LLM family released primarily as open weights (base + instruct, multiple sizes) under Meta’s license terms. Segment Anything (SAM / SAM 2) is Meta’s promptable image/video segmentation family—vision, not an LLM. Meta AI is Meta’s consumer assistant product embedded in Meta apps, typically powered by Llama-class models behind a closed product UX. You can self-host Llama; you cannot download “Meta AI the app.”

Three Surfaces, Three Jobs

SurfaceWhat you operateWhat you do not get
Llama weightsCheckpoints on HF / llama.com; vLLM, TGI, Ollama, cloud hostsMeta’s consumer UX, ads graph, or a guaranteed SLA from Meta
Llama API / partnersMeta and third parties also host Llama as APIsFreedom from someone’s token or GPU bill
SAM / SAM 2Masks from points, boxes, or text-ish prompts; video in SAM 2A chatbot or a diffusion generator
Meta AIEnd-user assistant in Meta apps (and some devices)A multi-tenant B2B API you control, by default

Pricing / Strengths / Weaknesses

AxisPricing (qualitative)StrengthsWeaknesses
Llama self-hostWeights: no per-token fee to Meta. You pay GPUs, electricity, eng time, or a host (Together, Fireworks, Groq, Bedrock, Azure, Vertex, …). Large Llama SKUs need serious VRAM (Vol. 18.4). Control, fine-tunes (LoRA/PEFT), data stays on your metal if you operate it; huge ecosystem; default open baseline for many teams. Ops burden; you own latency/safety/eval; license + acceptable-use still constrain some commercial cases; not “free intelligence.”
Hosted Llama APIsToken- or time-metered by the host, usually below flagship closed GPT/Claude list prices for similar size—verify live quotes, do not invent numbers. Open-weight benefits without buying H100s on day one (Tier 1). You still trust a host; SKU names and quantization variants multiply.
SAMOpen weights: GPU/CPU cost. Cloud vision APIs that wrap SAM-like models are usage-metered.Best-in-class promptable segmentation starting point; SAM 2 adds video. Not an LLM provider substitute; integration is CV engineering (Vol. 7), not chat.
Meta AI (consumer)Bundled into Meta apps / device stories—not your production invoice. Distribution: billions of consumer touchpoints; useful UX reference. Wrong procurement target for a bank’s backend; data/ToS are Meta’s consumer policies.

Pick Llama when

  • Privacy, fine-tunes, or cost at bulk volume favor self-host
  • You want an open baseline everyone can reproduce
  • Hybrid: Llama for RAG bulk, closed flagship for hard reasoning

Pick SAM when

  • Product needs masks, not paragraphs
  • Interactive annotation, editing, or video object tracking
  • You already have a CV pipeline (Vol. 7)

Skip Meta AI API dreams when

  • You need B2B contracts, VPC, and your own eval
  • WhatsApp chat is not the product surface
  • You actually needed Llama weights all along

Why Meta dominates open LLM RFPs

  • Size ladder + instruct variants + community fine-tunes
  • Works with HF, vLLM, Ollama, and Module 22.5 hosts
  • SAM is a separate world-class vision gift

Why Meta is not “fully open”

  • License/acceptable use ≠ blanket OSI
  • Training data and flagship recipe details remain limited
  • Meta AI consumer stack is closed product UX

Practical API Sketch

Two honest paths: OpenAI-compatible host (Tier 1) or local runtime. Teaching stand-ins only.

# Path A — hosted Llama (OpenAI-compatible). Swap base_url for Together/Fireworks/Groq/vLLM. # pip install openai # export LLAMA_HOST_KEY=... from openai import OpenAI client = OpenAI(api_key=__import__("os").environ["LLAMA_HOST_KEY"], base_url="https://HOST/v1") MODEL = "meta-llama/Llama-3.1-8B-Instruct" # pin the exact host SKU + quant chat = client.chat.completions.create( model=MODEL, messages=[ {"role": "system", "content": "You are a scoped RAG assistant. Cite only retrieved chunks."}, {"role": "user", "content": "When should we self-host Llama vs call GPT?"}, ], temperature=0.2, ) print(chat.choices[0].message.content) # Path B — local (Ollama / llama.cpp / vLLM). Example: ollama run llama3.1 # SAM is a separate vision stack (points → masks), not this chat client. # Meta AI in WhatsApp is not an API you authenticate with LLAMA_HOST_KEY. # Read the current Llama license before commercial deploy.

Related Lectures

LectureRole
xAI (Grok)Previous: last closed-first lab
Llama family / Open-source modelsWeight lineage vs this vendor card
SAM (Vol. 7)Segmentation model textbook
Tier 1 / later 18.4 GPU tiersHost vs self-host sizing
Hugging Face (22.5)Where Llama checkpoints actually live
Mistral AINext European open+API lab
Common Misconception

Llama = Meta AI = SAM. Three different products. Second: Llama license is always OSI MIT. Third: self-host is free (GPUs are not). Fourth: Meta AI in WhatsApp is your HIPAA backend. Fifth: SAM generates photoreal images like DALL·E. Sixth: open weights remove the need for Vol. 19 eval and Vol. 20 privacy (your logs still exist).

Knowledge Check

  1. Short Answer: Name Meta’s three AI surfaces in this lecture. Answer: Llama, Segment Anything (SAM), and Meta AI.
  2. True/False: Llama weights are always identical to OSI “open source” with no license constraints. Answer: False.
  3. Multiple Choice: SAM is primarily: (a) promptable segmentation, (b) a coding LLM, (c) a video generator like Sora. Answer: (a).
  4. Short Answer: What does self-hosting Llama actually cost? Answer: Your GPUs/ops or a third-party host—not a Meta per-token fee (unless you use a hosted Llama API).
  5. True/False: Meta AI in WhatsApp is the default B2B Llama API. Answer: False.
  6. Multiple Choice: A hybrid pattern taught here is: (a) Llama for private bulk + closed flagship for hard reasoning, (b) SAM instead of all LLMs, (c) skip eval. Answer: (a).
  7. Short Answer: Which Vol. 11.5 lecture is the Llama lineage home? Answer: Llama family.
  8. True/False: This page invents Llama token dollar prices. Answer: False.
  9. Multiple Choice: Where do many teams download Llama checkpoints? (a) Hugging Face / Meta release channels, (b) ChatGPT Plus, (c) NotebookLM. Answer: (a).
  10. Short Answer: Which provider lecture follows Meta? Answer: Mistral AI.

Key Takeaways

  • Meta’s catalog: Llama (open-weight LLMs), SAM (segmentation), Meta AI (consumer assistant).
  • Pricing posture: pay GPUs/hosts, not Meta chat seats; licenses still apply.
  • Strength: ecosystem + control. Weakness: ops, license nuance, Meta AI ≠ your API.
  • Cross-link Vol. 11.5 Llama, Vol. 7 SAM, Vol. 18 tiers, Vol. 22.5 hosts.
  • Next: Mistral AI.
Trainer’s Guide

Lab: Students pick one Vol. 21 product and decide Llama self-host vs hosted Llama vs closed GPT. Write license+AUP check, VRAM tier (18.4), and a SAM yes/no (only if the product needs masks). Optional: Ollama or a host chat spike.

Whiteboard: Closed labs | Meta (three boxes) | next open labs (Mistral, DeepSeek, Qwen, Phi).

Recap: Meta opens the open-weight half of 22.1 with Llama, SAM, and Meta AI. Next is Mistral AI.