Search Documentation

Find and navigate to documentation pages and their content

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

  1. Download from lmstudio.ai
  2. Choose the “developer” mode during installation
  3. Browse and download a model from the built-in model browser (e.g., openai/gpt-oss-20b)
  4. Wait for the model to download and load

Recommended Models

ModelSizeUse CaseRAM
Llama 3.2 3B Instruct~2 GBQuick responses, basic tasks8 GB
Qwen 2.5 Coder 7B~4 GBCode-focused, good balance12 GB
DeepSeek Coder 6.7B~4 GBStrong coding performance12 GB
Llama 3.1 8B Instruct~5 GBGeneral purpose, versatile16 GB
Mistral 7B Instruct~4 GBFast, efficient12 GB

Step 2: Start the Local Server

  1. In LM Studio, go to the Local Server tab
  2. Select your downloaded model from the dropdown
  3. Click Start Server
  4. Note the server address (typically http://localhost:1234)
Server Configuration Tips
  • 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

  1. Open the Codistry sidebar in VS Code
  2. Click the Settings gear icon
  3. Navigate to Models
  4. 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
  5. Click Add Model, then Save Settings

Step 4: Test the Connection

  1. Open the Codistry chat panel
  2. Choose your configured model from the dropdown
  3. Send “Hello, can you help me with code?”
  4. Verify you get a response from your local model

Known Issues

Model Name Must Match Exactly

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

AspectLM Studio (Local)OpenAI / Claude (Cloud)
PrivacyCompleteDepends on provider
CostHardware onlyPer-token charges
SpeedVaries by hardwareGenerally fast
QualityModel-dependentConsistently high
InternetNot requiredRequired

Next Steps