InfrastructureHabr AI→ original

Running Gemma 4 for free on Kaggle: shrinking it from 62 GB to 18 GB

Google Gemma 4 31B takes up about 62 GB in float16, yet the author managed to run it on free Kaggle, which caps disk space at 57.6 GB. The trick: quantize the model to NF4 on the fly, split it across two T4 GPUs with device_map="auto", delete the Hugging Face cache once loading finishes, and push the result straight to the Hub. The final model weighs 18.3 GB.

AI-processed from Habr AI; edited by Hamidun News
Running Gemma 4 for free on Kaggle: shrinking it from 62 GB to 18 GB
Source: Habr AI. Collage: Hamidun News.
Listen to article

Google Gemma 4, a large 31-billion-parameter model, has been squeezed from 62 GB down to 18.3 GB and run for free on Kaggle, even though the platform's disk limit is smaller than the model's original size.

Where can you run Google Gemma 4 for free?

On Kaggle, by quantizing the model down to 18.3 GB. The catch is that Kaggle's disk is capped at 57.6 GB, while the original model weighs 62 GB. On-the-fly quantization and uploading to the Hugging Face Hub solve the problem.

How do you shrink Google Gemma from 62 to 18.3 GB?

Quantize it to 4 bits, delete the cache automatically during execution, and upload the result directly to the Hugging Face Hub.

Can you run the model for free on Kaggle?

Yes. Google Gemma 4 was shrunk from 62 GB to 18.3 GB and run for free on Kaggle, despite the platform's 57.6 GB disk space limit.

Story

Key Questions Answered

Where can you run Google Gemma 4 for free?

On Kaggle, by quantizing the model down to 18.3 GB. The catch is that Kaggle's disk is capped at 57.6 GB, while the original model weighs 62 GB. On-the-fly quantization and uploading to the Hugging Face Hub solve the problem.

How do you shrink Google Gemma from 62 to 18.3 GB?

Quantize it to 4 bits, delete the cache automatically during execution, and upload the result directly to the Hugging Face Hub.

Can you run the model for free on Kaggle?

Yes. Google Gemma 4 was shrunk from 62 GB to 18.3 GB and run for free on Kaggle, despite the platform's 57.6 GB disk space limit.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Private AI Builders Community · Vibe Club

Ship AI Faster with Founders, Engineers & Weekly Architecture Reviews

Inside Vibe Club (hamidun.com/club) — weekly live masterminds with Zhemal Khamidun, Tech Radar, full LMS access, and 370+ production Claude Code skills.

Join Vibe Club →Explore Hamidun Academy
What do you think?
Loading comments…