How-to Guides
Step-by-step practical guides for running local AI, building agents, writing prompts, calling APIs, fine-tuning models, and keeping your data private.
How to install Ollama and run your first local model
Ollama is the fastest way to run open-source LLMs locally. This guide walks you through installation on macOS, Linux, and Windows, pulling your first model, and running it from the terminal or via its REST API.
Read guideHow to install LM Studio and load a model
LM Studio is a desktop app for running local AI models without any terminal commands. This guide covers installation, downloading a model from Hugging Face, and starting a local inference server.
Read guideHow to run DeepSeek R1 locally on Mac or Windows
DeepSeek R1 is one of the most capable open-source reasoning models available. This guide covers running the 7B, 14B, and 70B distilled variants on consumer hardware using Ollama or LM Studio.
Read guideHow to run Llama 3.3 70B on a workstation
Llama 3.3 70B is Meta's best dense open-source model, matching GPT-4o on many benchmarks. This guide covers hardware requirements, quantisation selection, and optimal settings for running it on a high-end workstation or Apple Silicon Mac.
Read guideHow to choose the right GGUF quantization for your GPU
Quantisation lets you run models that would not otherwise fit in your GPU's VRAM. This guide explains the different GGUF quantisation levels, the quality-size tradeoff at each level, and which to choose for your specific hardware.
Read guideHow to install and use Claude Code
Claude Code is Anthropic's agentic coding tool that runs in your terminal. It reads your entire codebase, writes and edits files, runs tests, and executes shell commands. This guide covers installation, configuration, and practical workflows.
Read guideHow to set up Cursor AI for an existing codebase
Cursor is a VS Code fork with deep AI integration. This guide covers installing Cursor, importing your existing VS Code settings, configuring AI models, and using Cursor's Composer for multi-file editing.
Read guideHow to use GitHub Copilot effectively
GitHub Copilot has evolved far beyond autocomplete. This guide covers the completion model, Copilot Chat, Copilot CLI, and the techniques that get the most out of each feature.
Read guideHow to run Codestral locally for offline coding assistance
Codestral is Mistral AI's code-specialised model with support for 80+ programming languages. This guide covers running it locally via Ollama for fast, offline coding assistance.
Read guideHow to use NousResearch Hermes for structured tool calling
Hermes is NousResearch's open-source model family trained specifically for function calling and agentic workflows. This guide covers running Hermes locally, defining tools in JSON Schema, and building a basic tool-calling loop.
Read guideHow to build a ReAct agent with OpenAI function calling
ReAct (Reason + Act) is the foundational pattern for LLM agents. This guide builds a working ReAct agent from scratch using the OpenAI API and function calling, with a web search and calculator tool.
Read guideHow to chain agents with LangGraph
LangGraph is LangChain's framework for building stateful, multi-agent workflows as directed graphs. This guide covers graph basics, state management, and building a practical multi-agent pipeline.
Read guideHow to set up n8n with an LLM node for workflow automation
n8n is an open-source workflow automation tool with native LLM support. This guide covers self-hosting n8n, connecting it to OpenAI or a local Ollama model, and building an AI-powered automation workflow.
Read guideHow to write a system prompt that gets consistent results
The system prompt is the most powerful lever you have over LLM behaviour. This guide covers the key components of an effective system prompt, common mistakes, and battle-tested patterns for production use.
Read guideHow to use chain-of-thought prompting for complex reasoning
Chain-of-thought (CoT) prompting dramatically improves LLM performance on multi-step reasoning tasks. This guide explains when and how to use it, from simple 'think step by step' to structured CoT templates.
Read guideHow to few-shot prompt any LLM
Few-shot prompting uses examples to teach LLMs new formats and behaviours without fine-tuning. This guide explains how to construct effective examples and when few-shot beats zero-shot.
Read guideHow to build a reusable prompt library
A prompt library treats prompts like code, versioned, tested, and reusable. This guide covers structuring a prompt library, versioning strategies, and tooling for testing prompt quality.
Read guideHow to use the OpenAI API (Python and Node quickstart)
A practical introduction to the OpenAI API covering authentication, the chat completions endpoint, streaming, error handling, and cost management, with working code in Python and JavaScript.
Read guideHow to use the Anthropic Claude API
The Anthropic API gives access to the Claude model family. This guide covers authentication, the Messages API, vision inputs, tool use, and the key differences from the OpenAI API format.
Read guideHow to route between models with OpenRouter
OpenRouter is a unified API that gives access to 200+ LLM models through a single endpoint. This guide covers setup, model selection, cost optimisation, and fallback routing.
Read guideHow to stream LLM responses in a web app
Streaming makes LLM applications feel instant by displaying tokens as they are generated. This guide covers the Server-Sent Events protocol, implementing streaming in Express + React, and handling edge cases.
Read guideHow to fine-tune a model with LoRA using Unsloth
Unsloth is an optimised fine-tuning library that makes LoRA training 2-5× faster with 70% less VRAM. This guide walks through fine-tuning a Llama or Mistral model on your own data using Unsloth on a free Google Colab GPU.
Read guideHow to create a high-quality dataset for fine-tuning
The quality of your training data is the biggest factor in fine-tuning success. This guide covers data collection strategies, formatting standards, quality filtering, and the minimum viable dataset size for different tasks.
Read guideHow to evaluate a fine-tuned model against a baseline
Knowing when your fine-tuned model is actually better than the base model requires systematic evaluation. This guide covers benchmark datasets, LLM-as-judge evaluation, and metrics for task-specific assessment.
Read guideHow to run AI completely offline for sensitive data
For healthcare, legal, financial, and personal data, running AI completely offline ensures your data never leaves your machine. This guide covers the full offline setup stack and practical workflows.
Read guideHow to prevent prompt injection in production systems
Prompt injection attacks trick LLMs into ignoring their system prompt or executing unintended instructions. This guide covers the attack patterns, defence strategies, and code-level mitigations for production LLM applications.
Read guideHow to self-host an OpenAI-compatible API with llama.cpp
llama.cpp includes a built-in HTTP server that exposes an OpenAI-compatible API. This guide covers compiling llama.cpp with GPU support, starting the server, and deploying it for team use.
Read guideHow to build a RAG pipeline from scratch
Retrieval-Augmented Generation (RAG) extends LLMs with your own documents, giving accurate, source-grounded answers without fine-tuning. This guide builds a working RAG system from document ingestion to response generation.
Read guideHow to orchestrate multi-agent workflows with CrewAI
CrewAI lets you define teams of specialised AI agents that collaborate to complete complex tasks. This guide covers creating agents with roles, assigning tasks, and running a complete crew pipeline.
Read guideHow to build conversational agents with AutoGen
Microsoft AutoGen enables multi-agent conversations where AI agents and human proxies collaborate to solve tasks. This guide covers setting up AutoGen, creating conversable agents, and running code-generation workflows.
Read guideHow to build a persistent assistant with the OpenAI Assistants API
The OpenAI Assistants API provides built-in thread management, file search, and code interpreter, removing the plumbing work from agentic applications. This guide covers creating an assistant, managing threads, and using built-in tools.
Read guideHow to set up Continue.dev for local AI code completions
Continue is an open-source VS Code and JetBrains extension that adds AI code completions and chat using local or cloud models. This guide covers installation, configuring Ollama as the backend, and effective usage patterns.
Read guideHow to use Aider for AI pair programming in the terminal
Aider is an open-source terminal tool that uses LLMs to edit your code directly. Unlike IDE plugins, Aider understands your full git history and makes commits automatically. This guide covers setup, the file context system, and effective workflows.
Read guideHow to use GitHub Copilot Workspace for full-feature development
GitHub Copilot Workspace lets you describe a task in natural language and get a fully planned, multi-file implementation. This guide covers how Workspace reasons about your repository and how to guide it effectively.
Read guideHow to deploy LLM inference at scale with vLLM
vLLM is the leading open-source LLM inference server, offering 24× higher throughput than HuggingFace Transformers through PagedAttention. This guide covers installation, serving a model, and configuring for production workloads.
Read guideHow to use Text Generation Web UI (oobabooga) for local models
Text Generation Web UI is a browser-based interface for running local LLMs. It supports GGUF, GPTQ, and Transformers models, includes a chat UI and API server, and runs on any hardware. This guide covers installation and key features.
Read guideHow to use the Google Gemini API (Python and Node)
Google Gemini 2.5 Pro and Flash offer long context windows, multimodal inputs, and competitive pricing. This guide covers getting started with the Gemini API, function calling, and using the 1M token context window effectively.
Read guideHow to use the Mistral AI API
Mistral AI offers high-performance European models including Mistral Large, Pixtral for vision, and Codestral for code. This guide covers the API, function calling, and choosing the right Mistral model for your task.
Read guideHow to handle rate limits and retries in LLM applications
Rate limit errors are the most common production issue in LLM applications. This guide covers exponential backoff, token budget management, request queuing, and provider-specific rate limit strategies.
Read guideHow to use prompt caching to cut LLM costs by up to 90%
Prompt caching lets providers reuse computed KV cache from previous requests when the same prefix is repeated, dramatically reducing cost and latency. This guide covers Anthropic and OpenAI caching, and how to structure prompts for maximum cache hits.
Read guideHow to fine-tune a model with Direct Preference Optimization (DPO)
DPO trains models to prefer good responses over bad ones using human preference data, without the complexity of reinforcement learning. This guide covers collecting preference data, training with TRL's DPO trainer, and evaluating results.
Read guideHow to fine-tune LLMs with Axolotl
Axolotl is a config-driven fine-tuning framework that wraps HuggingFace and Unsloth with a single YAML configuration. This guide covers setting up Axolotl, writing a config, and running multi-GPU training.
Read guideHow to get reliable structured output from any LLM
Getting LLMs to output reliable JSON, YAML, or custom formats is essential for production applications. This guide covers JSON mode, JSON schema enforcement, grammar-based sampling, and fallback strategies.
- The problem with unstructured LLM output
- OpenAI and Anthropic structured outputs
- Use Instructor for any provider
How to use role prompting and personas to improve output quality
Assigning a specific role or persona to an LLM consistently improves output quality on specialist tasks. This guide explains why role prompting works, how to craft effective personas, and when it helps most.
Read guideHow to use GPT-4o vision for image analysis
GPT-4o can analyse images, documents, charts, and screenshots in detail. This guide covers sending images via URL and base64, practical use cases, and building an image analysis pipeline.
Read guideHow to transcribe audio with OpenAI Whisper
Whisper is OpenAI's speech recognition model that supports 99 languages with near-human accuracy. This guide covers the Whisper API, running Whisper locally for privacy, and building a transcription pipeline for long recordings.
Read guideHow to generate images with DALL-E 3 and GPT-Image-1
OpenAI's image generation models produce high-quality images from text descriptions. This guide covers the Images API, prompt writing for consistent results, using the edit endpoint, and integrating image generation into applications.
Read guideHow to build a multimodal RAG system for documents with images
Traditional RAG ignores charts, diagrams, and images embedded in documents. Multimodal RAG retrieves and reasons over both text and visual content. This guide covers document parsing, image embedding, and hybrid retrieval.
Read guideHow to generate and use text embeddings
Text embeddings convert text into dense vector representations that capture semantic meaning. This guide covers generating embeddings with OpenAI and local models, measuring similarity, and practical applications.
- What text embeddings are
- Generate embeddings with the OpenAI API
- Generate embeddings locally with Sentence Transformers
How to build semantic search from scratch
Semantic search finds relevant results based on meaning rather than keywords. This guide builds a complete semantic search system from document ingestion to ranked retrieval, using embeddings and a vector store.
Read guideHow to choose and use a vector database
Vector databases are purpose-built for storing and querying embeddings at scale. This guide compares the leading options, Pinecone, Weaviate, Qdrant, pgvector, and Chroma, and helps you choose the right one for your use case.
- Do you need a dedicated vector database?
- pgvector: the pragmatic choice
- Qdrant: open-source with strong filtering
How to choose the right embedding model for your use case
Embedding model choice significantly affects search quality and cost. This guide compares the leading models, OpenAI text-embedding-3, Cohere embed, BAAI/bge, and others, across quality, speed, cost, and language support.
Read guideHow to trace and debug LLM calls with LangSmith
LangSmith is LangChain's observability platform for logging, tracing, and evaluating LLM applications. This guide covers setup, automatic tracing, custom traces, and using the dashboard to debug production issues.
Read guideHow to test LLM prompts automatically with Promptfoo
Promptfoo is an open-source CLI for testing, evaluating, and comparing LLM prompts. This guide covers writing test cases in YAML, running evaluations, comparing models, and catching prompt regressions in CI.
Read guideHow to monitor and reduce LLM API costs in production
LLM API costs can grow unexpectedly as usage scales. This guide covers cost attribution, per-request tracking, anomaly detection, and practical techniques that reduce costs by 50-80% without sacrificing quality.
Read guideHow to instrument LLM apps with OpenTelemetry
OpenTelemetry (OTel) is the vendor-neutral standard for distributed tracing. The GenAI semantic conventions extend it to LLM calls. This guide covers setting up OTel tracing for LLM applications, exporting to Jaeger or Grafana, and the GenAI conventions.
Read guide