Module 1: Decision Framework for LLM Access

The Options Landscape 2024-2026: LLM Access Providers

Capsule overview

Before choosing, you need to know WHAT options exist in the current market (2024-2026).

This capsule gives you a complete landscape of the 5 main options for accessing LLMs: OpenAI API, LM Studio, Ollama, OpenRouter, and Modal. You won't go into technical depth (that's modules 2-6), but you'll understand the main features, when to use each one, and the basic trade-offs.

By the end, you'll be able to answer: "What options do I have available, and which is the best initial fit for my project?"


🎯 The 5 Main Options

Option 1: OpenAI API (Standard Cloud)

What is it? A REST API in the cloud that gives access to GPT models (GPT-3.5, GPT-4, GPT-4-turbo).

Features:

  • Managed service (infrastructure managed by OpenAI)
  • State-of-the-art models (maximum quality)
  • Official SDK in Python, Node.js, etc.
  • Pay-per-use ($/token)

Trade-offs:

  • ✅ Maximum quality (GPT-4 leads the benchmarks)
  • ✅ Maximum simplicity (setup <1 hour)
  • ✅ Good speed (1-3s latency)
  • ⚠️ Medium cost ($0.002-0.03/1k tokens depending on the model)
  • ⚠️ Medium privacy (data goes to the cloud, 30-day retention)

When to use:

  • You need maximum quality (GPT-4)
  • A team without DevOps skills
  • Tight timeline (<1 week for an MVP)
  • Data that is NOT privacy-critical

When NOT to use:

  • Sensitive data (medical, financial, legal)
  • Prohibitive cost at scale (millions of queries/day)
  • Mandatory on-premise requirements

Full module: Module 2 covers setup, pricing, best practices, and your first chatbot.


Option 2: LM Studio (Local GUI)

What is it? A desktop application (Mac/Windows/Linux) for running LLM models locally with a graphical interface.

Features:

  • Intuitive GUI (point & click)
  • Download models with 1 click (Mistral 7B, Llama 2, etc.)
  • OpenAI-compatible API (drop-in replacement)
  • 100% local (data NEVER leaves your machine)
  • Free (open source)

Trade-offs:

  • ✅ Maximum privacy (on-premise)
  • ✅ Zero cost (hardware only)
  • ✅ High simplicity (friendly GUI)
  • ⚠️ Medium quality (Mistral 7B ~80% of GPT-3.5)
  • ⚠️ Variable speed (depends on your hardware)
  • ⚠️ Low scalability (your laptop has limits)

When to use:

  • Local development (before production)
  • Side projects with no budget
  • Learning about LLMs without API keys
  • Prototypes with sensitive data

When NOT to use:

  • Production with multiple users
  • You need maximum quality (GPT-4 level)
  • You don't have decent hardware (min 16GB RAM)

Full module: Module 3 covers installation, downloading models, the local API, and your first chatbot.


Option 3: Ollama (Local CLI)

What is it? A command-line tool for running LLM models locally, optimized for production.

Features:

  • Professional CLI (no GUI)
  • Model management (pull, list, run, remove)
  • OpenAI-compatible REST API
  • Docker support (containerization)
  • Optimized for servers (not just laptops)
  • Free (open source)

Trade-offs:

  • ✅ Maximum privacy (100% local)
  • ✅ Zero cost (operational)
  • ✅ Production-ready (Docker, APIs, scaling)
  • ⚠️ Medium-high complexity (CLI, Linux, networking)
  • ⚠️ Medium quality (7B-70B models)
  • ⚠️ Requires hardware (GPU for speed)

When to use:

  • On-premise production (critical privacy)
  • Scalability with a cluster (multiple nodes)
  • A team with DevOps skills
  • High volume (millions of queries/month) where the OpenAI cost is prohibitive

When NOT to use:

  • A junior team without CLI/Docker
  • Tight timeline (<2 weeks)
  • You don't have server hardware

Difference vs LM Studio:

  • LM Studio: GUI, laptop, development
  • Ollama: CLI, server, production

Full module: Module 4 covers installation, model management, the REST API, and Docker deployment.


Option 4: OpenRouter (Multi-Provider Aggregator)

