OpenClaw + LM Studio: Running Local LLMs with Your CRM
OpenClaw integrates with LM Studio to run local LLMs directly in your CRM. Learn how to configure DenchClaw with LM Studio's local server in minutes.
OpenClaw works with LM Studio's local server, letting you run any GGUF model locally as the AI brain of your DenchClaw CRM. If you prefer a GUI for managing and testing models before wiring them into your agent workflow, LM Studio is one of the best tools available. This guide covers the full setup from installing LM Studio to making your first local CRM query.
Why LM Studio with DenchClaw?#
LM Studio gives you a polished desktop interface for downloading, benchmarking, and running open-source models — no command line required for model management. Under the hood, it starts a local server with an OpenAI-compatible API endpoint, which OpenClaw knows how to talk to.
The combination gives you:
- Visual model management — browse, download, and compare models through a UI
- Built-in chat interface — test models before plugging them into your workflow
- Local server API — OpenClaw connects to it just like any OpenAI-compatible endpoint
- GGUF support — run virtually any quantized open-source model
- No data leaves your machine — same privacy guarantees as running with Ollama
LM Studio is particularly useful if you're evaluating several models and want to quickly switch between them without re-configuring OpenClaw each time.
Prerequisites#
- macOS, Windows, or Linux (LM Studio supports all three)
- Node.js 18+ and DenchClaw installed
- 8GB RAM minimum (16GB recommended for 7B+ models)
- Disk space for models: 4-8 GB per model
Step 1: Install LM Studio#
Download LM Studio from lmstudio.ai. It's a native desktop app — no package manager required.
After installing, open LM Studio. The first time you launch it, you'll see the model discovery interface.
Step 2: Download a Model#
In the LM Studio search bar, look for models well-suited to agent and tool-use tasks:
Recommended models for DenchClaw:
Meta-Llama-3.2-8B-Instruct— strong general-purpose, follows instructions wellMistral-7B-Instruct-v0.3— fast, compact, reliable structured outputQwen2.5-7B-Instruct— excellent at data analysis and code tasksPhi-4— surprisingly capable at smaller sizes, good for RAM-constrained machines
Click the download button next to your chosen model. LM Studio handles the rest, fetching the GGUF file from Hugging Face.
Step 3: Start the Local Server#
In LM Studio, navigate to the Local Server tab (the cloud icon in the left sidebar).
- Select your downloaded model from the dropdown
- Click Start Server
- Note the server address — by default it's
http://localhost:1234
You'll see the status indicator turn green and a log showing the server is ready. LM Studio's server implements the OpenAI /v1/chat/completions and /v1/models endpoints, so OpenClaw can connect without any special adapters.
Step 4: Configure OpenClaw#
Open your OpenClaw configuration:
openclaw configSet the model provider to your LM Studio server:
{
"model": {
"provider": "openai-compatible",
"baseUrl": "http://localhost:1234/v1",
"model": "local-model",
"apiKey": "lm-studio"
}
}The model field can be anything when using LM Studio — the server uses whichever model you've loaded in the GUI. The apiKey field is required syntax but ignored.
Save and restart:
openclaw restartStep 5: Test the Connection#
Run a quick validation to make sure OpenClaw is routing through LM Studio:
openclaw chat "List the CRM object types in my workspace"The response should come from your locally running model. You'll see the inference happening in the LM Studio server log.
Step 6: Optimize LM Studio Settings for Agent Tasks#
LM Studio has several settings that affect how well models perform for DenchClaw's agent workload:
Context Length: DenchClaw agents often need longer context windows for Skills and multi-step reasoning. In LM Studio's model settings, increase context to at least 4096 tokens, ideally 8192.
Context Length: 8192
GPU Layers: If you have a GPU (including Apple Silicon), offload as many layers as possible to GPU for faster inference:
GPU Layers: Max (or as many as fit in your VRAM)
Temperature: For structured CRM tasks, lower temperature gives more consistent output:
Temperature: 0.2 - 0.4
You can set these per-model in LM Studio's Advanced settings panel.
Switching Models Without Reconfiguring OpenClaw#
One of LM Studio's advantages is hot-swapping models. In your OpenClaw config, you pointed baseUrl at http://localhost:1234/v1 — not at a specific model. So if you want to try a different model:
- In LM Studio, stop the current server
- Load a new model
- Start the server again
OpenClaw will automatically use the newly loaded model with no config changes needed. This makes it easy to experiment and find what works best for your specific use cases.
Using LM Studio for Skill Development#
If you're building or customizing DenchClaw Skills, LM Studio's built-in chat interface is invaluable. Before wiring a Skill into OpenClaw:
- Open LM Studio's Chat tab
- Load your target model
- Paste your Skill's system prompt and test it manually
- Iterate on the prompt until the model behaves correctly
- Then deploy the Skill in DenchClaw
This tightens the feedback loop significantly compared to running full agent sessions every time you tweak a prompt.
Multi-Model Workflows#
Advanced users sometimes run different models for different tasks. LM Studio only serves one model at a time, but you can run multiple instances on different ports:
Instance 1 (port 1234): Heavy model for complex reasoning
{ "baseUrl": "http://localhost:1234/v1", "model": "llama3.1-70b" }Instance 2 (port 1235): Fast model for simple queries
{ "baseUrl": "http://localhost:1235/v1", "model": "phi4" }Then set your OpenClaw default to the fast model and override with --model for complex tasks:
openclaw chat --model http://localhost:1234/v1 "Analyze all overdue pipeline deals"Troubleshooting#
LM Studio server starts but OpenClaw can't connect
Check that the port (1234) isn't blocked by a firewall. Also verify LM Studio shows "Server Running" in green — sometimes it shows ready before the server actually binds.
Model responses are slow or timing out
LM Studio may be CPU-only. Check the Performance section in LM Studio's server settings and ensure GPU layers are being used. On Apple Silicon, LM Studio uses Metal automatically if it detects compatible hardware.
OpenClaw gets empty or truncated responses
The model may be hitting its context limit. Reduce the conversation history OpenClaw sends, or increase the context length in LM Studio's model settings.
Model ignores tool/function calling instructions
Not all models support tool calling well. For DenchClaw Skills that require structured output, prefer instruction-tuned models specifically trained for tool use: Llama 3.x Instruct, Mistral Instruct, or Qwen2.5 Instruct variants.
Comparing LM Studio vs Ollama for DenchClaw#
Both work well. The choice depends on your workflow:
| Feature | LM Studio | Ollama |
|---|---|---|
| Model management | GUI, visual | CLI, scriptable |
| Server setup | Manual click | Auto-starts |
| Model switching | Manual reload | Per-command |
| Scripting/automation | Harder | Easy |
| Model discovery | Built-in browser | HuggingFace/CLI |
| Best for | Testing, evaluating | Production use |
If you're evaluating models and care about the UI experience, LM Studio wins. If you want something that runs headlessly on a server or Raspberry Pi, use Ollama instead.
Privacy and Data Flow#
Like all local model setups with DenchClaw, the data never leaves your machine:
DuckDB (local CRM data)
↓
OpenClaw agent process
↓
LM Studio API (localhost:1234)
↓
Local model inference
↓
Response returned
Your contacts, deals, notes, and queries stay on your hardware. This is what DenchClaw's local-first philosophy is built on — private by default, not private by configuration.
FAQ#
Can I use any GGUF model from Hugging Face with LM Studio and OpenClaw?
Yes. LM Studio can load any GGUF-format model from Hugging Face. As long as it supports instruction/chat format and has reasonable size for your hardware, it'll work with OpenClaw.
Does LM Studio need to be running for OpenClaw to work?
Yes — if you've configured OpenClaw to use the LM Studio local server, LM Studio must be running with the server started. If you shut down LM Studio, OpenClaw will fall back to returning errors. Keep the server running or configure a fallback cloud model.
Can I use LM Studio on a remote machine and connect OpenClaw to it?
Yes. In LM Studio's server settings, change the binding address from localhost to 0.0.0.0 (or your machine's IP). Then point OpenClaw's baseUrl at that machine's IP instead of localhost. Make sure the port is accessible through any firewalls.
How does LM Studio compare to running Ollama for agent tasks?
Both perform similarly since they use the same underlying llama.cpp inference engine for many models. Ollama tends to be faster to start and easier to script; LM Studio is better for visual model management and testing.
What's the maximum model size I can run on an M2 MacBook Pro with 32GB RAM?
You can comfortably run 13B models at full precision or 30B+ models at 4-bit quantization. The rule of thumb: model size in GB ≈ parameters (B) × 2 for full precision, or × 0.5 for 4-bit quant. So a 30B model at Q4 needs about 15GB, fitting easily in 32GB.
Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →
