🤖 AI/ML

LM Studio

A GUI tool for running LLMs locally

📖 Detailed Explanation

LM Studio is a free desktop application that lets you run LLMs on a local computer. Its GUI makes it easy to download and run open-source models from Hugging Face, guaranteeing complete data privacy without any cloud API.

It uses the llama.cpp engine internally and supports macOS (Apple Silicon Metal acceleration), Windows, and Linux. In particular, on Apple Silicon Macs it enables efficient inference through MLX acceleration, and in integrated GPU environments it shows faster performance than Ollama.

Key features: local API server (OpenAI-compatible), RAG support (chat with local files), Tool Calling, MCP client, Python/TypeScript SDK. With its 2025-2026 updates, it continues to support the latest models such as GLM-4.5, Devstral-2, and olmOCR-2.

Recommended specs: RAM 16GB minimum, 32GB recommended. 7B models are feasible with 16GB, while 13B–70B models require 32GB or more. Even without a GPU, CPU execution is possible via Vulkan offloading, but the speed is slow.

💻 Code Example

# LM Studio 로컬 서버 연동 (OpenAI 호환 API)
from openai import OpenAI

# LM Studio 서버 시작: 앱에서 "Start Server" 클릭
# 기본 주소: http://localhost:1234/v1

client = OpenAI(
    base_url="http://localhost:1234/v1",  # LM Studio 서버
    api_key="lm-studio"  # 아무 값이나 OK (로컬이라 인증 불필요)
)

# 1. 기본 대화
response = client.chat.completions.create(
    model="llama-3.2-3b-instruct",  # LM Studio에 로드된 모델명
    messages=[
        {"role": "system", "content": "당신은 유용한 AI 어시스턴트입니다."},
        {"role": "user", "content": "파이썬으로 피보나치 함수 작성해줘"}
    ],
    temperature=0.7,
    max_tokens=1024
)
print(response.choices[0].message.content)

# 2. Streaming 응답
stream = client.chat.completions.create(
    model="llama-3.2-3b-instruct",
    messages=[{"role": "user", "content": "한국의 수도는?"}],
    stream=True
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

# 3. LM Studio SDK (더 많은 기능)
# pip install lmstudio-sdk
from lmstudio import LMStudioClient

lm = LMStudioClient()
models = lm.list_models()  # 로드된 모델 목록
print(f"사용 가능 모델: {models}")

# 비용: $0 (전기세만, GPU 없이도 실행 가능)

🗣️ Say It Like This in Practice

💬 In a Meeting
"Our security policy prohibits the use of external APIs. If you run Llama 3.2 locally with LM Studio, your data doesn't leave the machine. On an M3 Max MacBook, a 7B model gives 40 tokens per second."
💬 In an Interview
"After developing a prototype with LM Studio, we migrated production to vLLM. Because it's an OpenAI-compatible API, we only had to change the base_url without any code changes, and we validated the MVP with a development cost of 0 KRW."
💬 In a Technical Discussion
"Comparing LM Studio vs Ollama: LM Studio has a good GUI and is fast on integrated GPUs, while Ollama is CLI-friendly and makes multi-model switching convenient. Developers use Ollama, and non-developer team members use LM Studio."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

⚠️ Common Mistakes & Cautions

❌
Attempting to load a model larger than RAM

A 70B model needs 40GB+ even when quantized. With 16GB of RAM, a 7B Q4 quantized model is the limit.

❌
Using Tool Calling in production right away

LM Studio's Tool Calling is beta quality. Use it only for testing/development, and using verified APIs is recommended for production.

✅
The right way

Using Q4_K_M quantized models is recommended (balance of quality and size). Optimize VRAM utilization with the GPU layers setting.

🔗 Related Terms

📚 Learn More