AI Briefing
KO

Running Google Gemma 4 Locally with LM Studio Headless CLI and Claude Code

·2026.04.07 02:33

Key point

This explains how to run Claude Code in a local environment using LM Studio's new CLI and Gemma 4.

Details

Gemma 4 adopts a Mixture-of-Experts (MoE) architecture, activating only 4B parameters out of a 26B model, enabling high-performance inference even on low-spec hardware. With a 256K long context, vision input, and function calling capabilities, it is optimized for local environments.

LM Studio 0.4.0 introduces a new Headless CLI called llmster. This allows model downloading, loading, chatting, and API server execution via the lms command without the desktop app. In particular, it provides an Anthropic-compatible API, enabling the setup of an environment where Claude Code can be used as a fully offline code assistant.

Users can optimize performance through the following detailed hardware tuning:

  • Memory management: Predict and configure memory requirements based on context length using the --estimate-only option
  • GPU offloading: Optimized utilization of Apple Silicon's unified memory and NVIDIA VRAM
  • Parallel request processing: Simultaneous processing of multiple requests through continuous batching
  • Efficiency improvements: KV cache memory savings through Flash Attention and automatic model unloading through TTL settings

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.