Instructions to use Rapid42/gemma-4-E4B-it-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Rapid42/gemma-4-E4B-it-MLX with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Rapid42/gemma-4-E4B-it-MLX") config = load_config("Rapid42/gemma-4-E4B-it-MLX") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Rapid42/gemma-4-E4B-it-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Rapid42/gemma-4-E4B-it-MLX"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Rapid42/gemma-4-E4B-it-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Rapid42/gemma-4-E4B-it-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Rapid42/gemma-4-E4B-it-MLX"
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 Rapid42/gemma-4-E4B-it-MLX
Run Hermes
hermes
Rapid42/gemma-4-E4B-it-MLX
Gemma 4 (~8B, E4B variant) — MLX format for Apple Silicon, instruction-tuned
Converted and optimized by Rapid42 — engineering tools for fast pipelines.
What This Is
This is Gemma 4 E4B (Google DeepMind's 4th generation Gemma, ~8B parameters in the E4B multimodal variant) converted to MLX format for native Apple Silicon inference. Instruction-tuned (-it) for chat and task-following.
Gemma 4 is Google's latest open model family — multimodal (text + image input), with strong performance on reasoning, coding, and multilingual tasks.
- Parameters: ~8B (E4B = Efficient 4B-class, actual ~8B)
- Modality: Text + Image input → Text output
- Format: MLX (Apple Silicon native)
- Base model: google/gemma-4-it
- License: Apache 2.0
Hardware Requirements
| Device | RAM | Experience |
|---|---|---|
| Any M-series Mac (16GB+) | ~8GB | ✅ Fast and smooth |
| M1 MacBook Air (8GB) | ~8GB | ⚠️ Tight — works but little headroom |
| M3 Max / Pro | ~8GB | ✅ Near-instant |
A practical choice for multimodal tasks on any Apple Silicon machine.
Quick Start
pip install mlx-lm
Text chat:
from mlx_lm import load, generate
model, tokenizer = load("Rapid42/gemma-4-E4B-it-MLX")
messages = [{"role": "user", "content": "What are the key advantages of MLX over PyTorch for Apple Silicon?"}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_dict=False
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=512, verbose=True)
print(response)
With image input (via MLX-VLM):
pip install mlx-vlm
python -m mlx_vlm.generate \
--model Rapid42/gemma-4-E4B-it-MLX \
--prompt "Describe what you see in this image." \
--image /path/to/image.jpg
Why Gemma 4?
Gemma 4 represents a significant step up from Gemma 2/3:
- Multimodal — understands images, not just text
- Improved reasoning — stronger on benchmarks vs Gemma 3 of the same size
- Apache 2.0 — fully open license, commercial use allowed
- Google DeepMind quality — trained on the same infrastructure as Gemini
The E4B variant is the sweet spot: multimodal capability at 8B-class efficiency.
Gemma 4 License
Apache 2.0. Full details: ai.google.dev/gemma/docs/gemma_4_license
Authors: Google DeepMind
About Rapid42
Rapid42 builds fast, precise engineering tools — from VFX pipeline utilities to optimized ML model distributions.
→ rapid42.com · ExrToPsd · Level Careers
- Downloads last month
- 90
4-bit