Course · Advanced

Fine-Tuning & Custom Embeddings for WordPress: Domain-Adapt Open Models on Your Content

The advanced end of the AI-on-WordPress track, fine-tuning open-weight models and training custom embedding spaces on your own content, then wiring the result back into WordPress through the real provider-extension pattern and evaluating it against a genuine baseline.

8 lessons
Start course →

Say this plainly before anything else, since it should shape whether you take this course at all: for most WordPress sites, Course 10, “Build a RAG Knowledge Base in WordPress,” already solves the problem people reach for fine-tuning to fix. If your model doesn’t know something about your site, current pricing, a new product, this week’s policy change, retrieval fixes that, and it fixes it without touching a single model weight. This course is not that course. It’s for the genuine minority of cases left over once retrieval is already working well: the model knows the facts you hand it, but it still writes in the wrong voice, misuses your industry’s vocabulary, or your generic embedding model quietly ranks the wrong chunks as relevant no matter how good your retrieval plumbing is. Fine-tuning and custom embeddings answer “does the model behave and represent meaning the way my domain needs,” not “does the model know current facts.” Exhaust the cheaper option first.

This course is also the natural depth follow-on to Course 24, “Private & Self-Hosted AI for WordPress.” Everything you build here, a fine-tuned model, a custom embedding model, has to be served from somewhere, and the honest answer is almost always a self-hosted, OpenAI-compatible endpoint you control, exactly the vLLM or Ollama setup Course 24 already walked through. If you haven’t taken Course 10 and Course 24, treat them as hard prerequisites, not optional background. This course assumes you already understand the RAG pipeline’s chunking and storage pattern and the ProviderInterface/AbstractProvider/ProviderRegistry extension point the PHP AI Client SDK exposes for a custom provider, and it spends its time entirely on what’s different when the model behind that provider is one you adapted yourself.

Be honest about the shape of the work, too. Fine-tuning a language model and training a custom embedding model both happen entirely outside WordPress and PHP, using real, well-established open-source machine learning tooling: Hugging Face’s transformers and peft libraries, sentence-transformers for embeddings, ordinary Python scripts run on a machine with a GPU. WordPress’s role starts only once that work is done: consuming the resulting model over an HTTP endpoint, through the same provider pattern Course 24 already established. This is, honestly, the highest-effort course in the entire track. It requires real training data, real GPU time, and a real evaluation discipline to know whether any of it was worth doing. If you’ve read this far and you’re still here because you have a specific, named gap that retrieval doesn’t close, a house style RAG keeps failing to reproduce, a jargon-heavy domain your embeddings keep misranking, this course walks you through preparing training data from your own site, fine-tuning an open-weight model, training or selecting a domain-specific embedding model, wiring both back into WordPress through the real provider extension point, and proving with a held-out test set that the result is actually better than what you started with.