What is it? An aggregator API that gives access to 100+ models from multiple providers (OpenAI, Anthropic, Google, Meta, Mistral, etc.) with a single API key.

Features:

  • Unified API (OpenAI SDK compatible)
  • 100+ models (GPT-4, Claude 3, Gemini, Llama, Mixtral)
  • Cost optimization (pick the cheapest model)
  • Automatic fallback (if a model fails, it tries another)
  • Pay-per-use (variable by model)

Trade-offs:

  • ✅ Maximum flexibility (change models without code)
  • ✅ Optimizable cost ($0.001-0.03 depending on the model)
  • ✅ Built-in fallback (high reliability)
  • ⚠️ Middleman (OpenRouter between you and the model)
  • ⚠️ Latency +100-200ms (vs the provider directly)
  • ⚠️ Variable privacy (depends on the model)

When to use:

  • You need flexibility (experiment with multiple models)
  • You want cost optimization (use GPT-4 only when needed, else Mixtral)
  • You want high availability (automatic fallback)
  • Avoiding vendor lock-in

When NOT to use:

  • Critical latency (<1s strict) - the middleman adds delay
  • Critical privacy (data passes through OpenRouter on some models)
  • You only ever need 1 model (OpenAI directly is simpler)

Full module: Module 5 covers setup, model switching, cost comparison, and fallback strategies.


Option 5: Modal (Serverless Deployment)

What is it? A serverless platform for running Python code in the cloud with GPUs, specialized in ML/AI workloads.

