Contributors: rtCamp, milindmore22, vishal4669, aviralmittal89
Tags: WordPress, AI, LM Studio, Local AI, Text Generation, Vision, Language Models, Self-hosted
This plugin is licensed under the GPL v2 or later.
Connector for LM Studio is a WordPress plugin that registers LM Studio as an AI provider for the WordPress AI Client. It lets you run AI inference entirely on your own machine — no cloud account or API key required.
Connector for LM Studio bridges the WordPress AI Client with LM Studio's local REST API, allowing you to:
- Run AI models locally — no data leaves your machine
- Generate text using any LLM loaded in LM Studio
- Configure a default model generation from WordPress admin settings
- Discover available models automatically from your running LM Studio instance
- Switch models without changing any code — just update your admin settings
This makes it simple to integrate powerful, locally-hosted language models into your WordPress site while keeping full control over your data and infrastructure.
Many teams need AI features without sending data to external services — for compliance, privacy, or cost reasons. Running models locally with LM Studio solves this but requires gluing together the LM Studio server with WordPress. This plugin handles that integration by:
- Zero cloud dependency: All inference happens on the local LM Studio server
- No API key required: LM Studio works without authentication by default
- Standardized interface: All models exposed through the WordPress AI Client's consistent API
- Flexible configuration: Switch models from admin settings — no code changes required
- Automatic localhost handling: WordPress HTTP restrictions for local URLs are resolved automatically
- Privacy-first: Data never leaves your server
- Cost-free inference: No per-token charges once the model is downloaded
- Model freedom: Load any model supported by LM Studio
- Vision support: Use multimodal models for image + text prompts
- Simple setup: Point to your LM Studio host and start generating
The plugin communicates with LM Studio's REST API:
| Endpoint | Purpose |
|---|---|
GET /api/v1/models |
Populate the model dropdown in settings |
POST /api/v1/chat |
Text generation requests |
- Only LLM-type models loaded in LM Studio are supported; embedding-only models are filtered out.
- Image generation (text-to-image) is not supported — only image input for vision models.
- Only the single model configured in settings is used as the default; per-request model selection is controlled by the AI Client.
- WordPress: 7.0 or higher
- Requires at least: 7.0
- Tested up to: 7.0
- Stable tag: 1.1.0
- PHP: 7.4 or higher
- Requires PHP: 7.4
- Required Plugin: AI Experiments (
ai) must be active - LM Studio: Local server must be running and accessible
- Ensure the AI Experiments plugin (
ai) is installed and activated. - Download or clone this plugin into
wp-content/plugins/connector-for-lmstudio. - Activate Connector for LM Studio from the Plugins screen.
- Start LM Studio and load a model.
- Optionally configure the host URL and default model in Settings > LM Studio Settings.
composer require rtcamp/connector-for-lmstudioNavigate to Settings > LM Studio Settings in your WordPress admin to configure Connector for LM Studio.
LM Studio does not require authentication by default. If you have configured your LM Studio server to require an API token:
- Go to Settings > Connectors.
- Enter your LM Studio API token and save.
The plugin connects to http://localhost:1234 by default. If your LM Studio server runs on a different address or port:
- Navigate to Settings > LM Studio Settings.
- Enter the base URL of your LM Studio server in the Host URL field (e.g.
http://192.168.1.10:1234). - Save your settings.
You can also override the host via the LMSTUDIO_HOST environment variable — this takes priority over the admin setting.
- Navigate to Settings > LM Studio Settings.
- The Available Models dropdown is populated automatically by querying your running LM Studio instance.
- Select a model to use as the default for all AI Client requests routed to LM Studio.
- Leave the field empty to let the AI Client choose the model per request.
- Save your settings.
use WordPress\AI_Client\Prompt_Builder;
$result = Prompt_Builder::create()
->using_provider( 'lmstudio' )
->set_model( 'llama-3.2-3b-instruct' ) // LM Studio model key
->set_system_instruction( 'You are a helpful assistant.' )
->add_text_message( 'Write a short haiku about sunrise.' )
->generate_text();You can use Connector for LM Studio for any WordPress AI Client feature that supports text generation, such as:
- Title generation
- Excerpt generation
- Content summarization
Vision-capable models can accept image inputs alongside text. The plugin detects image parts in the prompt and switches to the multimodal input format automatically:
use WordPress\AI_Client\Prompt_Builder;
$result = Prompt_Builder::create()
->using_provider( 'lmstudio' )
->set_model( 'llava-v1.6-mistral-7b' ) // Vision-capable model key
->add_text_message( 'Describe what you see in this image.' )
->add_image_from_url( 'https://example.com/photo.jpg' )
->generate_text();You can use Connector for LM Studio's vision capabilities in any WordPress AI Client feature that supports image input, such as:
- Alt text generation
- Image captioning / analysis
For advanced deployments, override defaults using PHP constants or environment variables:
LMSTUDIO_HOST— Override the LM Studio server base URL (default:http://localhost:1234)
Connector for LM Studio is actively developed and maintained by rtCamp.
- Repository: https://github.com/rtcamp/connector-for-lmstudio
We welcome contributions! Please open an issue or pull request on GitHub.
composer run-script lint
composer run-script format
composer run-script phpstannpm run lint:js
npm run lint:js:fixnpm run lintnpm run plugin-zipThis creates connector-for-lmstudio.zip in the plugin root, excluding all development-only files.
LM Studio is a desktop application for downloading, managing, and serving large language models locally. It exposes a REST API that this plugin communicates with.
No. LM Studio does not require authentication by default. If you have enabled authentication on your LM Studio server, you can provide the API token in Settings > Connectors.
Yes. The WordPress AI plugin (ai) must be installed and activated. This plugin registers Connector for LM Studio as a provider within that framework.
Yes. LM Studio must be running with at least one model loaded for text generation to work. The plugin will show an error if it cannot reach the configured host.
Yes. When a model is loaded in LM Studio with vision capabilities, the plugin automatically uses the multimodal input format when image parts are included in a prompt. No additional configuration is needed.
No. LM Studio supports LLM inference only. Text-to-image generation is not available through this plugin.
Yes. Enter the full base URL (including port) in Settings > LM Studio Settings > Host URL, or set the LMSTUDIO_HOST environment variable. The environment variable takes priority.
Loading or warming up a large model in LM Studio can take a significant amount of time. The plugin automatically extends the HTTP timeout to 180 seconds for all requests to the configured LM Studio host to accommodate this.
The plugin can be network-activated on multisite. Each site's settings are managed independently via their own Settings > LM Studio Settings page.
- Confirm LM Studio is running and a model is loaded.
- Verify the Host URL in Settings > LM Studio Settings matches your LM Studio server address.
- Check that the WordPress AI plugin is active.
- Ensure LM Studio is running and the model has finished loading.
- The plugin extends the timeout to 180 s; if generation still times out, the model may need more time to warm up — try again after LM Studio reports the model as ready.
- Check the PHP error log for detailed error messages.
- Check file permissions and database write access.
- Look for conflicting plugins that may be overriding the settings page.
-
"AI provider not found" error in settings: The WordPress AI plugin may not be fully initialised — deactivate and reactivate both plugins, then reload the settings page.
-
Connection refused errors: Confirm LM Studio is running and the host URL (including port) is correct.
-
Authentication errors: If LM Studio is configured with an API key, make sure it is entered in Settings > Connectors.
-
Text generation failing or timing out: If LM Studio is timing out, turn off the thinking ability for the model from the Model settings in LM Studio.
- Issues & Bug Reports: GitHub Issues
- Source Code: GitHub Repository
This project is licensed under the GPL v2 or later — see the LICENSE file for details.
Made with ❤️ by rtCamp



