Instructions to use DreamFoundries/gemma-4-E2B-it-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use DreamFoundries/gemma-4-E2B-it-6bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("DreamFoundries/gemma-4-E2B-it-6bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use DreamFoundries/gemma-4-E2B-it-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "DreamFoundries/gemma-4-E2B-it-6bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "DreamFoundries/gemma-4-E2B-it-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use DreamFoundries/gemma-4-E2B-it-6bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "DreamFoundries/gemma-4-E2B-it-6bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "DreamFoundries/gemma-4-E2B-it-6bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DreamFoundries/gemma-4-E2B-it-6bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use DreamFoundries/gemma-4-E2B-it-6bit 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 "DreamFoundries/gemma-4-E2B-it-6bit"
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 DreamFoundries/gemma-4-E2B-it-6bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use DreamFoundries/gemma-4-E2B-it-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "DreamFoundries/gemma-4-E2B-it-6bit"
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 "DreamFoundries/gemma-4-E2B-it-6bit" \ --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"
Add files using upload-large-folder tool
Browse files- README.md +4 -2
- model.safetensors +2 -2
- model.safetensors.index.json +1 -3
README.md
CHANGED
|
@@ -24,11 +24,13 @@ This repository contains an MLX-LM conversion of [google/gemma-4-E2B-it](https:/
|
|
| 24 |
- Quantization: MLX-LM affine quantization
|
| 25 |
- Bits: 6-bit
|
| 26 |
- Group size: 64
|
| 27 |
-
- Local MLX folder size at upload time: 3.
|
| 28 |
-
- Local safetensors weight size at upload time: 3.
|
| 29 |
|
| 30 |
This Gemma conversion follows the MLX-LM Gemma 4 shared-KV topology and uses non-strict checkpoint loading so extra HF tensors outside that topology are discarded during conversion.
|
| 31 |
|
|
|
|
|
|
|
| 32 |
## Usage
|
| 33 |
|
| 34 |
```bash
|
|
|
|
| 24 |
- Quantization: MLX-LM affine quantization
|
| 25 |
- Bits: 6-bit
|
| 26 |
- Group size: 64
|
| 27 |
+
- Local MLX folder size at upload time: 3.55 GiB
|
| 28 |
+
- Local safetensors weight size at upload time: 3.52 GiB
|
| 29 |
|
| 30 |
This Gemma conversion follows the MLX-LM Gemma 4 shared-KV topology and uses non-strict checkpoint loading so extra HF tensors outside that topology are discarded during conversion.
|
| 31 |
|
| 32 |
+
For mlx-swift compatibility, `per_layer_model_projection` was left unquantized while the rest of the eligible linear layers were quantized.
|
| 33 |
+
|
| 34 |
## Usage
|
| 35 |
|
| 36 |
```bash
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10b198392de58d1dc0fedb3d0a62aeae323c13e2cd67cabb40f5e565a4ff2f89
|
| 3 |
+
size 3777536556
|
model.safetensors.index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
-
"total_size":
|
| 4 |
"total_parameters": 4628569344
|
| 5 |
},
|
| 6 |
"weight_map": {
|
|
@@ -1096,8 +1096,6 @@
|
|
| 1096 |
"language_model.model.layers.9.self_attn.v_proj.scales": "model.safetensors",
|
| 1097 |
"language_model.model.layers.9.self_attn.v_proj.weight": "model.safetensors",
|
| 1098 |
"language_model.model.norm.weight": "model.safetensors",
|
| 1099 |
-
"language_model.model.per_layer_model_projection.biases": "model.safetensors",
|
| 1100 |
-
"language_model.model.per_layer_model_projection.scales": "model.safetensors",
|
| 1101 |
"language_model.model.per_layer_model_projection.weight": "model.safetensors",
|
| 1102 |
"language_model.model.per_layer_projection_norm.weight": "model.safetensors"
|
| 1103 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"metadata": {
|
| 3 |
+
"total_size": 3777395270,
|
| 4 |
"total_parameters": 4628569344
|
| 5 |
},
|
| 6 |
"weight_map": {
|
|
|
|
| 1096 |
"language_model.model.layers.9.self_attn.v_proj.scales": "model.safetensors",
|
| 1097 |
"language_model.model.layers.9.self_attn.v_proj.weight": "model.safetensors",
|
| 1098 |
"language_model.model.norm.weight": "model.safetensors",
|
|
|
|
|
|
|
| 1099 |
"language_model.model.per_layer_model_projection.weight": "model.safetensors",
|
| 1100 |
"language_model.model.per_layer_projection_norm.weight": "model.safetensors"
|
| 1101 |
}
|