AI Mastery / Guides / Train Your Agent Playbook
GUIDE · MODEL SYSTEMS

How to train your agent, before it trains you.

A decision guide for a first agent build: which model class fits the task, where it should run, and what "training" actually means at each layer — sourced against each tool's own documentation, not a vendor ranking.

Published 2026-08-30 Owner: Mason Nguyen Educational — not a hosting or vendor recommendation for your specific workload

Three decisions sit upstream of everything else.

Most first agents fail before a single prompt goes wrong — because nobody decided what class of model the job needed, where it should run, or how it reaches current information. Prompts, tools, and guardrails are craft you layer on afterward. Model class, hosting, and access method are the load-bearing decisions.

LLM vs. SLM: pick the weight class for the job.

"AI model" is not one thing. A large language model and a small language model solve different problems at different costs — the first choice is matching the class to the task, not defaulting to the biggest name available.

Large language model
Small language model
Size classRoughly 7B–400B+ parameters
Size classRoughly 1B–8B parameters
StrengthBroad reasoning, open-ended tasks
StrengthSpeed, low cost, easy to fine-tune
Typically runs onCloud GPUs, hosted APIs
Typically runs onLaptops, consumer GPUs, edge devices
Cost profilePer-token billing or serious hardware
Cost profileNear-zero marginal cost once running
Weak pointLatency and cost on narrow, repeated jobs
Weak pointNarrower reasoning outside its tuned task

General heuristic, not a benchmark claim: a small model fine-tuned for one repeatable job — classifying, extracting, routing — will often beat a general-purpose large model on speed and cost for that job. A large model earns its size when the task is genuinely open-ended.

Local, rented, or managed — three routes, different jobs.

Once the model class is set, decide where it lives. None of these is the correct answer by default; each fits a different constraint.

Local machine
Learning, privacy-sensitive data, offline work, small models
Fits SLMs well
A rented VPS
Always-on agents, models too large for a personal machine
Budget it monthly
Managed API
Shipping fast, frontier reasoning, no infrastructure appetite
Fastest to working
Training a new base model
Research labs and funded teams building foundation models
Not a first move

What a VPS actually is.

Plain definition

An isolated slice of a shared physical server, rented monthly, with its own operating system.

A provider owns racks of physical machines and partitions each into virtual machines. Renting one gives you your own OS, storage, and open ports — a private computer inside someone else's data center, running whether or not your laptop is open. Commonly used providers for general-purpose boxes: DigitalOcean, Hetzner, Linode/Akamai, Vultr. For a rented GPU specifically, see RunPod, Lambda, or Paperspace.

Before renting, confirm the model you plan to run fits the VRAM or RAM the plan actually offers. A quantized 7B model and a raw 70B model need very different boxes — undersizing is the most common first mistake.

Running open weights on your own machine.

Open weights means a model's trained parameters are published for local download — no API key, no per-token bill, no dependency on a remote server staying online. It's a reasonable place to start: mistakes are cheap and the feedback loop is immediate.

Easiest entry

Ollama

A local install that pulls open-weight models and serves them behind a local API.

github.com/ollama/ollama ↗
Visual comparison

LM Studio

A desktop app for browsing and running open-weight models with a GUI before committing to one in code.

lmstudio.ai ↗
Maximum control

llama.cpp

The inference engine underneath much of this ecosystem — runs quantized models efficiently, including CPU-only.

github.com/ggml-org/llama.cpp ↗
Production serving

vLLM

Built for throughput — the tool for a model that needs to serve real traffic on a VPS or GPU box.

github.com/vllm-project/vllm ↗

OpenRouter and Perplexity solve different problems.

Model routing

OpenRouter — one API in front of many model providers.

A single integration point across models from different labs, useful for comparing models or avoiding lock-in to one provider's pricing and uptime.

Retrieval & answers, not a model host

Perplexity — a model paired with live web search.

Built to produce cited, current answers. A research and citation-pattern reference — not infrastructure to deploy your own agent on top of. See this site's RAG & Retrieval domain for the underlying pattern.

"Training" is four different methods, not one.

Climb only as high as the task requires.

01

Prompting no weight change

Shape behavior with instructions and examples. Solves most problems before anything else is warranted.

02

Retrieval no retraining

Give the model access to your documents or live data at answer time. Solves "the model doesn't know my facts."

03

Fine-tuning real infrastructure cost

Adjust weights on a task-specific dataset. Right for narrowing style or format on a repeated job — often most cost-effective on an SLM.

04

Pretraining frontier-lab scale

Training a base model from scratch. Almost nobody building a first agent needs this step.

Common questions on this decision.

What is the difference between an LLM and an SLM?

A large language model (roughly 7B–400B+ parameters) is built for broad reasoning and typically runs on cloud GPUs or a hosted API. A small language model (roughly 1B–8B parameters) is built for narrower, repeatable tasks and can run on a laptop or consumer GPU at much lower cost.

What is a VPS, in plain terms?

An isolated slice of a physical server, rented monthly, with its own operating system and open ports — like a private computer in a data center that stays on regardless of your own device.

Should I run a model locally or rent a VPS?

Local suits learning, privacy-sensitive work, offline use, and small models. A VPS suits an agent that must stay online continuously, or a model too large for a personal machine. The right answer depends on model size, uptime needs, and budget — not a universal rule.

What does "training an agent" actually mean?

Most people mean one of four distinct methods: prompting, retrieval, fine-tuning, or pretraining. Most first agents only need the first two.

What's the difference between OpenRouter and Perplexity?

OpenRouter is a routing layer providing one API across many model providers. Perplexity is a retrieval-and-answer product pairing a model with live web search — a research tool, not model-hosting infrastructure.

Where this connects on AI Mastery.

This guide sits at Layer 01, Model Systems — the knowledge index domain with no dedicated learning pathway yet. Once a model is chosen and running, these are the adjacent rooms.

Layer 03 · Agentic compute

Give it something to do.

Planning, tools, and the authority boundaries an agent needs before it acts on its own.

Operator foundations →
Layer 02 · Knowledge

Keep it current.

Retrieval is what keeps answers grounded once a model can reason.

RAG & retrieval →
Layer 09 · Trust

Separate claim from evidence.

The discipline this page itself follows, explained as a lesson.

Evidence & claim boundaries →