Ir al contenido principal

Claude Code + LM Studio

Documentation & Setup

Integrating Claude Code with LM Studio

Official Integration Guide Local API Setup
High-end laptop hardware setup for AI

Power vs. Limits: Running LLMs on the new RTX 5070 Mobile architecture.

"Claude Code can talk to LM Studio via the Anthropic-compatible POST /v1/messages endpoint. However, usually you are going to have problems with the model if you don't set the right context. If the window is too small, the CLI overhead will cause the agent to fail."

1 How to fix context in LM Studio

  1. Navigate to Server: Open the "AI Chat" or "Local Server" tab (the double arrows or server icon on the left).
  2. Select Your Model: Choose your active model (e.g., openai/gpt-oss-20b) from the dropdown.
  3. Adjust Context Length: On the right-hand sidebar, find Context Length (or n_ctx). It is likely set to 2048 or 4096.
  4. Increase the Value: Change this to at least 16384 (16k) or 32768 (32k).

    Note: Be careful—if you go too high (like 131k), you may run out of VRAM/RAM.

  5. Apply Changes: Click "Reload Model" at the top to activate the new limit.

2 Recommended Models

For coding use cases with Claude Code:

Local Models
  • gpt-oss (20B)
  • devstral-small-2 (24B)
  • qwen3-coder (30B)
  • glm-4.7-flash (30B)
Cloud Models
  • glm-4.7:cloud
  • minimax-m2.1:cloud

3 Network & Dedicated Machine Setup

You aren't limited to your local machine. You can use a dedicated machine for running LM Studio server to offload processing. Simply point your terminal to the server's IP address:

Redirect Traffic: export ANTHROPIC_BASE_URL=http://[SERVER_IP]:1234
Authentication: export ANTHROPIC_AUTH_TOKEN=lmstudio

馃挕 The 25k Rule

Official docs suggest using a model and server settings with more than ~25k context length. Tools like Claude Code can consume a lot of context very quickly.

Comentarios

Entradas populares de este blog

How to Use the Tab Key to Accept Github Copilot Suggestions

How to Use the Tab Key to Accept Github Copilot Suggestions After installing Copilot in Visual Code, I've installed the following extensions: GitHub Copilot, GitHub Copilot Chat, and GitHub Copilot Tool Pack, as shown in the attached screenshot. The Problem: After installing and configuring it with my Copilot account, when a completion suggestion appears, pressing Tab doesn't autocomplete it. To accept Copilot suggestions with the Tab key in VS Code, follow these steps: Step 1: Open Keyboard Shortcuts JSON Press Ctrl + Shift + P and type "Open Keyboard Shortcuts (JSON)" to open the keybindings.json file. Step 2: Add the Tab Key Binding Add the following code to the keybindings.json file: [ { "key": "tab", "command": "editor.action.inlineSuggest.commit", "when": "textInputFocus && inlineSuggestionHasIndentationLessThanTabSize && inlineSuggestion...

Coding at 30,000 Feet: Replacing Copilot with LM Studio

Next-Gen Development Bye GitHub Copilot: Setup Your Own Local AI C# Software Development 6 min read Coding at 30,000 feet: Independent, private, and powerful. "Picture this: You’re on a flight to Mallorca . You open your laptop, the cabin is quiet, and inspiration strikes. But there is no Wi-Fi, and your cloud-based AI tools are useless. By hosting your own LLM, you don't just gain privacy: you gain operational freedom ." Worried about code privacy or rising subscription costs? In 2026, the era of local LLMs has arrived. Setting up a local environment allows you to use specialized models like DeepSeek or Qwen which, in many cases, outperform generic models in specific programming tasks, offering a precision that cloud-based Copilot simply cannot match offline. 1 Step 1: The Brain (LM Studio) Model Selection Search ...

Context Engineering: How to Make AI Actually Useful

AI Strategy & Implementation Context Engineering: Making AI Actually Useful Workflow Optimization 5 Min Read Coding at 30,000 feet: Independent, private, and powerful. "Everyone is talking about AI agents, but they often feel like a brilliant new hire who doesn't know how things work internally. They have the potential, but lack the context. The fix isn't a better model—it's better context engineering. " Think of context as the ultimate instruction manual. Without it, the AI is guessing; with it, it becomes a specialist integrated into your real-world workflow. 1 The 4 Pillars of Context 馃搵 Operational Rules The "How-To" of your company. Define approval processes and hard limits. Example: "Never approve expenses >$500 without manager review." 馃 Domai...