Skip to content
AI artificial intelligence
About usLet’s talk
Back to articles

Gemma 4 on your own hardware: a first project

Running a model on your own hardware sounds appealing. With Gemma 4, we start with one task, then cover variants, memory, maintenance and removing the model.

Your own model starts with choosing a version

Want to run a model yourself and see what happens outside a provider’s service? Gemma 4 is a family of open-weight models. Google provides the model parameter files for use in building applications. The documentation lists E2B, E4B, 12B, 31B and 26B A4B. The release log dates 12B Unified to June 3, 2026.

Only looking for a way to remove a downloaded model? We collected the commands for Ollama, LM Studio and Hugging Face, plus the model folders, in the section How to remove a local Gemma 4 model.

Your own hardware lets you plan how data is processed and learn the mechanics of running a model. Before downloading a version, check its format, documentation and the requirements of the tool that will run it. The variant name alone will not tell you enough.

Start with an inbox of fictional support requests

We suggest a small project: organizing support requests. The model assigns each message a category and briefly explains its choice. Add “needs review” so a vague description does not force a guess.

Label a small set of examples manually and hold some back for the final evaluation. Otherwise, it is easy to refine the instructions only for messages whose answers you already know. If the model confuses payments with refunds, revisit the category definitions. If it gets lost in long requests, check that it received the full text.

The outcome is easy to show a future user: a message lands in the right category or reaches someone who can review it. There is room in the demo for successful assignments and cases that need help.

Who will look after the service once it is running?

Once the model replies, record memory usage, time to the first answer and behavior with several concurrent tasks. A conversation on an idle machine is different from the whole team using the application at once.

Include updates, restarts after failures and log reviews in your calculations. With your own service, those jobs stay with you even if there is no longer a charge for each external API call.

Keep the model identifier, settings and evaluation set. You will have something to compare the next result with. Once the basic case works to the agreed standard, you can add an interface and more tasks.

Rather not run your own service? Ready-made apps also run models on your computer. We cover the local mode of Perplexity Computer on the Mac separately: hardware requirements, the difference between fully local and hybrid, and the permissions the agent asks for.

Perplexity Computer without the cloud: can your Mac handle it? →

How to remove a local Gemma 4 model and free up disk space

Finished the project or want to switch to another variant? A downloaded model takes up disk space until you remove it. How you do that depends on the tool you used to download it. Below are three common routes: Ollama and LM Studio (both covered in Google’s Gemma documentation) and the Hugging Face cache. Removing a model does not uninstall the tool itself.

Ollama. Run ollama ls to check the exact model name, for example gemma4 or gemma4:e4b. If the model is still loaded in memory, stop it with ollama stop gemma4. Then ollama rm gemma4 (with your model name) removes it from disk, as the Ollama CLI reference describes. According to the Ollama FAQ, models are stored in ~/.ollama/models (macOS), /usr/share/ollama/.ollama/models (Linux) or C:\Users\%username%\.ollama\models (Windows), unless the OLLAMA_MODELS variable points to another directory.

LM Studio. Unload the model (lms unload --all in the lms CLI or in the app), then delete its folder from the models directory. By default, this is ~/.lmstudio/models/<publisher>/<model> (see the LM Studio documentation). If you changed the location, the My Models tab shows the current directory. Afterwards, lms ls shows whether the model is gone from the list.

Hugging Face. Models downloaded with transformers or other libraries that use the Hugging Face Hub go into a shared cache, by default ~/.cache/huggingface/hub (HF_HOME or HF_HUB_CACHE set a different location). According to the Hugging Face cache guide, in current versions of huggingface_hub, hf cache ls lists the downloaded repositories and their size. hf cache rm with an ID from that list deletes the selected repository; with --dry-run, it first shows how much space it would free. hf cache prune cleans up interrupted downloads and revisions that nothing refers to any more.

Terminal commands: replace the model name with the one from your list
# Ollama
ollama ls
ollama stop gemma4
ollama rm gemma4

# LM Studio (delete the model folder in the directory shown under My Models)
lms unload --all
lms ls

# Hugging Face
hf cache ls
hf cache rm model/<organization>/<repository> --dry-run
hf cache rm model/<organization>/<repository>

Frequently asked questions

How do I remove a local Gemma 4 model? It depends on the tool you used to download it. In Ollama, check the name with ollama ls and remove the model with ollama rm, for example ollama rm gemma4. In LM Studio, delete the model folder from the directory shown in the My Models tab. Files downloaded from Hugging Face are removed with hf cache rm.

Does removing the model uninstall Ollama or LM Studio? No. These steps delete the model files; the application stays on your computer. You can download the same or another variant again later.

Sources and further reading

The sources behind this article. Instructions and example scenarios are suggestions from our editorial team.

Back to articles