Instructions to use exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm") model = AutoModelForCausalLM.from_pretrained("exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm
- SGLang
How to use exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm 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 "exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm" \ --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": "exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm", "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 "exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm" \ --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": "exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm with Docker Model Runner:
docker model run hf.co/exolabs/gemma-4-E4B-it-Q4_K_M-dequant-bf16-vllm
Configuration Parsing Warning:In config.json: "num_experts" must be a number
Gemma 4 E4B IT Q4_K_M GGUF Dequantized BF16 for vLLM
This private artifact was converted from unsloth/gemma-4-E4B-it-GGUF file gemma-4-E4B-it-Q4_K_M.gguf into standalone Gemma4 text safetensors for Transformers and vLLM.
The converter streams GGUF tensors, dequantizes them to fp32, maps Gemma4 text/PLE tensor names, then casts once to BF16 before writing sharded safetensors. The output config is rewritten from the multimodal gemma4 wrapper to standalone gemma4_text / Gemma4ForCausalLM.
Validation
- GGUF dry-run mapping: 720 input tensors; 719 mapped,
rope_freqs.weightskipped as runtime metadata. - Output index: 719 HF keys, 5 safetensor shards,
15,036,138,068bytes. - Transformers load: passed as
Gemma4ForCausalLMwith tied embeddings and no missing language weights. - Numeric spot-checks: passed with
max_abs_vs_bf16=0for sampled embeddings, PLE projection/norm, layer norms, attention, and layer scalar tensors. - Transformers chat-template generation smoke: passed.
- vLLM chat-completions smoke: passed on vLLM 0.23.0.
vLLM command used
VLLM_USE_FLASHINFER_SAMPLER=0 vllm serve /path/to/model --served-model-name gemma-4-e4b-it-gguf-q4_k_m-bf16 --dtype bfloat16 --max-model-len 4096 --gpu-memory-utilization 0.5 --trust-remote-code
This is an instruction model; use the chat template or /v1/chat/completions for behavioral smoke tests.
- Downloads last month
- 19