Instructions to use AIHeikki/brainsurged-gladiator-gemma4-e2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M # Run inference directly in the terminal: llama cli -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M # Run inference directly in the terminal: llama cli -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Use Docker
docker model run hf.co/AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AIHeikki/brainsurged-gladiator-gemma4-e2b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AIHeikki/brainsurged-gladiator-gemma4-e2b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
- Ollama
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with Ollama:
ollama run hf.co/AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
- Unsloth Desktop
- Pi
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with Docker Model Runner:
docker model run hf.co/AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
- Lemonade
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Run and chat with the model
lemonade run user.brainsurged-gladiator-gemma4-e2b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AIHeikki/brainsurged-gladiator-gemma4-e2b: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 AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AIHeikki/brainsurged-gladiator-gemma4-e2b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "AIHeikki/brainsurged-gladiator-gemma4-e2b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Brainsurged One-Shot Gemma Gladiator E2B (
v6-gladiator)
Brainsurged One-Shot Gemma Gladiator E2B (v6-gladiator)
Can a smaller open-weights model (google/gemma-4-E2B-it, 2.3B effective active text parameters vs. Qwen3.5-4B's 4.66B) learn a consolidated policy, agentic, and tactical chess curriculum in a single training run?
- Base Model:
google/gemma-4-E2B-it/unsloth/gemma-4-E2B-it(Apache-2.0,35layers,2.3Bactive compute text parameters; Vision & Audio encoders stripped at GGUF export) - Flagship Artifact (
main):brainsurged-gladiator-gemma4-e2b-Q4_K_M.gguf(3.19 GiB/3,427,880,704bytes, SHA-256:d28b4087b1c7386e2c1531c209ceeb3f5e46d6976ebd06cb7356c6ff302878ed) - Compared Against:
AIHeikki/brainsurged-chessmaster-qwen3.5-4b(4.66B, 6 sequential surgery loops) andJev 1.13.0(api.typesafe.ai)
Interpretation and limits
This is a trained hybrid model: 2,780 synthetic examples and gradient-based LoRA, followed by zero-gradient calibration. It is not a zero-training-data or zero-gradient-only result.
The recorded two-game score was 1.5–0.5 against Chessmaster, and 0.5–1.5 against Jev. Four games and a 24-position sprint do not establish Elo or general superiority. Gladiator was faster than Jev in the two complete games, but slower in the sprint (214.35 vs 177.42 ms WAN p50). These are observations from those workloads, not universal latency claims.
The 2.3B figure is Gemma's effective parameter count; its embedding-inclusive total is larger (the base text model is approximately 5.1B). Comparing 2.3B effective parameters with Qwen's 4.66B total does not demonstrate half the parameter count or half the compute. No end-to-end FLOP measurement was performed.
“Zero leakage” below refers to the reported exact piece-placement overlap check only; it does not prove semantic independence or exclude benchmark-guided development. Holdout accuracy is specific to the supplied synthetic suites. The serving decoder, quantization, prompts and runtime are part of the evaluated system; stock Ollama/llama.cpp may produce different moves or latency. Parallel batch checks measure agreement on smoke-test cases with a numerical tolerance; they do not prove bit-exact agreement on every position.
Recorded Results: One Training Run and Workload-Specific Latency
Instead of accumulating 5–6 sequential rounds of LoRA + weight edits, Experiment 12 (v6-gladiator) consolidated our entire curriculum (2,780 zero-leakage rows: Round-4 policy/agentic + Round-6 Chessmaster + 380 new Queen/Rook ray & post-promotion contact-check guards) into one single surgery pass directly on raw Gemma 4 E2B-it, paired with serving_v7_gladiator (2-Pass Parallel Multi-seq_id Tree-Batch C++/CUDA engine).
1. Live Championship Chess Arena on Cloud Run NVIDIA L4 (python-chess Referee + Stockfish Audit)
Full PGNs and ply-by-ply Stockfish evaluations archived in reports/gladiator_evaluations/live_matches/ and GLADIATOR_ARENA_REPORT.md.
| Match Game | White | Black | Result | Plies | Termination | ≥300cp Blunders (W / B) |
Kamikaze Checks (W / B) |
Engine p50 (WAN p50) |
|---|---|---|---|---|---|---|---|---|
Game 1 (vs. Jev) |
Jev 1.13.0 |
Gemma Gladiator E2B |
½–½ |
113 |
Insufficient material | 7 / 5 |
4 / 3 |
109.0 ms (161.2 ms) vs. Jev 166.3 ms WAN |
Game 2 (vs. Jev) |
Gemma Gladiator E2B |
Jev 1.13.0 |
0–1 |
72 |
Checkmate (36...Bh6#) |
7 / 8 |
0 / 7 |
103.5 ms (155.0 ms) vs. Jev 172.2 ms WAN |
Game 3 (vs. 4B) |
Chessmaster 4B |
Gemma Gladiator E2B |
0–1 |
30 |
Checkmate (15...Qxc1#) |
3 / 0 |
0 / 0 |
109.9 ms (179.1 ms) vs. 4B 205.5 ms (288.3 ms) |
Game 4 (vs. 4B) |
Gemma Gladiator E2B |
Chessmaster 4B |
½–½ |
172 |
Insufficient material | 21 / 18 |
9 / 4 |
127.5 ms (180.0 ms) vs. 4B 116.4 ms (171.4 ms) |
- Defeated
Brainsurged Chessmaster Qwen3.5-4B1½–½head-to-head:- In Game 3 (Black),
Gemma Gladiator E2Bplayed a0-blunder,0-kamikaze-check 30-ply checkmate (15...Qxc1#) while running1.87×faster on-GPU (109.9 msvs.205.5 msenginep50). - In Game 4 (White),
Gemma Gladiator E2Bpromoted three separate passed pawns (39.e8=Q+,56.h8=Q,78.f8=Q) and held the draw (½–½), clinching the1½–½series win over the4.66B6-loop champion.
- In Game 3 (Black),
- Sub-
JevLive WAN Latency (155.0–161.2 msWANp50):- Across both live matches against
Jev 1.13.0,Gemma Gladiator E2BbeatJev 1.13.0on end-to-end WAN latency (155.0 msvs.172.2 msin Game 2;161.2 msvs.166.3 msin Game 1), and committed fewer Stockfish≥300cpblunders thanJevin both Game 1 (5vs.7) and Game 2 (7with0kamikaze checks vs.Jev's8with7kamikaze checks, after an unsound3.Nxf7opening gambit).
- Across both live matches against
2. Live NVIDIA L4 3-Way Stratified 24-Position Sprint (Q4_K_M GGUF + serving_v7)
| Contender | Sprint Accuracy (24) |
Trap Blunders | Engine p50 |
Engine Mean | WAN p50 |
Mean GPU Forward Passes |
|---|---|---|---|---|---|---|
One-Shot Gemma Gladiator E2B · v7 Parallel-Tree |
75.00% |
0.00% |
160.19 ms |
157.25 ms |
214.35 ms |
2.42 (100% parallel-tree) |
Brainsurged Chessmaster 4B · v7 |
70.83% |
4.17% |
260.84 ms |
261.08 ms |
339.73 ms |
2.42 |
Jev 1.13.0 (api.typesafe.ai) |
83.33% |
8.33% |
— | — | 177.42 ms |
— |
3. A100 Holdout Benchmark Suite (Holdout-Chessmaster-120 & Holdout-240)
Source record: exp12_gladiator_campaign_results.json. Zero piece-placement FEN overlap (0/1,460) against both Holdout-Chessmaster-120 and all 331 Jevlab chess_lab FENs.
| Model | Holdout-Chessmaster-120 (Zero-Think) |
Holdout-Chessmaster-120 (Micro-Blink) |
Trap Blunder Rate | Passed-Pawn (30) |
Mate-in-1 (30) |
Poisoned Check (30) |
Queen Guard (30) |
Sequential-Agentic-120 |
Combined Holdout-240 |
|---|---|---|---|---|---|---|---|---|---|
Raw google/gemma-4-E2B-it |
7.50% (0.83% greedy) |
0.00% (100% loop) |
30.83% |
0.00% |
0.00% |
20.00% |
10.00% |
— | — |
One-Shot Gemma Gladiator E2B (1 Loop) |
77.50% (+70.00 pp) |
77.50% (29.1 tok) |
0.83% (0.0% Blink) |
100.00% |
100.00% |
60.00% |
50.00% |
100.00% (0.0000 Brier) |
94.16% (0.0% trap) |
Chessmaster Qwen3.5-4B (6 Loops) |
80.83% |
80.83% |
0.00% |
100.00% |
100.00% |
66.67% |
56.67% |
100.00% |
98.75% |
Anatomical Gemma 4 Surgery Design (35 Layers, 18 KB/tok KV Cache)
Why does Gemma 4 E2B hit sub-110 ms engine latency while absorbing a 6-round curriculum in a single loop?
- Zone 1 — Frozen Sensory Stem & Per-Layer Embeddings (
Layers 0..2+embed_tokens_per_layer,0.0000Drift):- Gemma 4 injects a fresh
256-dim Per-Layer Embedding (PLE) bypass into every layer (0..34). FreezingLayers 0..2and thePLElookup table bit-for-bit preserves raw JSON syntax and board-coordinate token grounding.
- Gemma 4 injects a fresh
- Zone 2 & 3 — Cortical Rank-24 LoRA (
Layers 3..32, includingLayers 20..34Zero-New-KV Shared Fold):- Gemma 4 alternates
4:1512-token Sliding-Window Attention (head_dim=256,k_eq_v) with Global Attention (head_dim=512), and layers20..34(15of35layers!) allocate zero new KV cache, reading directly from layers18–19(18 KB/tokentotal KV footprint). - Rank-24 LoRA (
alpha=48,234linear modules,33,951,744scalars =0.7282%of the language backbone) trained across2,780examples in16.4 minutesonNVIDIA A100-40GB(loss: 2.5697 → 0.0547).
- Gemma 4 alternates
- Zone 4 — Zero-Gradient Prefrontal Roof Calibration (
Layers 33..34 + lm.norm,autograd=False):- Accounts for Gemma 4's
post_feedforward_layernorm,layer_scalar, andfinal_logit_softcapping=30.0, selectingbeta_temp = 0.90(0/16unclosed<|channel>thought ... <channel|>loops,30.9swall clock).
- Accounts for Gemma 4's
- Stage 3 — Multimodal Tower Stripping +
serving_v7_gladiator2-Pass Parallel-Tree Engine:- Strips Vision & Audio towers during
Q4_K_MGGUF conversion (3.19 GiB) and batches candidate move suffixes across parallel sequence branches. Pass counts depend on the position (2.42 mean in the recorded sprint).
- Strips Vision & Audio towers during
Quickstart (Ollama / Stock llama.cpp / serving_v7_gladiator)
1. Run Locally with Ollama
ollama run hf.co/AIHeikki/brainsurged-gladiator-gemma4-e2b
2. Run with Stock llama.cpp (llama-server)
llama-server \
--model brainsurged-gladiator-gemma4-e2b-Q4_K_M.gguf \
--gpu-layers 99 \
--flash-attn on \
--jinja \
--reasoning-budget 0
3. Build & Run serving_v7_gladiator 2-Pass Parallel-Tree CUDA Engine
See serving_v7_gladiator/README.md:
cd serving_v7_gladiator
python3 stage_models_from_hf.py
docker build --platform linux/amd64 -t jevlab-serving-v7-gladiator .
Repository Layout & SHA-256 Verification
| Path | Artifact | Size | SHA-256 |
|---|---|---|---|
brainsurged-gladiator-gemma4-e2b-Q4_K_M.gguf |
Flagship text-only Q4_K_M GGUF |
3.19 GiB (3,427,880,704 B) |
d28b4087b1c7386e2c1531c209ceeb3f5e46d6976ebd06cb7356c6ff302878ed |
patches_and_attestations/v6/ |
One-shot BF16 surgical delta .safetensors & JSON attestation |
136.8 MiB (143,453,552 B) |
brainsurged-gladiator-gemma4-e2b-oneshot-surgical-delta.safetensors |
serving_v7_gladiator/ |
jev_jump_engine.cpp, fast_gateway.py, Dockerfile, smoke_test_build.py |
~75 KiB |
2-Pass Parallel Multi-seq_id Tree-Batch CUDA serving stack |
reports/gladiator_evaluations/ |
Live PGNs, GLADIATOR_ARENA_REPORT.md, exp12_gladiator_campaign_results.json |
~210 KiB |
Complete A100 holdout, Stockfish blunder audit, and L4 match records |
assets/gemma4_e2b_cortical_atlas.jpg |
35-layer Gemma 4 E2B anatomical cutaway diagram | 790 KiB |
Visual architecture reference |
License & Attribution
Released under Apache-2.0, inheriting the license of google/gemma-4-E2B-it (Gemma 4 License).
- Downloads last month
- 4
4-bit
