gemma-4-E2B-it-text-only-non-thinking
A variant of tuandunghcmut/gemma-4-E2B-it-text-only with a 3-layer non-thinking enforcement in the chat template. The model weights are identical — only the chat template is modified to guarantee the model never enters thinking/reasoning mode.
3-Layer Non-Thinking Enforcement
| Layer | Mechanism | What it blocks |
|---|---|---|
| 1 | Jinja set enable_thinking = false |
<|think|> token never injected into prompt |
| 2 | System prompt instruction | Model instructed to never output <|channel>thought blocks |
| 3 | Empty thought-channel prefill | <|channel>thought\n\n<channel|> pre-closed at generation start |
Deploy with vLLM ✅
vllm serve tuandunghcmut/gemma-4-E2B-it-text-only-non-thinking \
--dtype bfloat16 \
--max-model-len 32768
Query via OpenAI-compatible API:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
response = client.chat.completions.create(
model="gemma-4-E2B-it-text-only-non-thinking",
messages=[{"role": "user", "content": "What is the capital of Vietnam?"}],
)
print(response.choices[0].message.content)
# → Direct answer, no thinking preamble
Use with 🤗 Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"tuandunghcmut/gemma-4-E2B-it-text-only-non-thinking",
dtype=torch.bfloat16,
device_map="auto",
)
tok = AutoTokenizer.from_pretrained(
"tuandunghcmut/gemma-4-E2B-it-text-only-non-thinking"
)
messages = [{"role": "user", "content": "Explain transformer architecture briefly."}]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=256)
print(tok.decode(out[0], skip_special_tokens=True))
Compared to E4B variant
gemma-4-E2B-it-text-only-non-thinking |
gemma-4-E4B-it-text-only-non-thinking |
|
|---|---|---|
| Parameters | ~4.6B | ~7.5B |
| Hidden size | 1536 | 2560 |
| Layers | 35 | 42 |
| Non-thinking | ✅ 3-layer | ✅ 3-layer |
| VRAM (bf16) | ~9 GB | ~15 GB |
Source model
- Base: tuandunghcmut/gemma-4-E2B-it-text-only
- Original: google/gemma-4-E2B-it
License
Inherits the Gemma license.