Skip to content

Guide 1 of 7

Understanding LLMs, Harnesses, and Tokenomics

3 min read
The anatomy of an AI coding harnessA user prompt enters the harness, which equips the LLM with tools, file system access, and memory before executing actions.THE AGENT HARNESS (OMP / OPENCODE / CLAUDE CODE)UserPromptContext & RulesAGENTS.md / TokensTool ExecutionFiles, Bash, SearchLLM CoreToken PredictionVerifiedCode & Action

This guide gives you a simple mental model for building with AI. You will learn what a language model does, what an assistant adds around it, and why the amount of text you send affects time and cost.

You do not need a degree in machine learning to build useful software with artificial intelligence. You do need to understand which parts the model can handle and which parts still need normal software.

Here is a clear breakdown of the core concepts that power modern AI development—and the foundation for this seven-step series.

What is an LLM?

A Large Language Model (LLM) is a computer program trained on large collections of text. It finds patterns in that material and uses them to produce a likely continuation of the text you give it.

When you send text to an LLM, it does not think like a person or automatically search a live encyclopedia. It predicts what text should come next based on patterns it learned.

On its own, a raw LLM receives text and returns text. It cannot read your local computer files, run test suites, check databases, or deploy applications without additional software around it.

What is an AI harness?

This is where a harness becomes useful. An AI harness is the software around a language model that gives it tools, instructions, and a way to work through a task. In a coding project, it may let the model read files, edit them, and run checks.

Prominent examples of developer harnesses include:

  • Oh My Pi (OMP) and Pi: Terminal-first developer harnesses equipped with specialised tools for file editing, bash execution, and multi-agent delegation.
  • OpenCode: An open-source harness capable of connecting to multiple model providers simultaneously.
  • Claude Code and Codex CLI: Terminal agents built by Anthropic and OpenAI designed to inspect repositories and run command-line tools directly.

The harness usually provides four things the model cannot do by itself:

  1. Tool execution: It reads a file or runs a command when the model needs that information.
  2. Context management: It chooses which documents and conversation history to send.
  3. Instruction steering: It supplies rules, such as the instructions in an AGENTS.md file.
  4. Error handling: It returns a failed command or error message so the model can suggest a correction.

Understanding tokenomics

Every interaction with a language model is measured in tokens, which are small pieces of text. Providers use tokens to measure how much text a model reads and writes.

A token is not always a whole word. As a rough English estimate, one token may be a few characters, but the exact split depends on the text and the model.

When you use an LLM API, costs are broken down into two distinct categories:

Input tokens (what the model reads)

Every request includes the prompt, conversation history, system instructions, and any files or documents you send. Providers charge according to their current prices, so sending a large file repeatedly can increase the cost.

Output tokens (what the model generates)

The model also charges for the text it generates. A long answer uses more output tokens than a short answer.

Context window limits

Every model has a maximum context window, which represents the total volume of input and output tokens it can hold in working memory at once. If your conversation exceeds that ceiling, older parts of the conversation fall out of view. Understanding tokenomics teaches you to be selective: load only the files the model actually needs to solve the immediate task.

How prompts steer the model

A prompt is the instruction you give the model. It can include the task, background information, examples, and limits.

Prompts generally fall into two layers:

  • System prompts: Background instructions supplied by the application or harness.
  • User prompts: The specific task you provide, including constraints and the result you want.

Clear instructions reduce guesswork. For example, asking for a five-sentence reply in a friendly tone gives the model a clearer target than asking it to “make this better.”

With these foundational mechanics clear, the next step in building real tools is learning where AI belongs in your architecture, and where traditional programming remains superior.