Instructions to use CompressedGemma/gemma-4-31B-it-compressed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use CompressedGemma/gemma-4-31B-it-compressed with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="CompressedGemma/gemma-4-31B-it-compressed", filename="Gemma-31B-it-quant.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use CompressedGemma/gemma-4-31B-it-compressed with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf CompressedGemma/gemma-4-31B-it-compressed # Run inference directly in the terminal: llama-cli -hf CompressedGemma/gemma-4-31B-it-compressed
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf CompressedGemma/gemma-4-31B-it-compressed # Run inference directly in the terminal: llama-cli -hf CompressedGemma/gemma-4-31B-it-compressed
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf CompressedGemma/gemma-4-31B-it-compressed # Run inference directly in the terminal: ./llama-cli -hf CompressedGemma/gemma-4-31B-it-compressed
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf CompressedGemma/gemma-4-31B-it-compressed # Run inference directly in the terminal: ./build/bin/llama-cli -hf CompressedGemma/gemma-4-31B-it-compressed
Use Docker
docker model run hf.co/CompressedGemma/gemma-4-31B-it-compressed
- LM Studio
- Jan
- Ollama
How to use CompressedGemma/gemma-4-31B-it-compressed with Ollama:
ollama run hf.co/CompressedGemma/gemma-4-31B-it-compressed
- Unsloth Studio
How to use CompressedGemma/gemma-4-31B-it-compressed with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CompressedGemma/gemma-4-31B-it-compressed to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CompressedGemma/gemma-4-31B-it-compressed to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CompressedGemma/gemma-4-31B-it-compressed to start chatting
- Pi
How to use CompressedGemma/gemma-4-31B-it-compressed with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf CompressedGemma/gemma-4-31B-it-compressed
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "CompressedGemma/gemma-4-31B-it-compressed" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use CompressedGemma/gemma-4-31B-it-compressed with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf CompressedGemma/gemma-4-31B-it-compressed
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default CompressedGemma/gemma-4-31B-it-compressed
Run Hermes
hermes
- Docker Model Runner
How to use CompressedGemma/gemma-4-31B-it-compressed with Docker Model Runner:
docker model run hf.co/CompressedGemma/gemma-4-31B-it-compressed
- Lemonade
How to use CompressedGemma/gemma-4-31B-it-compressed with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull CompressedGemma/gemma-4-31B-it-compressed
Run and chat with the model
lemonade run user.gemma-4-31B-it-compressed-{{QUANT_TAG}}List all available models
lemonade list
Showcase: Conversations with, and Musings of Gemma 4 31B it compressed
Thank you for creating this so-easily-accessible version of Gemma 4, and for allowing the users access to it, along with Gemma 4 26B it compressed.
We've found this LLM (Gemma 4 31B it compressed) to be especially useful in reasoning (as far as we can corroborate with known information).
Tested it on knowledge about:
- ancient history
- humanities
- movies
- natural sciences: paleontology, astronomy
We have carried out several conversations with this LLM, and asked it for own musings on various subjects.
Software for interacting with LLMs:
LM Studio (https://lmstudio.ai) - free to use (https://lmstudio.ai/blog/free-for-work)LLM working parameters:
Temperature: 0 (recommended value)
Repeat Penalty: 1.15 (recommended: 1.5)
Top K: 2 (recommended: 1)
Top P: 0.95 (recommended: 1.0)
MIn P: 0.9Context Length set to: 60000
Evaluation Batch Size set to: 16384
backend: CUDA llama.cpp (Windows) 2.14.0
No System Prompt
the PDF files containing the conversations and musings, at URL (as of 2026.05.18):
https://sinapsaro.ro/llmusings/sinapsa_ai_llmusings.htmfirst four such items:
#01: A story about the most fantastic things and events this LLM can imagine
#02: Solipsism and Self-Awareness
#03: Theology
#04: Paradoxes of time travel
NONE of the links in this post should be viewed as advertising a product or company; they are provided as DIRECT links to repositories of FREE information and products.
Thanks for checking out this quant!
It can also handle complex coding tasks, etc!
It can also handle complex coding tasks, etc!
It's also pretty good for Roleplaying. Still just getting started on the role AI-RP-thing, sounds interesting for writing, but most models struggle with lots of stuff. This model allowed me to test a "heavier" model with larger context, so thank you for that. (Still think AI is not too great at that RP stuff BTW, or at least convinced that nothing I can run on my hardware does a really good job)
I'd definitely like to see more of these compressed models. In my head it just makes sense to do some smart-assery to imit noise to places where it doesn't cause as much trouble... But maybe I'm the weird one.