@mephistojb/n8n-nodes-lmstudio
v0.1.11
Published
N8N nodes for LM Studio integration with JSON schema support
Maintainers
Readme
@mephistojb/n8n-nodes-lmstudio
An n8n community node for LM Studio that covers both chat and local model management.
Features
- One node, multiple operations:
Send Message,List Models,List Loaded Models,Load Model, andUnload Model - LM Studio auth support: credentials forward the bearer token during connectivity checks, model listing, and execution requests
- Model management: inspect loaded and unloaded models, load them with custom settings, and unload active instances
- Advanced request controls: optional LM Studio API settings are hidden behind
Advancedcollections - Structured JSON output: OpenAI-compatible chat mode supports JSON schema output
- Native LM Studio API support: use
/api/v1/chatwhen you need LM Studio-specific fields such ascontext_length - Vision and OCR input: native chat mode can attach an image binary property for LM Studio vision models
Installation
In n8n
- Go to Settings > Community Nodes
- Select Install a community node
- Enter
@mephistojb/n8n-nodes-lmstudio - Agree to the risks and click Install
Manual
npm install @mephistojb/n8n-nodes-lmstudioConfiguration
Credential: LM Studio API
| Field | Description | Default |
| --- | --- | --- |
| Host URL | LM Studio server URL including protocol and port | http://localhost:1234 |
| API Key | Optional API token from the LM Studio Developer server settings | empty |
The credential test checks GET /api/v1/models and includes the bearer token when one is configured.
Node Operations
Send Message
Default mode uses the OpenAI-compatible POST /v1/chat/completions endpoint to preserve structured output support.
Base inputs:
| Field | Description | | --- | --- | | Model Name or ID | Chat-capable model to use | | Message | User prompt | | JSON Schema | Optional structured-output schema |
Advanced options include:
API ModeSystem PromptImage Binary PropertyContext LengthTemperatureTop PTop KMin PRepeat PenaltyMax Output TokensReasoningSeedStore ChatPrevious Response IDTimeoutRaw Advanced JSON
When API Mode is Native API V1, you can set Image Binary Property to send an image from the current n8n item as a data_url to LM Studio's native /api/v1/chat endpoint. This is the recommended path for OCR and vision prompts.
Raw Advanced JSON is merged into the outgoing request body so you can pass additional LM Studio API fields without waiting for a node update.
List Models
Returns one n8n item per model with metadata such as:
- loaded state
- loaded instances
- quantization
- max context length
- selected variant
- raw LM Studio response object
Load Model
Uses POST /api/v1/models/load.
Advanced options include:
Context LengthEval Batch SizeFlash AttentionOffload KV Cache to GPUNumber of ExpertsTTL SecondsRaw Advanced JSON
Unload Model
Uses POST /api/v1/models/unload and lets you pick from the currently loaded instance IDs.
Development
npm install
npm run typecheck
npm run lint
npm run build
npm test -- --runInBand
LM_STUDIO_URL=http://localhost:1234 npm run test:integration -- --runInBandAutomated npm Publishing
The repository includes release.yml for npm Trusted Publishing via GitHub Actions OIDC.
The GitHub Actions workflows use actions/setup-node@v6 with Node.js 24.
Behavior:
- every push to
masterruns typecheck, lint, build, and tests - the workflow bumps the package version automatically
- the new version is published to npm with provenance
package.json,package-lock.json, and a git tag are pushed back automatically
The release workflow on master expects npm Trusted Publishing to be configured for @mephistojb/n8n-nodes-lmstudio with this GitHub repository and .github/workflows/release.yml.
Notes on LM Studio Compatibility
- The node prefers LM Studio's native REST API at
/api/v1/*for model management. - Chat supports both
/api/v1/chatand/v1/chat/completions. - A fallback to
/api/v0/modelsremains for older LM Studio installations when model listing is needed.
