Wrap-up

Course Recap: When Custom Model Work Is Worth It

⏱ 10 min

Seven lessons ago, this course opened with a warning: most WordPress sites should exhaust Course 10’s RAG pipeline before considering anything in this course at all. That warning should be even more convincing now that you’ve seen what the alternative actually costs, real training data prepared from your own site, real GPU time, real Python tooling entirely outside WordPress, and a real evaluation discipline to know whether any of it worked. This recap pulls the whole path together and closes with the honest question the course opened with, restated now that you know exactly what’s on the other side of it.

What this course covered
The decision
RAG answers "does the model know this," fine-tuning answers "does the model behave or write this way," most WordPress problems are the former.
Preparing real training data
WP_Query and get_posts() to export clean, structured prompt/completion pairs as JSONL, entirely inside WordPress.
Fine-tuning outside WordPress entirely
Hugging Face transformers and PEFT LoRA on an open-weight model like Llama 3.1, real, standard ML practice with no WordPress involvement.
Serving the result back through the real provider pattern
Course 24's ProviderInterface, AbstractProvider, and ProviderRegistry, reused directly, pointed at your own fine-tuned model's endpoint.
Custom embeddings and honest evaluation
sentence-transformers for domain-specific embeddings, wired into Course 10's unchanged storage and search, proven with a real held-out test set.
Prerequisites

All seven prior lessons in this course, and by extension Course 10 and Course 24, since this recap assumes you built or seriously considered building the full path, not that you’re starting fresh here.

Step 1: The path in order, one line each

  1. Lesson 1 drew the line between knowledge problems, which RAG solves, and behavior or vocabulary problems, which fine-tuning solves, and gave you five honest questions to answer before spending any GPU time.
  2. Lesson 2 exported real, cleaned WordPress content into JSONL training data using WP_Query, the one step in this whole process that’s genuinely a WordPress job.
  3. Lesson 3 fine-tuned an open-weight model with transformers and peft’s LoRA, entirely in Python, entirely outside WordPress, producing a merged model directory.
  4. Lesson 4 served that model with vLLM and registered it as a WordPress provider using Course 24’s exact AbstractApiProvider pattern, unmodified except for its base URL and identity.
  5. Lesson 5 trained a domain-specific embedding model with sentence-transformers, when a stronger off-the-shelf model alone wasn’t enough to fix a real ranking problem.
  6. Lesson 6 wired that embedding model into Course 10’s existing storage and cosine-similarity search, changing exactly one function and reindexing everything.
  7. Lesson 7 proved, with a genuinely held-out test set and a before/after comparison, whether any of it actually improved on what you started with.

Step 2: What actually changed in your WordPress codebase

It’s worth being precise about how little of this course’s work lives inside WordPress itself. The WordPress-side surface area is: an export function in Lesson 2, four small provider classes in Lesson 4 that are, by design, nearly identical to Course 24’s, one HTTP call function and two modified loop bodies in Lesson 6. Everything else, the actual training, the actual evaluation, is Python, running on infrastructure that has nothing to do with your WordPress host. That’s not a limitation of this course, it’s an honest description of where the real work in fine-tuning and custom embeddings genuinely happens.

Step 3: The honest final word

Fine-tuning and custom embeddings are real, legitimate tools for a real, narrow set of problems: a house style RAG keeps failing to reproduce, domain vocabulary a general model handles poorly, or a generic embedding space that misranks your specific content regardless of how good your retrieval logic is. They are not a first resort, not a default upgrade path after RAG, and not something to reach for because a client asked for “custom AI” without a specific, named gap in mind. If you took this course because Lesson 1’s five questions came back honestly yes, you now have a real, evaluated, wired- in result. If partway through you realized the answer to one of those questions was actually no, that’s not wasted time, it’s exactly the outcome this course’s honesty was designed to produce: knowing, with evidence, that RAG and better prompting were enough after all.

A fine-tuned model or custom embedding space needs the same ongoing attention RAG does

Your site’s content, tone, and vocabulary will keep evolving after this course ends, and neither a fine-tuned model nor a custom embedding space updates itself the way Course 10’s re-indexing on save_post does. Budget for periodically repeating Lessons 2 through 7, new training data, retraining, re-evaluating against a fresh held-out set, rather than treating this as a one-time project with a permanent result.

Recap

RAG first, always, for anything that’s actually a knowledge problem, that was true at the start of this course and it’s still true now. Fine-tuning and custom embeddings answer a narrower, real question, does the model behave or represent meaning the way your domain needs, and this course walked the complete, honest path for the genuine minority of cases where that question has a specific, evidenced answer: real training data pulled from your own site, real fine-tuning with open-source ML tooling entirely outside PHP, a real integration back into WordPress through the same provider pattern Course 24 already established, and a real held-out evaluation proving the result was worth the cost.

Resources & further reading

← Evaluating Whether the Adapted Model Actually Improved Finish ✓