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.
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.
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.
What a VPS actually is.
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.
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.
Ollama
A local install that pulls open-weight models and serves them behind a local API.
github.com/ollama/ollama ↗LM Studio
A desktop app for browsing and running open-weight models with a GUI before committing to one in code.
lmstudio.ai ↗llama.cpp
The inference engine underneath much of this ecosystem — runs quantized models efficiently, including CPU-only.
github.com/ggml-org/llama.cpp ↗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.
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.
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.
Prompting no weight change
Shape behavior with instructions and examples. Solves most problems before anything else is warranted.
Retrieval no retraining
Give the model access to your documents or live data at answer time. Solves "the model doesn't know my facts."
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.
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.
Give it something to do.
Planning, tools, and the authority boundaries an agent needs before it acts on its own.
Operator foundations →Keep it current.
Retrieval is what keeps answers grounded once a model can reason.
RAG & retrieval →Separate claim from evidence.
The discipline this page itself follows, explained as a lesson.
Evidence & claim boundaries →