AI Agent Architecture

Run Gemma 4 Locally in LM Studio on Integrated Graphics

You can run Gemma 4 locally on a computer with integrated graphics. The important decisions are not simply “CPU or GPU.” Choose a quantized model that fits in memory, keep the context only as large as the task requires, and accept the speed-versus-capability tradeoff.

Tested configuration: ExplainingComputers used a Ryzen 5 5600G with integrated graphics and 16GB RAM. A 4-bit 12B QAT model worked at roughly 5.5 to 6 tokens per second in the creator's tests; E4B reached roughly 11 to 12 tokens per second but failed one harder image-identification task that 12B completed.

The Direct Answer

Start with the classic LM Studio download, select an official or trusted Gemma 4 GGUF variant, and let the application estimate whether it fits. On a 16GB system, E4B Q4 is the safer first model. Try 12B QAT Q4 only when LM Studio says it can load and there is enough memory left for the operating system, context, and attached images or documents.

Use thinking mode selectively. Keep LM Studio's defaults first, measure a real task, then adjust one setting at a time. The creator spent hours changing low-level options and saw little benefit compared with simply disabling thinking for easy work.

Watch the Full Gemma 4 Tutorial

Source and credit: The embedded tutorial and performance tests are by ExplainingComputers. The measurements below describe that one machine and configuration, not a universal benchmark. The current product documentation and implementation guidance are added by JQ AI SYSTEMS.

Download the Right Application: LM Studio or Bionic?

The LM Studio download page now presents LM Studio Bionic first and the classic LM Studio application second. The video uses the classic application: it provides model discovery, per-model settings, a chat interface, and programmable local APIs.

LM Studio describes Bionic as a separate agent application for coding and document work. Bionic can run local models, connect to another device through LM Link, or use cloud models. Choose the classic application when following this tutorial or when you need direct control over model loading, context, GPU offload, and the local server.

Privacy check: “Using LM Studio” does not automatically mean every request stays local. Confirm the selected model and execution route. Downloaded local models can run offline; Bionic's web search and secure-cloud options are network services.

What Fits on Modest Hardware?

Google currently lists five Gemma 4 sizes: E2B, E4B, 12B, 31B, and 26B A4B. Smaller or lower-precision models require less memory and usually generate faster, while larger models generally offer more capability. The file size is only part of the memory requirement: the runtime, context or KV cache, vision inputs, and other applications also consume memory.

Starting pointWhy choose itWhat to watch
E2B or E4B Q4Better fit for laptops, mini PCs, and first experiments.Lower capability may show up on uncommon images, nuanced instructions, or complex code.
12B QAT Q4More capability while remaining practical on some 16GB systems.Leave headroom for Windows, LM Studio, context, and multimodal processing.
31B or 26B A4BHigher-capability local or workstation experiments.Not sensible defaults for the modest 16GB integrated-graphics machine demonstrated.

Google's official Gemma 4 documentation recommends QAT Q4 GGUF variants for llama.cpp and LM Studio. In QAT, lower-precision behavior is simulated during training, allowing the model to compensate for quantization. PTQ instead compresses a trained model afterward and may lose more quality.

Install LM Studio and Load Gemma 4

  1. Download the classic LM Studio application from the official download page. It appears below Bionic.
  2. Open Discover and search for Gemma 4. Prefer Google's official QAT collection or a clearly identified, trusted GGUF publisher.
  3. Open the available-downloads list and compare the model size, quantization, and LM Studio's fit warning.
  4. For the demonstrated 16GB computer, the creator downloaded a 7.15GB Gemma 4 12B QAT 4-bit file. E4B Q4 is a more conservative first download.
  5. Choose Use in New Chat, let the model load, and begin with a small, non-sensitive prompt.
  6. Enable Developer Mode if you want persistent timing and throughput statistics or need to verify detected hardware.

Thinking Mode Is the Largest Easy Speed Lever

With default thinking enabled, the creator's first 12B request spent about 18 seconds reasoning and reported 5.46 tokens per second. Disabling thinking made a simple conversational request begin answering almost immediately. That does not make the model intrinsically faster; it avoids generating an additional reasoning trace for a task that does not need one.

  • Thinking off: simple rewriting, translation, short summaries, extraction, and routine formatting.
  • Thinking on: difficult coding, planning, multi-step reasoning, and agentic work where the quality gain is measurable.
  • Evaluate both: compare accepted results, time, and memory on ten representative examples instead of choosing by feel.

The Settings That Actually Matter

Context length

The demonstrated model loaded with an 8,192-token context. Reducing it to 4,096 saves memory and can improve responsiveness; increasing it allows larger documents but consumes more memory and can reduce performance. The 3,900-word chapter test used the 8,192-token setting and occupied 65.9% of the available context.

CPU thread pool

