RAG vs. fine-tuning: how to choose for your LLM application
RAG changes what a model reads; fine-tuning changes how it behaves. Use five questions, a token-cost calculation and an evaluation plan to pick the right one.
4 min read
Writing
Practical writing on artificial intelligence, machine learning, and software engineering.
RAG changes what a model reads; fine-tuning changes how it behaves. Use five questions, a token-cost calculation and an evaluation plan to pick the right one.
4 min read
Serve a scikit-learn model as a validated REST API: load it once with a lifespan handler, test it with TestClient, and package it in a cache-friendly Docker image.
Machine Learning3 min read
Store embeddings next to your data with pgvector. Choose the right distance operator, pick HNSW or IVFFlat, and avoid the filtering trap that returns too few rows.
Software Engineering4 min read
Prompt injection is number one in the OWASP Top 10 for LLM applications. Learn direct and indirect attacks, and the layered defenses that limit the damage.
Artificial Intelligence4 min read
RAG changes what a model reads; fine-tuning changes how it behaves. Use five questions, a token-cost calculation and an evaluation plan to pick the right one.
Artificial Intelligence4 min read
Advertisement
Prompt caching pays off from the second request, batch APIs halve the price of non-urgent work, and routing sends easy requests to cheaper models. See the numbers.
Artificial Intelligence4 min read
Measure ad-related layout shift in Astro, reserve space before an in-article slot loads, and distinguish a mobile lab result from real visitor data.
Software Engineering4 min read
Compare Pagefind and a JSON search index on 100 and 1,000 test pages. See first-query bytes, timings, and how to measure the trade-off on your Astro site.
Software Engineering4 min read
Compute average precision and trapezoidal PR AUC from four scored examples. See exactly which segment of the precision–recall curve changes the reported area.
Machine Learning3 min read
Rank three vectors by cosine similarity and dot product, then normalize them. Learn why a longer embedding can win and how to check a search index migration.
Artificial Intelligence3 min read