Course · Advanced

Private & Self-Hosted AI for WordPress: Ollama, Local LLMs, PII Redaction & GDPR by Design

A practical, honest look at running your own LLM behind WordPress with Ollama, vLLM, or llama.cpp, including a real custom provider for the PHP AI Client SDK, regex-based PII redaction, and a decision framework for when self-hosting is actually worth it.

8 lessons
Start course →

Every course earlier in this track assumed a cloud API call: your WordPress site sends a prompt to Anthropic, OpenAI, or Google, and a response comes back over the network. For most sites that’s the right default, it’s simpler, it’s maintained by someone else, and it doesn’t require a GPU. This course is for the sites where that assumption doesn’t hold: a client with a data residency requirement, a regulated industry that can’t send customer content to a third party, or a team that’s decided vendor lock-in to a single AI provider is a real risk worth engineering around.

Say the honest part up front, since it shapes everything else in this course: running your own model is usually not cheaper than paying for API tokens once you account for GPU hardware and the ongoing cost of keeping it running. If cost is your only reason for being here, a cheaper cloud model in a shorter preference list, the subject of Course 5, will probably serve you better. The real reasons to self-host are privacy (no data ever leaves your network), regulatory or liability requirements (data residency, avoiding cross-border transfer under GDPR), and avoiding dependence on a single vendor’s pricing and availability decisions. This course teaches self-hosting as an architecture for those specific problems, not as a cost-optimization trick.

By the end, you’ll have Ollama (or vLLM, or llama.cpp) running behind an OpenAI-compatible endpoint, a real custom provider class that plugs that endpoint into the PHP AI Client SDK’s provider registry the same way an official provider plugin does, a regex-based PII redaction pattern with its real limits stated plainly, and an honest framework for deciding whether any of this is worth doing for a given project.

This course builds directly on Course 5, “LLM Integration in WordPress With the PHP AI Client SDK.” If you haven’t taken it, at least read its setup and text-generation lessons first, this course assumes you already understand wp_ai_client_prompt(), provider plugins, and model configuration, and spends its time on what’s different about a self-hosted provider rather than re-explaining the SDK from scratch. It also assumes the compliance foundation from Course 16, “AI Governance, Compliance & Responsible AI for WordPress.” Course 16 covers GDPR and the EU AI Act in general terms and carries the same not-legal-advice caveat throughout; this course leans on that foundation for Lesson 7 rather than re-deriving it, and focuses specifically on where self-hosting changes the picture.