Gemma 4 LM Studio
LM Studio is a free desktop app that runs Gemma 4 on your own computer with no terminal: search, download, chat. This guide covers setup, the settings that matter, the built-in local API, and using EmbeddingGemma 2.
Windows, macOS and Linux · free · runs offline after the download ·
Run Gemma 4 in LM Studio in five steps
Install LM Studio
Download the installer for your system from lmstudio.ai, run it and open the app.
Find Gemma 4
Open the model search with Ctrl + Shift + M (Cmd on Mac) and type "Gemma".
Pick a size and download
The app shows each download's size. Not sure? Choose the 12B on a 16 GB machine. Prefer the builds marked QAT.
Load it
Press Ctrl / Cmd + L and select your Gemma model. Loading takes a few seconds.
Chat
Type a message. Everything runs on your computer; nothing is sent anywhere.
Rather use a terminal or a phone? See the install guide and mobile downloads.
Gemma 4 models in LM Studio
Pick by memory. A model has to fit in memory to run well, not just on your disk.
| Model | Identifier | Download | Context | Inputs listed | Suits |
|---|---|---|---|---|---|
| Gemma 4 E2B | google/gemma-4-e2b | 4.20 GB | 128K | Text, image, audio | An 8 GB machine; quick replies |
| Gemma 4 E4B | google/gemma-4-e4b | 5.90 GB | 128K | Text, image, audio | 8 to 12 GB of memory |
| Gemma 4 12B | google/gemma-4-12b | 7.40 GB | 256K | Text, image | A 16 GB machine - the best starting point |
| Gemma 4 26B A4B | google/gemma-4-26b-a4b | 15.60 GB | 256K | Text, image | A 24 GB graphics card or 32 GB Mac; fast for its size |
| Gemma 4 31B | google/gemma-4-31b | 19.00 GB | 256K | Text, image | A 24 GB graphics card or 32 GB Mac; best quality |
Choose the QAT builds
Add -qat to an identifier, for example google/gemma-4-12b-qat. Same download size, trained by Google to hold quality at 4-bit. See QAT builds.
Audio
LM Studio's page lists audio input for E2B and E4B. Google's model also supports audio on the 12B; whether an app exposes it depends on the app.
What LM Studio supports
Its Gemma 4 page lists tool use, vision input and reasoning.
Identifiers, sizes and inputs from LM Studio's Gemma 4 page; the "suits" column is this site's guidance. Compare the models on the models page, in the model comparison and on benchmarks; plan memory with the VRAM guide; the 12B has its own guide.
Five settings worth checking
You find these in the model's settings when you load it, and in the panel beside the chat.
Context length
Gemma 4 can hold 128K or 256K tokens, but a new model usually loads with far less. Raise it if the chat forgets earlier messages. Around 32K is a sensible start; more uses more memory.
GPU offload
Turn it up as far as it goes. If the model does not fit your graphics memory, part of it runs on the processor and replies slow down.
Sampling
Google recommends temperature 1.0, top-p 0.95 and top-k 64 for every Gemma 4 size. Check these if answers seem off.
System prompt
Gemma 4 has a real system role. Use the system prompt box to set tone and format once for the whole conversation.
Reasoning
Thinking helps with maths, code and planning, and slows simple chat. Switch it to suit the task.
Keep it current
Update LM Studio, and download the model again if you got it before July 2026, when Google refreshed the weights.
Sampling values from Google's model card; the rest is this site's guidance, and exact menu names vary between LM Studio versions. More in how to use Gemma 4 and prompting.
Asking about images
Attach, then ask
Add an image to your message and ask a question about it. Every Gemma 4 size reads images.
Good for
Reading screenshots and documents, describing photos, explaining charts, and comparing several images.
Know the limits
It only writes text, it may estimate when counting in busy pictures, and small text needs a clear, high-resolution image.
What vision can do is covered under capabilities and features; known gaps are in limitations.
Use Gemma 4 from your own code
LM Studio includes a local server that speaks the OpenAI format. Load a model, start the server from the Developer tab, and any tool that accepts a custom OpenAI address can use Gemma 4.
# pip install openai
from openai import OpenAI
client = OpenAI(base_url="http://localhost:1234/v1", api_key="lm-studio")
reply = client.chat.completions.create(
model="google/gemma-4-12b",
messages=[
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain what a context window is."},
],
)
print(reply.choices[0].message.content)
The key can be any text; the local server does not check it.
curl http://localhost:1234/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemma-4-12b",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain what a context window is."}
]
}'
lms get google/gemma-4-12b-qat # download lms load google/gemma-4-12b-qat # load into memory lms server start # start the local API on port 1234
LM Studio ships a command-line tool called lms for people who want to script it.
| Endpoint | Use it for |
|---|---|
/v1/chat/completions | Chat with Gemma 4 |
/v1/embeddings | Embeddings, with an embedding model loaded |
/v1/models | List the models you have |
/v1/responses · /v1/completions | The other OpenAI-style routes |
Base address http://localhost:1234/v1, from LM Studio's API documentation. To connect an editor see Gemma 4 coding; for the wider picture, the API page and Gemma 4 vs Claude Code.
EmbeddingGemma 2 in LM Studio
EmbeddingGemma 2 is Google's new open model for search. It turns content into vectors instead of writing answers, and pairs with Gemma 4 to answer questions from your own files. Google's developer guide lists LM Studio among the supported tools.
Update LM Studio
A brand-new model type needs a current version of the app and its runtime.
Search for the GGUF build
In the model search, type
ggml-org/embeddinggemma-2-GGUF. It comes in two sizes: 310 MB at 8-bit and 558 MB at full precision.Load it and start the server
Embedding models are used through the local API, not the chat window.
Call the embeddings endpoint
Send text to
/v1/embeddingsand you get a vector back.
curl http://localhost:1234/v1/embeddings \
-H "Content-Type: application/json" \
-d '{
"model": "the-name-LM-Studio-shows-for-the-model",
"input": "task: search result | query: What causes the northern lights?"
}'
Use the model name exactly as LM Studio shows it. Through a raw endpoint you add the task label yourself, as in this example; Google's model card lists the labels.
The GGUF build is text only
It is the 0.3B text-and-code part of the model. For images, audio and video, use Python or Ollama for now.
Pair it with Gemma 4
Load both: EmbeddingGemma 2 finds the right passages, Gemma 4 writes the answer. The pattern is shown in how to use both.
Keep vectors at 256 or more
Google reports little quality loss down to 256 numbers, and a sharp drop at 128 for images and video.
If it is not working in LM Studio yet
# The simpler route today: Ollama, full model, all input types
ollama pull embeddinggemma-2
curl http://localhost:11434/api/embed -d '{
"model": "embeddinggemma-2",
"input": "What causes the northern lights?"
}'
GGUF details from the ggml-org/embeddinggemma-2-GGUF page on Hugging Face; supported tools from Google's EmbeddingGemma 2 developer guide; Ollama sizes are in how to download. Everything else about the model is in this site's EmbeddingGemma 2 guide.
GGUF or MLX?
GGUF
Works on Windows, Linux and Mac. It is the format of Google's official QAT 4-bit builds, and the safe default everywhere.
MLX
Apple's format, for Macs with Apple silicon only. LM Studio can run Gemma 4 in MLX as well as GGUF. See Mac setup.
File types are explained on the models page; figures are in technical specs.
LM Studio or Ollama?
Both are free, both run Gemma 4 locally, and you can have both installed.
| LM Studio | Ollama | |
|---|---|---|
| How you use it | A desktop app with a chat window | Commands in a terminal |
| Finding models | Built-in search with sizes shown | Names you type, such as gemma4:12b-it-qat |
| Changing settings | Sliders and menus | Commands and files |
| Local API | OpenAI format, port 1234 | OpenAI format, port 11434 |
| EmbeddingGemma 2 today | Through a text-only GGUF build | In its library, all four sizes |
| Scripting and servers | Possible with the lms tool | What it is built for |
| 12B download | 7.40 GB | 7.2 GB |
Green marks the easier side for most people on that row; this is the site's view, not a test. Other options are compared in the runtime selector; shared deployments are under self-hosting.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| The model will not load | Not enough memory for that size | Choose a smaller model, or lower the context length |
| Replies are very slow | Part of the model is running on the processor | Raise GPU offload; if it is already at maximum, use a smaller size |
| It forgets earlier messages | The context length is too small | Raise it and reload the model |
| Odd symbols or broken formatting | An old download or an old app version | Update LM Studio and download the model again |
| Reasoning appears in the answer | The app is not separating the thinking | Update the app, or turn reasoning off |
| My code cannot connect | The local server is not running | Start it from the Developer tab; check the address is http://localhost:1234/v1 |
| EmbeddingGemma 2 will not load | The app does not support the new model type yet | Update LM Studio, or use Ollama for now |
Causes and fixes are this site's guidance, not an official list. More in the install guide and the FAQ.
LM Studio questions
Is LM Studio free?
The app is free to download, and Gemma 4 is free under Apache 2.0. There is no per-message charge. Check LM Studio's own terms if you plan to use it at work.
Which Gemma 4 model should I download in LM Studio?
The 12B on a 16 GB machine, E4B on 8 GB, and the 26B A4B or 31B with a 24 GB graphics card or a 32 GB Mac. Prefer the QAT builds.
How much memory do I need?
LM Studio lists 4 GB of RAM as the minimum for the smallest Gemma 4. Larger models need more: about 6.7 GB for the 12B's weights at 4-bit, and 17.5 GB for the 31B.
Does it work offline?
Yes. After the model is downloaded, chatting needs no connection, and your messages stay on your computer.
Can I use EmbeddingGemma 2 in LM Studio?
Google lists LM Studio as supported. On October 7, 2026 it was not yet in LM Studio's own catalogue, but a text-only GGUF build can be downloaded from Hugging Face inside the app.
Can I send images?
Yes. Every Gemma 4 size reads images, and LM Studio lists vision input for Gemma 4.
Can other apps use the model LM Studio is running?
Yes. Start the local server and point the app at http://localhost:1234/v1. It speaks the OpenAI format.
Where else can I run Gemma 4?
Ollama, Python, a phone, or a hosted service. See the download hub, Android, the playground, chat and pricing. Safety notes are under safety.
Search, download, chat
Get LM Studio, pick a Gemma 4 model that fits your memory, and you are running in minutes.