Using Codistry with LM Studio
Set up LM Studio to work with Codistry for local, private AI assistance.
What is LM Studio?
LM Studio is a desktop application that lets you run large language models locally. When paired with Codistry you get:
Complete Privacy
All AI processing happens on your machine. No data leaves your computer.
No API Costs
No per-token charges or ongoing subscription fees.
Offline Capability
Work without internet once models are downloaded.
Full Control
Choose and customize any compatible model.
Prerequisites
- LM Studio installed
- Codistry VS Code extension installed
- At minimum 16 GB RAM (32 GB+ recommended for larger models)
- Sufficient disk space for model downloads (2-20 GB per model)
Step 1: Install and Set Up LM Studio
- Download from lmstudio.ai
- Choose the “developer” mode during installation
- Browse and download a model from the built-in model browser (e.g.,
openai/gpt-oss-20b) - Wait for the model to download and load
Recommended Models
| Model | Size | Use Case | RAM |
|---|---|---|---|
| Llama 3.2 3B Instruct | ~2 GB | Quick responses, basic tasks | 8 GB |
| Qwen 2.5 Coder 7B | ~4 GB | Code-focused, good balance | 12 GB |
| DeepSeek Coder 6.7B | ~4 GB | Strong coding performance | 12 GB |
| Llama 3.1 8B Instruct | ~5 GB | General purpose, versatile | 16 GB |
| Mistral 7B Instruct | ~4 GB | Fast, efficient | 12 GB |
Step 2: Start the Local Server
- In LM Studio, go to the Local Server tab
- Select your downloaded model from the dropdown
- Click Start Server
- Note the server address (typically
http://localhost:1234)
- Context Length: 32 768 minimum for small codebases; 100 k+ for larger ones
- Temperature: 0.2–0.4 for code generation (lower = more deterministic)
- GPU Offload: Enable if you have a compatible GPU
Step 3: Configure Codistry
- Open the Codistry sidebar in VS Code
- Click the Settings gear icon
- Navigate to Models
- Add an OpenAI-Compatible Model:
- Display Name: Name of choice
- Model Name:
openai/gpt-oss-20b - Base URL:
http://localhost:1234/v1 - Max Tokens: Equal to your context length in LM Studio
- Click Add Model, then Save Settings
Step 4: Test the Connection
- Open the Codistry chat panel
- Choose your configured model from the dropdown
- Send “Hello, can you help me with code?”
- Verify you get a response from your local model
Known Issues
The Model Name in Codistry must exactly match the name shown in LM Studio (e.g., openai/gpt-oss-20b). A mismatch may cause connection failures or download of a different model.
Problem: "Connection refused" error
Solution: Ensure LM Studio server is running and the port matches your configuration.
Problem: Slow or no responses
Solution: Check if model is fully loaded in LM Studio; consider a smaller model.
Problem: Low-quality responses
Solution: Adjust temperature, context length, or switch to a more capable model.
Performance Optimization
Model Selection
- 3B models: Fast, good for simple tasks, limited capability
- 7B models: Best balance of speed and quality
- 13B+ models: Highest quality, requires significant RAM/VRAM
Hardware Acceleration
- Apple Silicon: Leverage Metal for fast inference
- NVIDIA GPU: Enable GPU offload in LM Studio
- AMD GPU: Limited support, check LM Studio docs
Local vs Cloud Comparison
| Aspect | LM Studio (Local) | OpenAI / Claude (Cloud) |
|---|---|---|
| Privacy | Complete | Depends on provider |
| Cost | Hardware only | Per-token charges |
| Speed | Varies by hardware | Generally fast |
| Quality | Model-dependent | Consistently high |
| Internet | Not required | Required |
Next Steps
- Explore MCP Integration to extend Codistry with custom tools
- Review Best Practices for effective AI assistance
- Check out other Guides