04 Model Landscape 7 min read 1,572 words

Model Selection Guide

A practical framework for choosing the right LLM for your use case, considering capability, cost, latency, and operational factors.

model-selectioncostlatencyapplied
01framework

Selection Framework

1.1

Decision Tree (Dec 2025)

1.2

Key Selection Factors

FactorWeightConsiderations
Agentic ReliabilityHighTool-calling accuracy, multi-step planning
Context RecallHighNeedle-in-a-haystack performance at 1M+
Rate Limit CeilingHigh(Principal Nuance): Can the provider handle your P99 throughput without 429 errors?
Ecosystem MaturityHighProduction track record, SDK support, and Enterprise SLA
Cost / Output TokenMediumAgentic loops consume 5x-10x more tokens
02comparison

Capability Comparison

2.1

Frontier Model Comparison (December 2025)

ModelStrengthsConsContextBest For
GPT-5.2Agentic planning, native omniHigh cost512KMulti-agent systems
Claude 4.5 OpusSoTA Software EngineeringExpensive400KComplex codebases
Claude Sonnet 4.5Hybrid Reasoning depthHigh peak latency200KGeneral production
Gemini 3.0 Pro2.5M context, multimodalLatency spikes2.5MLarge data ingestion
o3Extreme logic/reasoningHigh cost/latency128KMath, complex debug
2.2

Budget Model Comparison

ModelCost (per 1M input/output)QualityContextBest For
Gemini 3 Flash$0.05 / $0.20Frontier-tier1MHigh-volume RAG
o4-mini$0.10 / $0.40Excellent128KFast reasoning tasks
Llama 4 8BSelf-hosted (H100/L40)Strong128KOn-device, private
2.3

Open Source Models

ModelParametersQualityBest For
Llama 4 70B70BFrontier-competitiveUniversal open choice
Nemotron 3 Ultra500B MoEAgentic masteryScalable open agents
DeepSeek V3.2671B MoEUltra performanceLowest TCO for frontier quality
03case mapping

Use Case Mapping

3.1

By Application Type (Dec 2025)

Use CaseRecommended ModelsRationale
Autonomous DevClaude 4.5 Opus, Claude Sonnet 4.5"Claude Code" agentic mastery & verified coding
Enterprise RAGGemini 3.0 Pro, Gemini 3 Flash2.5M context removes retrieval complexity
customer SupportGemini 3 Flash, GPT-5.2-miniNear-zero latency with strong reasoning
Reasoning / Debugo3, DeepSeek-R1Best at "Thinking" mode for code/logic
Video/MultimodalGemini 3.0 Pro, GPT-5.2Native interleaved multimodal processing
Private AgentLlama 4 70B, Nemotron 3Strongest open-weight agentic planning
3.2

By Constraint

ConstraintApproach
Max latency < 100msGemini 3 Flash, o4-mini, or self-hosted Nano models
Context > 1M tokensGemini 3.0 Pro (native 2.5M)
Zero-data LeakageLlama 4 70B on internal VPC
Complex Tool UseClaude 4.5 Opus or GPT-5.2 (best planning accuracy)
04analysis

Cost Analysis

4.1

Cost Modeling (Dec 2025)

ModelInput / 1MOutput / 1MNotes
GPT-5.2$5.00$20.00Agentic premium
Claude 4.5 Opus$15.00$75.00Specialized engineering
Claude Sonnet 4.5$3.00$15.00Balanced choice
Gemini 3.0 Pro$1.25$5.00Best value frontier
Gemini 3 Flash$0.05$0.20RAG-at-scale winner
o4-mini$0.10$0.40Logic-on-a-budget
4.2

Cost Comparison Example

Assume 1M queries/month, 1K input tokens + 500 output tokens per query:

VolumeGPT-5.2Claude SonnetGemini 3 ProGemini 3 Flash
10K queries/mo$150$105$37.50$1.50
1M queries/mo$15,000$10,500$3,750$150

2025 Insight: Gemini 3 Flash has effectively commoditized RAG, making long-context processing cheaper than traditional vector search infra at scale.

05considerations

Operational Considerations

5.1

Rate Limits and Quotas

ProviderTierRPMTPM
OpenAI (Tier 1)Basic50030K
OpenAI (Tier 5)Enterprise10K10M
Anthropic (Tier 1)Basic5040K
Anthropic (Tier 4)Enterprise4K400K
5.2

Reliability Patterns

Pythonpython · 18 lines
123456789101112131415161718
class ReliableModelClient:
    def __init__(self):
        self.providers = {
            "primary": OpenAIClient(),
            "fallback1": AnthropicClient(),
            "fallback2": GoogleClient()
        }
    
    async def generate(self, prompt: str) -> str:
        for name, client in self.providers.items():
            try:
                return await client.generate(prompt)
            except RateLimitError:
                continue
            except ServiceError:
                continue
        
        raise AllProvidersUnavailable()
5.3

Abstraction Layer

Pythonpython · 29 lines
1234567891011121314151617181920212223242526272829
class LLMClient:
    """Unified interface for multiple providers."""
    
    def __init__(self, config: dict):
        self.default_model = config["default_model"]
        self.clients = self._init_clients(config)
    
    async def generate(
        self,
        messages: list[dict],
        model: str = None,
        **kwargs
    ) -> str:
        model = model or self.default_model
        client = self._get_client(model)
        
        # Normalize request format
        normalized = self._normalize_request(messages, kwargs)
        
        # Call provider
        response = await client.generate(**normalized)
        
        # Normalize response
        return self._normalize_response(response)
    
    def _normalize_request(self, messages: list[dict], kwargs: dict) -> dict:
        # Handle differences between providers
        # OpenAI uses 'messages', Anthropic uses 'messages' with different format
        pass
06strategies

Multi-Model Strategies

6.1

Model Routing

Pythonpython · 20 lines
1234567891011121314151617181920
class ModelRouter:
    def __init__(self):
        self.classifier = QueryClassifier()
        self.models = {
            "simple": "gpt-4o-mini",
            "complex": "claude-3.5-sonnet",
            "code": "claude-3.5-sonnet",
            "long_context": "gemini-1.5-pro",
            "reasoning": "o1-mini"
        }
    
    async def route(self, query: str, context_length: int) -> str:
        # Classify query complexity
        query_type = await self.classifier.classify(query)
        
        # Override for long context
        if context_length > 100_000:
            return self.models["long_context"]
        
        return self.models[query_type]
6.2

Cascade Pattern (2025 Refinement)

The Logic: Never use a 70B model for a task a 1B model can do. Use a "Router" to score confidence.

Pythonpython · 16 lines
12345678910111213141516
class ModelCascade:
    """The 'Efficiency First' Pattern."""
    
    async def generate_optimized(self, query: str):
        # 1. Draft check (SLM / Classifier)
        if is_simple_intent(query):
            return await gpt4o_mini.generate(query)
            
        # 2. Main Generation (Efficient model)
        response = await claude_sonnet.generate(query)
        
        # 3. Validation / Escalate
        if needs_verification(response):
            return await o3.generate(f"Verify this: {response}")
            
        return response

Principal-level Tip: Implement "Semantic Fallback" where you don't just retry the same model on error, but immediately jump to a larger model or a different provider (OpenAI -> Anthropic) to avoid correlated failures.

07questions

Interview Questions

Q: How do you choose between GPT-4o, Claude, and Gemini for a production application?

Strong answer:

"My selection depends on specific requirements:

For most production workloads, I default to Claude 3.5 Sonnet or GPT-4o. Both are excellent general-purpose models. Sonnet has a slight edge on coding, GPT-4o has better ecosystem integration.

For long-context applications, Gemini 1.5 Pro is the clear winner with 1-2 million token context. If I need to process entire codebases or very long documents, Gemini is my choice.

For cost-sensitive high-volume, GPT-4o-mini or Claude Haiku. These are 10-20x cheaper and handle straightforward tasks well.

My practical approach:

  1. Prototype with Sonnet or GPT-4o to validate the use case
  2. Evaluate on MY specific task, not just benchmarks
  3. Build abstraction layer so I can switch easily
  4. Optimize costs by routing simpler requests to cheaper models

I never rely solely on benchmark scores. A model that ranks lower on MMLU might excel on my domain."

Q: When would you self-host vs use API providers?

Strong answer:

"It is a tradeoff of control vs operational burden.

Use APIs when:

  • Volume under 1M queries/month (cost crossover)
  • Need latest models immediately
  • Team lacks GPU infrastructure expertise
  • Variable workload hard to capacity plan
  • Time-to-market is critical

Self-host when:

  • Data cannot leave infrastructure (compliance)
  • Volume exceeds 10M queries/month (cost savings)
  • Need latency under 100ms P99
  • Need custom model weights or fine-tuning
  • Full control over model behavior

Hybrid often works best:

  • Self-host for high-volume predictable workloads
  • API for spikes and specialized models
  • API as fallback when self-hosted fails

Hidden costs of self-hosting: GPU procurement, engineering time, model updates, monitoring. Factor in 1-2 dedicated engineers for infrastructure."

08references

References


Next: Fine-Tuning Guide

summary · added by this rebuild

Key takeaways

01

Rate limits belong in the selection matrix

Provider throughput ceilings are weighted high alongside capability: Anthropic Tier 1 allows 50 RPM and 40K TPM against OpenAI Tier 5's 10K RPM and 10M TPM.

02

Cost gaps span two orders of magnitude

At one million queries a month with 1K in and 500 out, the same workload costs $15,000 on GPT-5.2, $3,750 on Gemini 3 Pro and $150 on Gemini 3 Flash.

03

Cascade before optimising anything else

Route simple intents to a small model, keep an efficient mid-tier as the default, and escalate to a reasoning model only when a verification check demands it.

04

Self-hosting pays off above steady volume

The stated break-even is near 500 million tokens a month for a 70B-tier model, and only when traffic is constant rather than concentrated in business hours.

05

Fail over across providers, not retries

Retrying the same model repeats correlated failures; the reliability client walks primary to fallback1 to fallback2 across OpenAI, Anthropic and Google before raising.