Instructions to use wyattearp/Gemma-4-E4B-text-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wyattearp/Gemma-4-E4B-text-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wyattearp/Gemma-4-E4B-text-base") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("wyattearp/Gemma-4-E4B-text-base") model = AutoModelForCausalLM.from_pretrained("wyattearp/Gemma-4-E4B-text-base", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wyattearp/Gemma-4-E4B-text-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wyattearp/Gemma-4-E4B-text-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyattearp/Gemma-4-E4B-text-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wyattearp/Gemma-4-E4B-text-base
- SGLang
How to use wyattearp/Gemma-4-E4B-text-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "wyattearp/Gemma-4-E4B-text-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyattearp/Gemma-4-E4B-text-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "wyattearp/Gemma-4-E4B-text-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wyattearp/Gemma-4-E4B-text-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wyattearp/Gemma-4-E4B-text-base with Docker Model Runner:
docker model run hf.co/wyattearp/Gemma-4-E4B-text-base
Google Gemma-4-E4B-text-base (Modality-Stripped Text Backbone)
Gemma-4-E4B-text-base is a clean, text-only extraction of Google's Gemma-4-E4B-it instruction-tuned model. By decoupling and stripping multimodal projections (vision and audio towers), this checkpoint provides a pure language model backbone optimized for text, software engineering, and tool-calling deployments.
⚡ Why Modality-Stripped?
Standard Gemma-4 checkpoints integrate multimodal encoders and cross-attention projectors. For dedicated text generation, reasoning, and coding agent workloads:
- VRAM Reduction: Saves memory otherwise reserved for vision transformer buffers and projector parameters.
- Simplified Inference: Eliminates multimodal input pre-processing overhead and dependencies in downstream serving engines (vLLM, TensorRT-LLM, llama.cpp).
- Pristine Weight Fidelity: The underlying text transformer parameters (
model.language_model.*) are 100% identical bit-for-bit to the upstream release.
🔬 Model Profile
- Parameter Count: $\sim 4.2\text{B}$ parameters.
- Context Length: 131,072 tokens.
- Format: Standard Hugging Face
safetensorscompatible withtransformers >= 4.40.0. - Vocabulary Size: 256,000 tokens.
⚠️ Important: Tool-Calling Parser Bugfix in vLLM
- Upstream Bug Report: vllm-project/vllm#54256
- Official Pull Request: vllm-project/vllm#54257 —
[Bugfix][Parser] Support bare call: and whitespace-free channel transitions in Gemma4 parser
🚀 Serving with vLLM
vllm serve wyattearp/Gemma-4-E4B-text-base \
--host 0.0.0.0 \
--port 8000 \
--dtype bfloat16 \
--max-model-len 131072 \
--tool-call-parser gemma4 \
--reasoning-parser gemma4 \
--enable-auto-tool-choice
📄 License
Inherits upstream Gemma Terms of Use from Google DeepMind.
- Downloads last month
- -