Instructions to use mavis-ai/Gemma4-E2B-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mavis-ai/Gemma4-E2B-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("mavis-ai/Gemma4-E2B-MLX") config = load_config("mavis-ai/Gemma4-E2B-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 mavis-ai/Gemma4-E2B-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 "mavis-ai/Gemma4-E2B-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": "mavis-ai/Gemma4-E2B-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mavis-ai/Gemma4-E2B-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 "mavis-ai/Gemma4-E2B-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 mavis-ai/Gemma4-E2B-MLX
Run Hermes
hermes
- OpenClaw new
How to use mavis-ai/Gemma4-E2B-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mavis-ai/Gemma4-E2B-MLX"
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 "mavis-ai/Gemma4-E2B-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
mavis-ai/Gemma4-E2B-MLX
This repository contains an MLX-ready full-precision distribution of Google's official Gemma 4 E2B instruction-tuned model, prepared for local inference on Apple Silicon Macs.
Important: this is the same upstream model as google/gemma-4-E2B-it. It is not a new model, not a fine-tune, and not a quantized variant. The only packaging change is conversion to the MLX file layout for local Apple Silicon inference.
Important Notice
This repository is hosted primarily as a dedicated engine source for the R.E.V.I.S. application ecosystem. You are free to download and use this model package for your own local MLX projects or workflows, subject to the Apache License 2.0 and Google's Gemma terms.
For the original model card, architecture details, intended usage, limitations, and evaluation information, refer to the official upstream model:
- Base model: https://huggingface.co/google/gemma-4-E2B-it
Model Identity
This package is intended to match the official Google Gemma 4 E2B instruction-tuned checkpoint in model behavior and weights. MAVIS has not applied additional training, alignment, pruning, merging, adapter injection, architecture changes, or quantization.
The files are redistributed in MLX format so that local MLX / mlx-vlm runtimes can load the model directly on Apple Silicon Macs.
Precision
This is the full MLX build, not a Q4/Q5/Q6/Q8 build:
- Source checkpoint:
google/gemma-4-E2B-it - Weight precision: BF16 where represented by the upstream conversion path
- Quantization: none
- Fine-tuning: none
- Architecture changes: none
If you need a smaller download or lower memory footprint, use the separate MAVIS Q4/Q5/Q6/Q8 repositories instead.
Optimized for R.E.V.I.S. (Local Cognitive OS)
We host and test this model package to serve as a compact local reasoning and judgment engine for R.E.V.I.S.
R.E.V.I.S. is a 100% local Cognitive OS for Multi-Agentic AI. It transforms your Mac devices into a distributed Agentic Swarm via zero-config Wi-Fi clustering, allowing you to run heavy AI workloads like recursive web research, dynamic RAG generation, and multi-step logic without killing single-machine performance.
If you are interested in pushing the limits of local AI and open-weight models, check out our project.
- Official Website: https://mavis-ai.co.jp/revis/
- Watch the 13-min Raw Demo (Multi-node Dynamic RAG): https://x.gd/LxaBF
- Follow our updates on X: https://x.com/mavis_ai_jp
Usage
Install or update the MLX runtime you use for Gemma 4 / multimodal models:
pip install -U mlx mlx-lm mlx-vlm huggingface_hub hf_xet
Download the model:
hf download mavis-ai/Gemma4-E2B-MLX \
--local-dir ~/Models/mlx/Gemma4-E2B-MLX
Run a quick text generation test:
python -m mlx_vlm.generate \
--model ~/Models/mlx/Gemma4-E2B-MLX \
--max-tokens 256 \
--temperature 0.0 \
--prompt "Say OK."
Usage Notes
Gemma 4 E2B is the smallest model in this branch and is suited for fast local RAG support, routing, lightweight judgment, and repeated agentic tasks.
For lower memory use, the Q4/Q5/Q6/Q8 MLX variants are available as separate repositories. Those variants intentionally use mixed quantization policies and are not full-precision builds.
License
This repository redistributes an MLX-format derivative of Google's Gemma 4 E2B instruction-tuned release, which is distributed by Google under the Apache License 2.0.
This derivative is likewise distributed under the Apache License 2.0. A copy of the license is included in the LICENSE file in this repository, and can also be found at https://www.apache.org/licenses/LICENSE-2.0.
Modification Notice
Compared with the official Google source checkpoint, this repository applies only the following packaging modification:
The source checkpoint was converted to MLX format for local MLX inference.
No quantization, fine-tuning, additional training, or architecture-level modification has been applied.
- Downloads last month
- 23
Quantized