ady.com.tr /blog go to the main site → blog home ↻
← all posts
TutorialJun 1, 2026·2 min read·lm-studiolocal-llmgui

Using models in LM Studio

LM Studio is a polished desktop app for running open models — a store-like browser to find them, a chat window to use them, and a one-click local server for your own code. If you prefer a GUI over the terminal, start here. (New to local AI? Read Getting started with local AI first.)

Install

Download LM Studio for Windows, macOS, or Linux from lmstudio.ai and install it like any app. On first launch it may suggest a starter model — you can skip that and pick your own.

Find and download a model

  1. Open the Discover / Search tab (the magnifying glass).
  2. Search for a model — e.g. gemma 4 12b or llama 3.1 8b.
  3. LM Studio shows available GGUF builds and quantizations. It also flags whether a given file will fit in your machine's memory (green = comfortable). For most people Q4_K_M is the best size-to-quality balance.
  4. Click Download.

Not sure which quantization? See the parameters + quantization explainer in Getting started with local AI. Rule of thumb: pick the largest file that fits comfortably in your RAM/VRAM.

Chat with it

  1. Go to the Chat tab.
  2. Pick the downloaded model from the selector at the top to load it into memory.
  3. Type and chat. In the right-hand panel you can tune temperature, context length, and the system prompt, and (on supported models) attach an image for multimodal chat.

For Gemma 4 12B: download a Q4_K_M build, load it, and you've got an encoder-free multimodal model running locally on ~16 GB.

Use it from your own code (local server)

LM Studio can expose an OpenAI-compatible server so your apps talk to it exactly like the OpenAI API:

  1. Open the Developer / Local Server tab.
  2. Select a model and click Start Server (default: http://localhost:1234).
  3. Call it from any OpenAI SDK:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")
r = client.chat.completions.create(
    model="gemma-4-12b",
    messages=[{"role": "user", "content": "Give me a haiku about firmware."}],
)
print(r.choices[0].message.content)

Or with curl:

curl http://localhost:1234/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "gemma-4-12b",
  "messages": [{"role": "user", "content": "Hello!"}]
}'

Tips

  • GPU offload — in the model's load settings, push more layers onto the GPU for speed; pull back if you hit out-of-memory.
  • Context length — longer context uses more memory. Start moderate and raise it if you need it.
  • Models are plain GGUF files — the same ones Ollama, llama.cpp and others use, so what you learn here transfers.

That's it: search → download → load → chat, with a local API whenever you want to build on top of it.