Tutorials

Step-by-step guides to building with AI.

Run a local LLM with Ollama

Install, pull, run, serve.

Build a chat app with the OpenAI API in Python

Minimal chat loop with streaming.

Create a RAG app with LangChain and Chroma

Question answering over your docs.

Deploy an LLM with FastAPI

Serve a model behind HTTP.

Fine-tune a model with Hugging Face PEFT

Train a LoRA adapter.

Quantize a model with llama.cpp

Convert and quantize to GGUF.

Build a browser AI app with transformers.js

In-browser inference.

Add semantic search to a website

Search by meaning.

Create an AI agent with function calling

Tool use loop.

Evaluate an LLM with a test harness

Build evals in Python.

Stream tokens in a React app

Fetch reader streaming.

Use ONNX Runtime in a Node app

Run ONNX in Node.

Build a document Q&A bot

Answer over PDFs.

Optimize prompts with few-shot examples

Anchor behavior with examples.

Cache LLM responses with Redis

Exact-match cache.

Add guardrails with a moderation API

Filter unsafe content.

Deploy to Hugging Face Spaces

Host a Gradio app.

Measure latency and cost per request

Instrument calls.

Prompt templates with Jinja

Manage prompts as templates.