LiteLLM Proxy Connector for WordPress AI

While I’m rather sceptical about all stuff AI I still play around with it. Especially with local setup since I have a machine powerful enough to run sophisticated models locally.

My home setup is behind an LiteLLM proxy which fronts all my models and endpoints and controls access via it’s virtual API Keys.

This way I can monitor the consumptions and have a unified endpoint for various model providers (majority runs with Ollama on my laptop, some smaller models run with Ollama on my Linux servers) and central MCP.

WordPress has added new AI capabilities in their 7.x release with the AI Plugin as the basis. Additional Plugins provide Connectors to various AI providers.

Of course I wanted to use my self-hosted setup with LiteLLM and Ollama. Couldn’t find an existing plugin for this setup and decided to vibe code it with Claude Code. The result can be found on my Forgejo Git Repo:

https://repos.mxhdr.net/maxheadroom/ai-provider-for-litellm

My setup looks like this:

Architecture diagram: WordPress plugin, N8N, and OpenCode connect to a central LiteLLM gateway/proxy, which routes requests to Ollama model instances running on a laptop and a Linux server

The WordPress plugin adds a new Connector to WordPress’s AI capabilities. Once configured via the settings:

Configuration form for the LiteLLM Provider WordPress plugin, with fields for API Base URL, default model, vision-capable models, structured-output models, and request timeout, plus a Save Changes button

it can be enabled in the AI plugins as the default and various models can be chosen for various AI tasks.

WordPress AI settings page showing LiteLLM (Ollama) provider configured for Alt Text Generation, Content Classification, and Content Resizing

Most important setting is of course the ability to increase the timeout for AI responses. Self-hosted LLMs are usually significantly slower than commercial once. That’s why the plugin allows to set a higher timeout than WordPress’ default of 30s. This might or might not work, depending on your local WordPress settings.

I tested generating Image ALT Texts, suggesting tags, summaries, editorial notes, text expansion and the plugin update so far and that worked with my setups. You mileage my vary.

#AI #LiteLLM #ollama #wordpress