Chapter 3: The LLM Landscape Today
Introduction
The LLM landscape has evolved rapidly since 2020, with major technology companies, research labs, and open-source communities all contributing to an increasingly diverse ecosystem. This chapter surveys the key players and their offerings.
Major LLM Providers
OpenAI
The company that sparked the modern LLM revolution.
Key Models:
| Model | Release | Context | Capabilities |
|---|---|---|---|
| GPT-3.5 | 2022 | 4K/16K | Chat, code, reasoning |
| GPT-4 | 2023 | 8K/32K/128K | Multimodal, advanced reasoning |
| GPT-4o | 2024 | 128K | Optimized, faster |
Strengths:
- Industry-leading capabilities
- Extensive API ecosystem
- Continuous improvements
Considerations:
- Proprietary/closed weights
- Usage costs
- API dependency
# OpenAI API example
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain transformers in one sentence."}
]
)
print(response.choices[0].message.content)
Anthropic
Founded by former OpenAI researchers, focused on AI safety.
Key Models:
| Model | Release | Context | Capabilities |
|---|---|---|---|
| Claude 2 | 2023 | 100K | Long context, safety |
| Claude 3 Haiku | 2024 | 200K | Fast, efficient |
| Claude 3 Sonnet | 2024 | 200K | Balanced |
| Claude 3 Opus | 2024 | 200K | Most capable |
Differentiators:
- Constitutional AI approach
- Exceptional safety alignment
- Very long context windows
# Anthropic API example
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-3-sonnet-20240229",
max_tokens=1024,
messages=[
{"role": "user", "content": "What is Constitutional AI?"}
]
)
print(message.content)
Google DeepMind
Combining Google Brain and DeepMind's expertise.
Key Models:
| Model | Release | Context | Capabilities |
|---|---|---|---|
| PaLM 2 | 2023 | 8K-32K | Multilingual, reasoning |
| Gemini Pro | 2023 | 32K | Multimodal |
| Gemini Ultra | 2024 | 32K+ | Frontier capabilities |
| Gemini 1.5 | 2024 | 1M+ | Extreme context |
Strengths:
- Massive compute resources
- Multimodal from the ground up
- Integration with Google services
Meta AI
Leader in open-source LLM development.
Key Models:
| Model | Release | Parameters | License |
|---|---|---|---|
| Llama | 2023 | 7B-65B | Research only |
| Llama 2 | 2023 | 7B-70B | Commercial |
| Llama 3 | 2024 | 8B-70B+ | Commercial |
| Code Llama | 2023 | 7B-34B | Commercial |
Impact:
- Democratized LLM access
- Enabled fine-tuning ecosystem
- Competitive with closed models
Open-Source Ecosystem
The Open-Source Movement
Open-source LLMs have grown from research curiosities to production-ready alternatives:
2020: GPT-2 released (1.5B)
2022: BLOOM released (176B) - First open 100B+ model
2023: Llama leak → community explosion
2023: Mistral 7B matches GPT-3.5 on some benchmarks
2024: Open models approach GPT-4 on many tasks
Key Open Models
Mistral AI:
# Mistral model sizes
mistral_models = {
"Mistral-7B": {
"params": "7B",
"context": 8192,
"specialty": "General purpose, efficient"
},
"Mixtral-8x7B": {
"params": "46.7B (12.9B active)",
"context": 32768,
"specialty": "Mixture of Experts"
},
"Mistral Large": {
"params": "Unknown",
"context": 32768,
"specialty": "Frontier model"
}
}
Other Notable Open Models:
| Model | Organization | Parameters | Specialty |
|---|---|---|---|
| Falcon | TII | 7B-180B | Multilingual |
| MPT | MosaicML | 7B-30B | Commercial-friendly |
| Qwen | Alibaba | 7B-72B | Multilingual (Chinese) |
| Yi | 01.AI | 6B-34B | Efficient architecture |
| Phi | Microsoft | 1.3B-3B | Small but capable |
Hugging Face Hub
The central repository for open models:
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load any model from the Hub
model_name = "mistralai/Mistral-7B-Instruct-v0.2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Generate text
inputs = tokenizer("Explain LLMs:", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))
Open vs. Closed: Trade-offs
Closed/Proprietary Models
Advantages:
- ✅ Highest capability (usually)
- ✅ Simple API access
- ✅ No infrastructure needed
- ✅ Regular updates
Disadvantages:
- ❌ No fine-tuning control
- ❌ Usage costs
- ❌ Data privacy concerns
- ❌ Vendor lock-in
Open-Weight Models
Advantages:
- ✅ Full control
- ✅ Local/private deployment
- ✅ Custom fine-tuning
- ✅ No per-token costs
Disadvantages:
- ❌ Infrastructure required
- ❌ Usually lower capability
- ❌ Self-managed updates
- ❌ Technical expertise needed
Decision Framework
def choose_model_type(requirements):
if requirements.get("max_capability"):
return "Closed (GPT-4, Claude 3 Opus)"
if requirements.get("data_privacy") or requirements.get("custom_training"):
return "Open (Llama, Mistral)"
if requirements.get("low_latency") and requirements.get("high_volume"):
return "Open (self-hosted)"
if requirements.get("quick_prototype"):
return "Closed (any major API)"
return "Evaluate both options"
Specialized Models
Code-Focused Models
| Model | Source | Capabilities |
|---|---|---|
| Code Llama | Meta | Code completion, infilling |
| StarCoder | BigCode | Code generation |
| DeepSeek Coder | DeepSeek | Multi-language coding |
| Copilot | GitHub/OpenAI | IDE integration |
Domain-Specific Models
| Domain | Example Models |
|---|---|
| Medical | Med-PaLM, BioMistral |
| Legal | Legal-BERT derivatives |
| Finance | BloombergGPT, FinGPT |
| Scientific | Galactica, SciBERT |
Market Dynamics
Pricing Trends
# Approximate pricing (per 1M tokens, as of 2024)
pricing = {
"GPT-4 (8K)": {"input": "$30", "output": "$60"},
"GPT-4 Turbo": {"input": "$10", "output": "$30"},
"GPT-3.5 Turbo": {"input": "$0.50", "output": "$1.50"},
"Claude 3 Opus": {"input": "$15", "output": "$75"},
"Claude 3 Sonnet": {"input": "$3", "output": "$15"},
"Claude 3 Haiku": {"input": "$0.25", "output": "$1.25"},
"Mistral Large": {"input": "$8", "output": "$24"},
"Open Models": "Infrastructure costs only",
}
Competition Impact
The competitive landscape has driven:
- Rapid capability improvements
- Falling prices (GPT-4 Turbo 3x cheaper than GPT-4)
- Longer context windows (4K → 128K → 1M+)
- Better open alternatives
Choosing the Right Model
Evaluation Criteria
criteria = {
"capability": "How well does it perform on your tasks?",
"cost": "Per-token pricing or infrastructure costs",
"latency": "Response time requirements",
"context": "How much text do you need to process?",
"privacy": "Can data leave your environment?",
"customization": "Do you need fine-tuning?",
"reliability": "Uptime and consistency requirements",
}
Benchmarking Your Use Case
Always test on YOUR specific use case:
def evaluate_model(model, test_cases):
results = []
for case in test_cases:
response = model.generate(case["prompt"])
score = evaluate_response(response, case["expected"])
results.append({
"case": case["name"],
"score": score,
"latency": response.latency,
"tokens": response.token_count
})
return aggregate_results(results)
Future Trends
What to Watch
- Continued scaling - Models getting larger and more capable
- Efficiency improvements - Smaller models matching larger ones
- Multimodality - Text, images, audio, video in one model
- Specialization - Domain-specific models proliferating
- Open-source parity - Closing the gap with closed models
Key Takeaways
- OpenAI, Anthropic, Google, Meta are the major players
- Open-source models are increasingly competitive
- Trade-offs exist between capability, control, and cost
- Specialized models serve specific domains
- The landscape evolves rapidly - stay current
Looking Ahead
Now that we understand the LLM landscape, we're ready to dive deeper into the architecture that powers these models. Module 2 will explore the Transformer architecture in detail, starting with the attention mechanism.