Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

Rapid42
/
gemma-4-E2B-it-MLX

Image-Text-to-Text
MLX
Safetensors
English
multilingual
gemma4
quantized
apple-silicon
gemma
google
multimodal
lightweight
fast-inference
conversational
4-bit precision
Model card Files Files and versions
xet
Community

Instructions to use Rapid42/gemma-4-E2B-it-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • MLX

    How to use Rapid42/gemma-4-E2B-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-E2B-it-MLX")
    config = load_config("Rapid42/gemma-4-E2B-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-E2B-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-E2B-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-E2B-it-MLX"
            }
          ]
        }
      }
    }
    Run Pi
    # Start Pi in your project directory:
    pi
  • Hermes Agent

    How to use Rapid42/gemma-4-E2B-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-E2B-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-E2B-it-MLX
    Run Hermes
    hermes
  • Atomic Chat
  • OpenClaw

    How to use Rapid42/gemma-4-E2B-it-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 "Rapid42/gemma-4-E2B-it-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 "Rapid42/gemma-4-E2B-it-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"
gemma-4-E2B-it-MLX
3.59 GB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
slothuus's picture
slothuus
Add detailed model card with hardware requirements, quickstart, and Rapid42 links
71ad082 verified 5 months ago
  • .gitattributes
    1.57 kB
    Add Gemma 4 model from Unsloth 5 months ago
  • README.md
    3.42 kB
    Add detailed model card with hardware requirements, quickstart, and Rapid42 links 5 months ago
  • chat_template.jinja
    11.9 kB
    Add Gemma 4 model from Unsloth 5 months ago
  • config.json
    83.1 kB
    Add Gemma 4 model from Unsloth 5 months ago
  • generation_config.json
    208 Bytes
    Add Gemma 4 model from Unsloth 5 months ago
  • model.safetensors
    3.55 GB
    xet
    Add Gemma 4 model from Unsloth 5 months ago
  • model.safetensors.index.json
    108 kB
    Add Gemma 4 model from Unsloth 5 months ago
  • tokenizer.json
    32.2 MB
    xet
    Add Gemma 4 model from Unsloth 5 months ago
  • tokenizer_config.json
    2.7 kB
    Add Gemma 4 model from Unsloth 5 months ago