Guides
Guides for building with AI
Plain-English explanations of the things that decide what AI costs and how well it works: tokens, context, caching, models and agents. Every number is measured or sourced, and each guide links to a free tool so you can check it with your own data.
Tokens & costs
- AI tokens explained: what a token is, how it is counted, and what it costsAI tokens explained with real examples: how LLMs split text into tokens, how counts are calculated, and why tokens set your API cost and context limit.10 min ·
- How to calculate LLM API costs: the formula, worked examples and the trapsHow to calculate LLM API cost per request and per month: the token formula, worked examples for chatbots, RAG and agents, plus caching, batch and reasoning.12 min ·
- The cheapest LLM APIs right now, ranked from daily price dataThe cheapest LLM APIs ranked by blended price from daily data, the cheapest for tools, vision and long context, free tiers, and how to cut cost per task.12 min ·
- Prompt caching explained: how it works on OpenAI, Anthropic and Gemini, and when it paysPrompt caching explained: how it works on OpenAI, Anthropic and Gemini, what gets cached, minimum lengths, cache lifetimes, prices, and when it saves money.13 min ·
- Context windows explained: what counts, what happens at the limit, and how to check fitContext window explained: what counts toward it, context window vs max output and token limit, what happens when you exceed it, and when RAG beats long context.12 min ·
- How to count tokens in Python and JavaScript (OpenAI, Claude, Gemini, Qwen)How to count tokens in Python and JavaScript: tiktoken, gpt-tokenizer, Hugging Face tokenizers, and the Claude and Gemini count-token endpoints.16 min ·
- RAG chunk size and overlap: how to choose the right settingsHow to choose a RAG chunk size and overlap: recommended sizes by document type, token vs character splitters, what research shows and a test you can run.14 min ·
- How many tokens is an image? Claude, GPT and GeminiHow many tokens an image costs in Claude, GPT and Gemini: each provider’s formula, worked examples by resolution, cost per 1,000 images and how to shrink them.11 min ·
Models
Coding agents
- Claude Code pricing: plans vs API, and which costs lessClaude Code pricing explained: which Claude plans include it, how usage limits work, what agent work costs on the API, and when Pro, Max or API is cheaper.14 min ·
- The best model for coding agents, and how to choose oneThe best model for coding agents, judged on tool-use reliability, context, speed and cost per task, with current prices for tool-capable models from our data.13 min ·
- How to reduce Claude Code token usage, and what each fix costs youReduce Claude Code token usage with /clear, /compact, plan mode, exact file references, the right model and effort, a lean CLAUDE.md and fewer MCP servers.13 min ·
- How to write a good CLAUDE.md, with a complete exampleHow to write a good CLAUDE.md: what to include, what to leave out, how long it should be, where Claude Code loads it from, and a complete annotated example.13 min ·
- What is MCP (Model Context Protocol)? A plain-English guideWhat is MCP? The Model Context Protocol in plain English: how hosts, clients and servers work, MCP vs APIs, which apps support it and how to use it safely.13 min ·
- How to set up MCP servers in Claude CodeAdd MCP servers to Claude Code with claude mcp add, share them in .mcp.json, keep tokens out of git, pick the right scope and fix servers that fail to connect.13 min ·
- Claude Code hooks: a practical guide with examplesClaude Code hooks explained: the full list of events, settings.json format, matchers, exit codes and JSON output, with tested examples and Windows fixes.18 min ·
- Claude Code subagents: how to create and use themHow Claude Code subagents work: create one by asking Claude or in .claude/agents, pick tools and model, run them in parallel and see what they cost in tokens.14 min ·
- Claude Code plan mode: plan first, then editClaude Code plan mode explained: how to turn it on (Shift+Tab, /plan, CLI flag), what it can and can’t do, when to use it and how approving a plan works.10 min ·
Local AI
- How much VRAM do you need to run an LLM locally?VRAM needed to run an LLM locally: 8B to 70B at Q4, Q8 and FP16, what fits on 8 to 80 GB GPUs, plus system RAM, context length and CPU offload.15 min ·
- How to run LLMs locally on a MacRun an LLM locally on a Mac: what fits in 16 to 128 GB of unified memory, which models suit each Mac, and how to set up Ollama, LM Studio, llama.cpp or MLX.14 min ·
- Ollama vs LM Studio vs llama.cpp: which local LLM tool?Ollama vs LM Studio vs llama.cpp from their docs: install, GGUF and MLX, APIs and ports, GPU support, speed, multi-user limits, licences and which to pick.13 min ·
Developer tools
- Why LLMs return invalid JSON, and how to stop itWhy LLMs return invalid JSON and how to stop it: structured outputs, schema validation with Zod or Pydantic, retries, safe repair and streaming partial JSON.13 min ·
- Fine-tuning JSONL format for OpenAI, Gemini and MistralThe fine-tuning JSONL format for OpenAI, Gemini, Mistral and Hugging Face, with copyable examples, CSV to JSONL scripts, common errors and training cost maths.16 min ·
- OpenAI vs Anthropic vs Gemini API message formats comparedOpenAI vs Anthropic message format, plus Gemini: system prompts, roles, images, tool calls, structured output, streaming and usage fields side by side.15 min ·