Instructions to use Nesy1/g4_31b_v2_gembrain_equinox with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nesy1/g4_31b_v2_gembrain_equinox with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Nesy1/g4_31b_v2_gembrain_equinox", dtype="auto") - llama-cpp-python
How to use Nesy1/g4_31b_v2_gembrain_equinox with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Nesy1/g4_31b_v2_gembrain_equinox", filename="g4_31b_v2_gembrain_equinox.Q4_E8K8VQ5FD5O6.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Nesy1/g4_31b_v2_gembrain_equinox with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
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 Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
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 Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
Use Docker
docker model run hf.co/Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Nesy1/g4_31b_v2_gembrain_equinox with Ollama:
ollama run hf.co/Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
- Unsloth Studio new
How to use Nesy1/g4_31b_v2_gembrain_equinox 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 Nesy1/g4_31b_v2_gembrain_equinox 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 Nesy1/g4_31b_v2_gembrain_equinox to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Nesy1/g4_31b_v2_gembrain_equinox to start chatting
- Pi new
How to use Nesy1/g4_31b_v2_gembrain_equinox with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
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": "Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Nesy1/g4_31b_v2_gembrain_equinox with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
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 Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use Nesy1/g4_31b_v2_gembrain_equinox with Docker Model Runner:
docker model run hf.co/Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
- Lemonade
How to use Nesy1/g4_31b_v2_gembrain_equinox with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Nesy1/g4_31b_v2_gembrain_equinox:Q4_K_M
Run and chat with the model
lemonade run user.g4_31b_v2_gembrain_equinox-Q4_K_M
List all available models
lemonade list
Disclaimer
This is not my model, this is a thread full of quantizations of someone else's model. The aim with this thread is to give users access to beefy quants that are 20GB (approx) or under.
Overview:
This thread contains my custom quantizations of the model https://huggingface.co/rpDungeon/Gemma4-31b-Gembrain-Equinox. None of these are imatrixed, only static quants.
Model information below:
Gemma4-31b-Gembrain-Equinox
A V2 Fisher-protected community merge of two Gemma-4 31B creative-writing variants on top of stock google/gemma-4-31b-it. Built for the jaxxks / twisted / toasty research thread on instruct-preserving merges.
What's inside
| Source | Role in the merge |
|---|---|
google/gemma-4-31b-it |
base / instruct anchor |
| Gembrain (community 31B) | style blender — reinforces prompt-attention |
| Equinox (community 31B) | unique style, neutral/realistic — best at low percentages |
Recipe sketch: TIES-style merge of the two community deltas (Gembrain − IT, Equinox − IT) into IT, with Fisher importance + layer-importance damping applied to the combined delta to protect the high-importance instruct-following parameters. Scale 0.3.
Per jaxxks's characterization (2026-05-23): MeroMero would be more attention-to-detail-leaning; Gembrain reinforces user-prompt attention; Equinox carries a neutral/realistic finishing edge but is best at low percentages — the Fisher+layer damping is what lets us include Equinox at a non-trivial weight without losing instruct adherence.
Chat template — important
This repo ships a modified chat_template.jinja that prefills <|channel>thought\n on assistant turns when add_generation_prompt=True and enable_thinking=True. This patches a previously-observed "merges skip thinking" regression where the assistant would open a generation without entering the thought channel first.
enable_thinking=True→ assistant turn begins inside the thought channel; produces a thought trace then folds back to the answer.enable_thinking=False→ behaves identically to stock Gemma-4 (empty thought-block convention preserved).
If you're loading via transformers, you'll pick this up automatically because chat_template.jinja is in the repo root. If you're loading via llama.cpp from a re-quantized GGUF, make sure the GGUF was built after the chat template was placed in the source dir, or apply it post-hoc via gguf_new_metadata.py --chat-template-file.
GGUF
A Q4_K_M GGUF of this exact merge (with the chat-template fix) is mirrored at:
Recommended llama-server flags for Gemma 4 31B at Q4_K_M on a dual-3090 box (subject to verification — see EVAL_GUIDELINES):
CUDA_VISIBLE_DEVICES=0,1 llama-server \
--model g4_31b_v2_gembrain_equinox.Q4_K_M.gguf \
--tensor-split 1,1 \
--ctx-size 8192 --n-gpu-layers 999 \
--parallel 8 --no-warmup --no-mmap --jinja \
-fa on -ctk q8_0 -ctv q8_0
Client requests: cache_prompt: true. Do not pass --swa-full (default SWA-on is correct for Gemma 4).
Known caveats
- This is a V2 merge. The V3 fisher+layer family (
ToastyPigeon/g4-31b-v3-fisher-layer-test) supersedes it in our internal release thread but V2 remains an interesting "low-scale community blend on IT" data point. - Eval-side regression vs the local 31B-IT baseline was measured at roughly -19.78pp IFEval-strict in our first end-to-end test (2026-05-23). Most of that gap traced back to a chat-template-missing bug at the GGUF level (now fixed); a re-eval against the template-fixed GGUF is on the post-eval-opt queue.
- The two source community models have their own licensing terms; check both before redistribution.
Reproduction notes (high level)
- Pull stock
google/gemma-4-31b-itweights. - Pull the two source community 31B variants (Gembrain, Equinox).
- Compute
Δ_GB = W_GB − W_IT,Δ_EQ = W_EQ − W_IT. - TIES-merge the two deltas (sign-conflict resolution + magnitude pruning).
- Apply a Fisher + layer-importance mask to damp instruct-critical parameters, then add to IT at scale 0.3.
- Copy
chat_template.jinja(with the thought-channel prefill) into the merged dir before any quant step. - Save merged bf16 safetensors. Optionally convert to GGUF + quant.
For the masking technique itself, see INSTRUCT_MASKING_TECHNIQUES.md (cross-reference) or the project's instruct_mask/INSTRUCT_MASKING_TECHNIQUES.md.
Credits
- Merge recipe: jaxxks (characterization) + twisted (mask infra) + toasty (training / orchestration)
- Stock base: Google's Gemma 4 31B IT
- Community variants: Gembrain, Equinox (originating authors retain credit for the source models)
- Downloads last month
- 424
4-bit
Model tree for Nesy1/g4_31b_v2_gembrain_equinox
Base model
rpDungeon/Gemma4-31b-Gembrain-Equinox