
LLM Basics: What You Must Understand Before You Ever Touch AI Agents
If you're someone who's jumping straight into learning AI Agents and Agentic AI — stop, and read this first.
Series: My AI Journey (3 articles)
- 3LLM Basics: What You Must Understand Before You Ever Touch AI Agents This article
Software Developer
Here's the problem: if you build and learn AI agents without first understanding the basics and fundamentals of an LLM, you'll only ever use about 20% of what an agent can actually do. You only unlock the remaining 80% — the extra stuff you add when pairing an LLM with an agent — once you genuinely understand how the LLM itself works underneath.
So in this article, I'm going to go through the basic fundamentals of an LLM, covering six core areas. Let's get into it.
What Is an LLM? (And Why ChatGPT Isn't One)
A mistake a lot of people still make: calling ChatGPT, Gemini, or Claude an "LLM." They aren't. Those are just AI tools — interfaces. Behind those tools, an actual AI model runs, and that model is what we call the LLM.
Why is it called a Large Language Model? Its architecture itself is large in size, trained on terabytes of data. As it trains, the architecture and its size keep growing — which is exactly why it's called "large."
At its core, an LLM is a generative model. You give it an input, it processes that input, and it generates an output. That's its entire job. A lot of people think the LLM itself is the agent — it's not. An LLM doesn't execute tasks or chase goals on its own. It only generates.
When we talk about generation, there are four main types of input and output an LLM handles: text, image, video, and audio.
Can You Train an LLM Yourself?
Technically — can you? Do you have the capacity? You'd need serious resources: high-end GPUs and massive computational power. Modern models go through continuous training for a week or more, using clusters of GPUs — anywhere from dozens to hundreds, even thousands — running 24/7, backed by dedicated data centers constantly feeding them data. That scale is exactly why it earns the name "Large Language Model."
Open-Source vs. Closed-Source Models
There are two main types of models, and this is something enterprises ask about constantly.
Open-source works a lot like installing software — think VS Code. You download the files from the web, and you run them. Similarly, with open-source models, you download the actual model files. Where do you get them? Hugging Face. Just like Instagram and YouTube are the social platforms for general users, Hugging Face is the hub for AI engineers — community updates, new model releases, open-source files, all of it lives there. Using a Python script, you can run an open-source model locally on your own laptop, meaning your inputs and outputs never leave your machine.
Closed-source models are built by the big players — OpenAI, Anthropic (Claude), Google (Gemini). Their raw model files aren't available to download. Instead, you access them through an interface like ChatGPT or Gemini, or through an API. (Worth noting: Claude itself is the interface — behind it are the actual models, like Opus, Sonnet, Haiku.)
Because the model files stay hidden, we call these "closed." And here's the catch: when you use a closed model through an API, your request travels to their servers — meaning your data leaves your system and could potentially be logged, depending on the provider's terms.
So how do you choose between the two? It depends entirely on your organization. Running and maintaining open-source models with fast response times — say 2–3 seconds per request — needs heavy GPU infrastructure. Because of that overhead and the maintenance cost involved, a lot of companies end up signing enterprise agreements and using closed-source APIs anyway, even knowing their data goes to an external server.
Where Does an LLM Actually Fit? (GenAI vs. ML/DL)
A lot of people also get confused about which domain an LLM actually belongs to. Some "agentic developer" courses throw in machine learning and deep learning from scratch — but that's not always necessary, depending on what you're actually focused on. Decide your track first.
An LLM falls under Generative AI (GenAI). Machine Learning (ML) and Deep Learning (DL), on the other hand, are about building and training custom models from scratch for specific business use cases — this includes things like MLOps. GenAI is different: it usually doesn't build models from scratch. Instead, it takes an already pre-trained model — open-source or closed-source — and applies it to solve a business problem.
So on one side of AI, you've got ML, DL, NLP, and transformer architecture. On the other side, you've got GenAI, AI agents, agentic AI, and AI automation. These are genuinely different tracks — though Python stays a common foundational skill across all of them. Even in this era of "agentic engineering" and vibe coding, understanding the fundamentals first is still essential.
To recap this part: LLMs sit under GenAI. The underlying model architecture itself — neural networks, RNNs, and the Transformer architecture that evolved beyond RNNs — belongs to Deep Learning. You don't need heavy math to get started with GenAI, but understanding a business domain and its actual pain points is what helps you apply it well. Don't jump straight to agents. Start with AI foundations, understand LLMs properly, learn GenAI, and then move to AI agents.
What Can an LLM Actually Do?
This is where a lot of confusion lives: an LLM by itself does not execute your tasks or achieve your goals.
A generalized LLM accepts four types of input and produces four types of output — text, image, video, audio. (Embedding models are a separate category, used specifically in RAG workflows.) On its own, an LLM only generates — it can't complete a task or chase a goal by itself.
That generation ability sits under Generative AI. When the ecosystem evolved toward AI agents, frameworks started wrapping the LLM with tools, memory, and orchestration — so the agent could actually take action toward a task or goal. GenAI came first. Agents were built on top of it.
Prompt Engineering Still Matters — A Lot
What heavily influences how well an LLM performs? Prompt engineering. Some people dismiss this as a non-skill, but up to 60% or more of an agent's output quality and accuracy comes down to how well you craft its system prompt, its instructions, and its context. Frameworks like RTF (Role-Task-Format) or COT (Chain of Thought) help you structure prompts properly for specific use cases.
The Different Types of LLMs
General-Purpose Models
Just like a student's exam score reflects their performance, models get evaluated against benchmarks — reasoning benchmarks, for example. General-purpose models tend to score well across broad tasks, often somewhere around the 80% range on general benchmarks. Specialized models, by comparison, score even higher on their specific targeted benchmarks.
For coding-focused tasks specifically, specialized models can hit as high as 99% on coding/reasoning benchmarks. Models like Opus (e.g. 4.7), Sonnet, and newer releases perform strongly here — some newer models now combine strong coding benchmarks with high general-purpose reasoning.
When picking a model, match it to the benchmark relevant to your actual use case — for coding work, look at agentic terminal coding benchmarks specifically. Personally, for coding, I use Opus 4.7 — its benchmark performance is strong, and its token usage is more optimized compared to heavier models that can burn through tokens even on a simple "hi."
Multimodal Models
You can use models across tasks, but pay close attention to reasoning capability. Next up: multimodal models. A text-only model doesn't natively generate images on its own — a platform might quietly route an image request to a separate image-generation model behind the scenes, or hand video requests to a dedicated video model. A true multimodal LLM is a single model that can accept and generate across multiple modalities — text, image, video, audio — natively.
Here's a common mistake people make when building social media or content agents: leaving a text-only model configured when the workflow actually needs image generation. Matching the right model type to the actual use case matters a lot more than people realize.
Small Language Models (SLMs)
Next are Small Language Models, and this space is evolving fast. Say a large model trained on a massive text corpus has 7 billion parameters, but you only need capability tailored to one specific niche. Using a technique called knowledge distillation, you can compress and adapt that large model down into a much smaller one — say, 2 billion parameters — by training or fine-tuning adapters/tokenizers on domain-specific data. That's how you end up with an SLM.
LLM Size: Understanding Parameters
You'll often hear parameter sizes thrown around — 7B, 14B, 70B, even 320B. What are parameters, really?
In machine learning terms, model size (measured in billions of parameters) is positively correlated with accuracy — as model size goes up, accuracy generally goes up too.
How does size actually grow? Through massive training data combined with scaling the architecture — increasing the neural network's nodes and edges, or scaling components like multi-head self-attention (going, for example, from 12 attention heads in GPT-2 to far more heads in larger models). This multiplies the parameter count into the tens or hundreds of billions.
So parameters reflect architectural scale tied to training on large amounts of data. Higher parameters generally mean higher accuracy — but there's a real trade-off: running very large models locally requires heavy hardware. Model size and required compute are positively correlated, while ease of running it on modest local hardware is the opposite — it gets harder as the model grows.
Whenever you pick a high-parameter model, keep GPU requirements, maintenance, and latency in mind. Try running a huge model on an underpowered machine, and a simple "hi" might take an hour — or several hours, or even a day — to get a reply. Without proper resource allocation, it just won't perform reliably, which is exactly why a lot of companies end up opting for enterprise APIs from providers like Anthropic or OpenAI instead of self-hosting.
LLM Limitations (Know These Before You Build Anything Real)
Companies ask about this constantly in interviews, and you genuinely need to know these before building real applications.
1. Hallucination
At some point, any LLM can hallucinate — giving a fabricated or completely off-target response. It's a bit like asking someone "What is your name?" and they start talking about a trip to their hometown instead. Frameworks, guardrails, and harness engineering have reduced hallucination significantly — often pushing reliability into the 90–98% range depending on setup — but a small percentage can still slip through.
2. Incorrect Answers and Outdated Information
Every model has a knowledge cutoff date — the point where its training data stops. If a model's cutoff was in 2024 and you ask it who won the 2025 IPL without giving it any external tools, it simply won't have that data — and it might guess wrong instead of saying so. Adding external tools like web search helps feed in live data to work around this, though the model's underlying trained weights still reflect that original cutoff date.
3. Bias
This includes things like sycophancy, or "agreement bias" — where a model tends to agree with whatever the user says, even in situations where it should actually push back or correct you.
4. Inconsistency in Edge Cases
There's no guaranteed consistency in every edge case — for instance, a model can contradict itself if you ask it repeatedly whether an earlier answer was correct. Harness engineering built around the model helps catch and constrain this kind of behavior, even though the underlying limitation still exists at the model level.
5. Context Limitation
This ties directly into the context window — something worth understanding properly.
Understanding the LLM Context Window
An LLM's context window is the total token budget available for a single request. It adds up four things together:
- System instructions / system prompt — how the model should behave
- Previous conversation history
- Attached documents / PDFs
- The user's current input
All four combined need to fit within the model's context window — for example, under 1 million tokens for a 1M-token context model. If the combined tokens go over that limit, the excess content simply gets truncated. Newer models are pushing even larger windows — some up to 2 million tokens — though a typical request rarely maxes that out in practice. Because context covers system prompts, history, files, and current input all together, managing what actually goes into that window matters a lot more than people assume.
Wrapping Up
Even with huge context windows, overconfidence remains a real limitation — a model can state something with total confidence even when it's flat-out wrong. Techniques like harness engineering help mitigate a lot of these issues, but it's worth being upfront: these limitations are part of working with LLMs, not something that disappears with a bigger model.
To bring it all together — before you touch agents or agentic AI, make sure you're actually solid on:
- What an LLM is, and why it's not the same thing as an agent
- Open-source vs. closed-source models, and when each makes sense
- Where LLMs sit in the broader AI landscape (GenAI vs. ML/DL)
- The different types of LLMs — general-purpose, multimodal, and small language models
- What parameters actually represent, and the trade-off that comes with scale
- The real limitations — hallucination, outdated knowledge, bias, inconsistency, and context limits
- How the context window actually works, and what eats into it
Get these fundamentals genuinely clear, and everything downstream — agents, agentic AI, harness engineering — stops feeling like a wall of buzzwords and starts feeling like something you actually understand.
If this was useful, drop your questions in the comments — I read every one, and it genuinely helps me figure out what to cover next.
Series: My AI Journey (3 articles)
- 3LLM Basics: What You Must Understand Before You Ever Touch AI Agents This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article