The creator increased the thread pool from four to six, matching the 5600G's physical cores, but saw only a small change within normal run-to-run variation. Do not assume every logical thread improves generation. Measure before keeping the change.

GPU and KV-cache offload

The 12B QAT model could not be partially offloaded in the creator's setup. A partial E4B Q_K_M offload to the integrated GPU provided no practical advantage, likely because CPU and GPU shared the same system memory and introduced another bottleneck. Offloading the KV cache with 2GB allocated to the integrated GPU did help. Current LM Studio builds can estimate memory and automatically choose GPU usage, so defaults are the correct baseline.

What the Creator Actually Tested

TaskResult on 12B QATUseful lesson
Offline proseGenerated about 100 words on Southern Italy while the computer was disconnected.Once downloaded, model inference can run without an internet connection.
TranslationTranslated the answer into French.Offline multilingual work is possible, but a fluent reviewer should verify important output.
Image understandingIdentified both a giraffe and a less-common okapi.Multimodal capability is useful, but two images are a demonstration, not an accuracy benchmark.
Document summaryReduced a 3,900-word book chapter to roughly 200 words.Watch context use and compare summaries with the source before relying on them.
Python codingProduced a working BMI calculator in about 1 minute 50 seconds.Run and review generated code; one successful small program does not establish broader reliability.

LM Studio can extract text from PDFs and documents for chat even when the model itself natively expects text and images. That convenience belongs to the application layer, so file support and model modality should not be treated as the same claim.

E4B Versus 12B: Faster Is Not Always Better

On the same machine, E4B produced about 11.75 tokens per second versus roughly 6 for 12B. It still recognized the giraffe but failed to identify the okapi, describing the image as an abstract texture. The larger model was slower and succeeded.

This is the central hardware lesson: select the smallest model that reliably completes your task. A fast failure is not useful, and a larger model that swaps memory or stalls may also be the wrong choice. Build a compact evaluation set containing common inputs, difficult edge cases, and the errors you cannot accept.

Practical Starter Settings

ControlBegin withChange it when
ModelE4B QAT Q4 GGUFMove to 12B only if quality is insufficient and memory permits.
Context4K to 8KIncrease only when the actual input does not fit.
ThinkingOff for easy tasksEnable for complex reasoning, coding, or agentic work.
ThreadsLM Studio defaultTest physical-core count and retain it only if measured performance improves.
GPU offloadAutomaticAdjust only after checking LM Studio's memory estimate and hardware detection.
EvaluationTen representative examplesAdd every meaningful failure to the test set.

LM Studio's current Windows requirements recommend at least 16GB RAM and 4GB dedicated VRAM, but the tutorial demonstrates that CPU and integrated-graphics inference can still be useful. Treat “recommended” as a performance target and the creator's test as evidence of feasibility, not a compatibility promise for every laptop.

Related Lesson: What Changes With Agentic AI?

The local chat workflow above produces answers. Agentic systems add tools, actions, files, and longer task loops, which increases both capability and risk. This companion ExplainingComputers episode provides the broader context.

Video Chapters

Sources and Links

Common questions

Can Gemma 4 run without a dedicated graphics card?
Yes. The creator ran quantized Gemma 4 models on a Ryzen 5 5600G computer with integrated graphics and 16GB of RAM. Speed and model fit depend on the exact model, quantization, context length, runtime, and available memory.
Which Gemma 4 model should a 16GB computer try first?
E4B at 4-bit precision is the lower-risk starting point. The creator also loaded a 7.15GB 12B QAT file on 16GB RAM, but the operating system, context, image processing, and runtime need memory too. Use LM Studio's fit estimate and close other heavy applications.
What is the difference between Gemma 4 QAT and PTQ?
Quantization-aware training simulates lower precision during training so the model can compensate for it. Post-training quantization compresses an already trained model. Google provides official QAT Q4 GGUF files for llama.cpp-compatible tools such as LM Studio.
Should thinking mode stay enabled?
Not for every request. The creator disabled it for simple writing and translation because the reasoning delay dominated the task, then recommended enabling it for harder work such as coding or agentic tasks. Test both modes on your own evaluation set.
Does LM Studio work fully offline?
Downloaded models can be loaded and used offline. Model discovery, downloads, updates, web search, cloud models, and other network features need connectivity. Verify the selected model and endpoint before processing sensitive material.
Is LM Studio Bionic the same application shown in the video?
No. Bionic is a newer, separate agent application that can use local models, remote devices, or LM Studio Secure Cloud. The video shows the classic LM Studio application for model discovery, low-level configuration, chat, and local APIs.
Share
X LinkedIn Reddit
Build Yours

Want a system
like this one?

Book a free 30-minute call. We map your situation, identify the highest-impact automation, and figure out if we are a fit.

Book Free 30-min Call