Features:

  • Serverless (you don't manage servers)
  • Autoscaling (0 → 1000 instances in seconds)
  • GPU on-demand (automatic provisioning)
  • Pay-per-use (you only pay when it runs)
  • Python decorators (familiar code)

Trade-offs:

  • ✅ Automatic scalability (variable traffic)
  • ✅ Optimized cost (you don't pay for idle time)
  • ✅ No infra management (Modal handles everything)
  • ⚠️ Medium complexity (decorators, async)
  • ⚠️ Cold starts (first request ~3-5s)
  • ⚠️ Variable cost (hard to predict with spikes)

When to use:

  • Variable traffic (unpredictable spikes)
  • You don't want to manage servers
  • A mid-level team with Python but no DevOps
  • You need GPUs but don't want to buy them

When NOT to use:

  • Ultra-limited budget (pay-per-use can surprise you)
  • Strict critical latency (cold starts ~3-5s)
  • A junior team (Modal's learning curve)

Full module: Module 6 covers Modal setup, deploying a function, autoscaling, and the cost model.


📊 Quick Comparison

Comparison table:

FeatureOpenAI APILM StudioOllamaOpenRouterModal
TypeCloud APILocal GUILocal CLIAggregatorServerless
Setup<1 hr<30 min2-4 hrs<1 hr1-2 hrs
Cost$0.002-0.03/1k$0$0Variable$0.000185/s GPU
QualityHigh (GPT-4)MediumMediumVariableMedium-High
PrivacyMediumMaximumMaximumVariableMedium
Speed1-3s5-15s5-10s2-4s1-2s (warm)
ScalabilityAutoNoManualAutoAuto
SkillsBasic PythonNoneDevOpsBasic PythonMid Python

🎯 Quick Decision Map

Question 1: Sensitive data (on-premise mandatory)?

YES → Ollama or LM Studio

  • Ollama if: Production, senior team
  • LM Studio if: Development, prototype

NO → Continue to question 2


Question 2: Do you need maximum quality (GPT-4 level)?

YES → OpenAI API or OpenRouter

  • OpenAI directly if: Only GPT-4, no flexibility
  • OpenRouter if: You want to be able to change later

NO → Continue to question 3


Question 3: Is the budget $0-100/month?

YES → Local Ollama or OpenRouter (cheap models)

  • Ollama if: You have hardware and skills
  • OpenRouter if: You want simplicity

NO → Continue to question 4


Question 4: Variable traffic with large spikes?

YES → Modal serverless or OpenAI API

  • Modal if: Mid-senior team, cost optimization matters
  • OpenAI if: Junior team, simplicity is critical

NO → Any option works, use tie-breaker criteria


📝 Exercise: Identify the Best Option

For each scenario, identify which option is best:

Scenario 1:

  • Personal side project
  • 50 users/month
  • Public data (meme generator)
  • Budget: $0

Answer: _________ because _________

See the answer

Answer: LM Studio (or Ollama)

Why:

  • Budget $0 → Only free local options
  • 50 users → Extremely low volume, a laptop can handle it
  • Side project → LM Studio's GUI is friendlier
  • Public data → Privacy is not a factor

Ollama also works, but LM Studio is simpler for a side project.


Scenario 2:

  • Enterprise with 500k users/day
  • Sentiment analysis on reviews
  • Budget: $50k/month
  • Senior DevOps team (20 people)

Answer: _________ because _________

See the answer

Answer: Local Ollama (with a GPU cluster)

Why:

  • 500k users/day × 2 queries × 200 tokens = 6B tokens/month
  • OpenAI cost: 6B × $0.002/1k = $12k/month ✅ (within budget)
  • BUT Ollama is better because:
    • Cost over 12 months: Ollama ($50k hardware, then $0) vs OpenAI ($144k/year)
    • A senior team can maintain the cluster
    • Sentiment analysis does NOT need GPT-4 (Mixtral 8x7B is enough)

The OpenAI API is also valid if they want simplicity > savings.


Scenario 3:

  • Startup validating an idea
  • 100 beta users
  • Timeline: 2 weeks for a demo
  • Budget: $200/month

Answer: _________ because _________

See the answer

Answer: OpenAI API

Why:

  • Critical timeline (2 weeks) → Simplicity is #1
  • 100 users: ~$5-10/month (well within budget)
  • Demo stage: Quality matters (GPT-3.5 is enough)
  • The team can focus on the product, not the infrastructure

After validating the idea, they can migrate to Ollama if they scale.


🔄 Evolution of the Ecosystem

2020-2021: The OpenAI-exclusive era

  • Only the OpenAI API was commercially available
  • GPT-3 was practically the only option
  • Cost: $0.02/1k tokens (20x more expensive than today)

2022-2023: The explosion of alternatives

  • Anthropic launches Claude
  • Meta releases Llama 2 (open source)
  • Hugging Face Inference API
  • Replicate for open-source models

2024-2026: Maturity and consolidation

  • Aggregators: OpenRouter, Together AI (unified access)
  • Local tools: Ollama, LM Studio (improved UX)
  • Serverless: Modal, Replicate (deploy without DevOps)
  • Price wars: GPT-3.5 dropped 10x ($0.02 → $0.002)

Key trend: Democratization (free, local, and serverless options become accessible)


📊 Summary

Key concepts:

  1. 5 main options in 2024-2026:

    • OpenAI API (standard cloud, maximum quality)
    • LM Studio (local GUI, development)
    • Ollama (local CLI, production)
    • OpenRouter (aggregator, flexibility)
    • Modal (serverless, autoscaling)
  2. There is no universal "best":

    • OpenAI: Best for quality + simplicity
    • Ollama: Best for privacy + zero cost
    • OpenRouter: Best for flexibility
    • Modal: Best for variable scalability
  3. The ecosystem evolved fast:

    • 2020: Only OpenAI ($$$)
    • 2026: 5+ options (including free)
  4. The next modules cover implementation:

    • Module 2: OpenAI API (cloud)
    • Module 3: LM Studio (local GUI)
    • Module 4: Ollama (local CLI)
    • Module 5: OpenRouter (aggregator)
    • Module 6: Modal (serverless)

🔗 Additional resources

  1. OpenAI Platform - Official docs
  2. LM Studio Download - GUI application
  3. Ollama - Official CLI tool
  4. OpenRouter - Multi-provider aggregator
  5. Modal - Serverless platform
  6. LLM Landscape 2024 - Andreessen Horowitz report

➡️ Next step

Next capsule: 04-the-decision-matrix.md

Now that you know the 5 main options, you'll learn to apply the decision matrix that maps specific requirements to recommended providers.

You'll see 7 common cases (Privacy+Cost, Quality+Speed, etc.) with a justified recommendation for each one.


Reading time: 8-10 minutes
Next: 04-the-decision-matrix.md