AI features
Building AI into your own app: calling a model safely, streaming replies, tool calling, structured output, embeddings and RAG — and keeping the bill under control.
61 posts · page 2 of 3
What Is a Reasoning Model? AI That Thinks Before It Answers
Reasoning models spend extra computation working through a problem step by step before answering, which makes them better at maths, coding and multi-step tasks — at the cost of time and tokens. How they work, extended thinking and effort levels, and when to use one.
What Is a Knowledge Cutoff? Why AI Doesn't Know About Recent Things
An AI model's knowledge cutoff is the date its training data ends. Why models don't know about newer events, libraries or prices, why they sometimes don't know their own cutoff, and how web search, documentation and RAG work around it — especially for coding.
The Vercel AI SDK: Streaming Chat and Tool Calls in TypeScript
The AI SDK is a TypeScript toolkit for calling language models from any provider with one API, streaming responses to React with useChat, calling tools, and generating structured data. A working Next.js chat with Claude, tool calling with stopWhen, structured output, provider choice, and production concerns.
Streaming LLM Responses to the Browser: SSE, Fetch Streams, and Gotchas
Streaming makes AI features feel fast: words appear as they're generated instead of after a ten-second wait. How to stream from the Claude API on your server, forward it to the browser, read it in React, and fix the proxies and timeouts that buffer or cut off streams.
Semantic Search vs Keyword Search: What's the Difference?
Keyword search matches the words people type; semantic search matches what they mean, using embeddings and cosine similarity. How each works, where each fails, why hybrid search usually wins, and how to build both in Postgres.
How to Run an LLM Locally: A Beginner's Guide
You can run open-weight AI models like Llama, Qwen, Gemma and Mistral on your own computer, for free and offline. What hardware you need, the easiest tools (Ollama, LM Studio), how model size and quantization work, and what local models can and can't do compared with Claude or GPT.
Chunking for RAG: How to Split Documents So Retrieval Works
How you split documents into chunks decides what a RAG system can retrieve. Fixed-size, recursive, structure-aware and semantic chunking, choosing chunk size and overlap, adding context to chunks, parent-child retrieval, chunking code and tables, and how to evaluate it.
Prompt Caching Explained: Cut LLM Costs and Latency on Repeated Prompts
If every request repeats the same long system prompt, documents or tool definitions, prompt caching lets the provider reuse that work for a fraction of the price and time. How it works, structuring prompts for cache hits, Claude's cache_control, OpenAI's automatic caching, and verifying it works.
OpenAI API vs Claude API: Which Should Your App Use?
Both APIs let your app send text (and images) to a model and get an answer back. How they differ in request shape, models, tool calling, structured output, caching and pricing — and why many apps keep the choice swappable instead of picking forever.
MCP vs API: What's the Difference, and Do You Need Both?
An API is how programs talk to a service. MCP (Model Context Protocol) is a standard way for AI tools to discover and use those services. How they relate, why MCP servers usually wrap APIs, when to use each, and what MCP adds and costs.
LLM Temperature Explained: Why the Same Prompt Gives Different Answers
Temperature controls how random an AI model's word choices are. Low temperature gives consistent, predictable answers; high temperature gives varied, creative ones. How it works, what values to use for which tasks, top-p, and why temperature 0 still isn't fully deterministic.
How to Build an AI App: A Beginner's Step-by-Step Guide
The parts every AI app needs — a frontend, a backend that holds your API key, a model API, a database and usage limits — and the steps from idea to a working, deployed app. With a minimal code example and the mistakes that cost beginners the most.
How to Get a Claude API Key (and Keep It Safe)
Step by step: create an account on the Claude Developer Platform, add credits, create an API key, set a spend limit, and make your first request. Plus the difference between an API key and a Claude subscription, and where to store the key so it never leaks.
Generative Engine Optimization (GEO): Getting Cited by AI Answers
GEO is the practice of making your content easy for AI assistants and AI search to find, understand and cite. How AI answers pick sources, what actually helps (clear facts, structure, original data, crawlability, reputation), what's hype, and how to measure it.
Fine-Tuning vs RAG: How to Teach an AI About Your Data
You want an AI model to know about your products, documents or customers. RAG looks things up and adds them to the prompt; fine-tuning retrains the model. What each actually does, what each is good at, costs and pitfalls, and why most apps should start with neither.
Exponential Backoff and Jitter: Retrying Failed Requests Properly
When an API call fails with a timeout, 429 or 503, retrying immediately makes things worse. Exponential backoff waits longer after each failure, and jitter spreads retries out. Which errors to retry, Retry-After, a TypeScript implementation, idempotency, and retrying LLM API calls.
How to Evaluate LLM Outputs: Evals for AI Features in Your App
You can't improve an AI feature you can't measure. How to build an eval set from real inputs, the kinds of checks (exact match, code-based assertions, LLM-as-judge, human review), avoiding judge bias, running evals in CI, and tracking quality, cost and latency when you change prompts or models.
Claude vs Gemini: Which AI Should You Use?
Anthropic's Claude and Google's Gemini compared for writing, coding, research and everyday use: plans and prices, how each fits into the tools you already use, coding agents (Claude Code vs Antigravity), and how to choose.
Claude Opus vs Sonnet vs Haiku: Which Model Should You Use?
Anthropic's Claude models come in tiers — Opus, Sonnet and Haiku, plus Fable at the top. What each is good at, what they cost on the API, and a simple rule for choosing for coding, chat and features inside your own app.
Claude API Pricing Explained: What Your AI Feature Will Actually Cost
How Claude API billing works: per-token input and output prices for each model, prompt caching, the 50% Batch discount, and worked examples for a chatbot and a summariser — so you can estimate your bill before you ship.
ChatGPT vs Claude: Which AI Assistant Should You Use?
ChatGPT (OpenAI) and Claude (Anthropic) are the two leading AI assistants. How they compare for writing, coding, research, images and voice, what each plan costs, and a practical way to decide — including why many people pay for both.
How to Build an MCP Server (TypeScript and Python)
Build a working Model Context Protocol server that gives Claude Code and other AI tools new abilities. Tools, resources and prompts explained, a TypeScript server with the official SDK and a Python one with FastMCP, connecting it to Claude Code, stdio vs HTTP transports, and designing tools agents use well.
How to Build an AI Agent: The Loop, the Tools, and the Guardrails
An AI agent is a model in a loop: it decides on an action, a tool runs it, the result goes back, repeat. Build one from scratch with the Claude API's tool use, then see when to reach for the Claude Agent SDK or other frameworks — plus stopping conditions, memory, cost control and safety.
AI Guardrails Explained: Keeping an AI Feature Safe and On-Topic
Guardrails are the checks around an AI model that stop it going off-topic, leaking data, producing harmful content or being tricked by users. The main kinds — input checks, output checks, permissions, limits and human review — and a practical set for a small AI app.