Instructions to use Xylolabs/gemma-4-31B-it-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/gemma-4-31B-it-MLX-4bit 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("Xylolabs/gemma-4-31B-it-MLX-4bit") 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 Xylolabs/gemma-4-31B-it-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/gemma-4-31B-it-MLX-4bit"
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": "Xylolabs/gemma-4-31B-it-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Xylolabs/gemma-4-31B-it-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Xylolabs/gemma-4-31B-it-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Xylolabs/gemma-4-31B-it-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/gemma-4-31B-it-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Xylolabs/gemma-4-31B-it-MLX-4bit 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 "Xylolabs/gemma-4-31B-it-MLX-4bit"
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 Xylolabs/gemma-4-31B-it-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Xylolabs/gemma-4-31B-it-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/gemma-4-31B-it-MLX-4bit"
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 "Xylolabs/gemma-4-31B-it-MLX-4bit" \ --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"
Download MANIFEST from Xylolabs/gemma-4-31B-it-MLX-4bit: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/Xylolabs/gemma-4-31B-it-MLX-4bit/resolve/main/MANIFEST
- Command line
-
hf download hf://Xylolabs/gemma-4-31B-it-MLX-4bit/MANIFEST
-
curl -L -o MANIFEST https://huggingface.co/Xylolabs/gemma-4-31B-it-MLX-4bit/resolve/main/MANIFEST
1.74 kB
| cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE | |
| c7eebc0e1bf983124e53a843fbd77baa019168ae77d51df6df1d2d6efab2f2d4 NOTICE | |
| 7f7ab51264d05c6d0a56e24e3e0cc430815e461c6cce5a61ded4c1d0aa8f6213 README.md | |
| 7be017fb8d30317b4c030eac8320d330fd701d7ec48e53efabe80c9334429d1b accuracy-by-size.csv | |
| fe7d520555b8e501d7370250328189e92e08c8e57e81029b61b317804f9ec51a accuracy-kl-dark.png | |
| 325376ac55e213a39cb02c12e0b8e5b118d228c92b54996b61ad1ec0044d9c5a accuracy-kl-raw-dark.png | |
| ae24f056bc6cca594e9ad18fb5764d5ee1618ae22eb9a6a0d1fe70e382248988 accuracy-kl-raw.png | |
| afd0b8c127f300e154d269f27cdcf116ef59abde38b84f2254e28c323b47e66f accuracy-kl.png | |
| 5565e3cdb960c4a9e6ccd93307b28b07fba1eceb09016d1805a136cfd3a6f4f8 accuracy-top1-dark.png | |
| 9efe36356c3f2567e9e9e576ca32d04ef46c519d2c14829011726b0cf9a18a4c accuracy-top1.png | |
| ae53464bf3be25802b3a5b37def7fd89667067d7577049b3b2d74c4d8de4c6d4 chat_template.jinja | |
| eae013b17326a775f51bae71cf6668088a94cdaa47d53f401e76272b95de36fb config.json | |
| d4226bbe3117d2d253ba4609720ba82c6c4ce4627a9a6ae05387c78983ac03de generation_config.json | |
| 1b3239b2c42bddc6aa7b35c49417ec54e4500597715c10f96e6fb6ce9d058341 model-00001-of-00004.safetensors | |
| ec04c19a39127464f954c54961d102e55ee60037fcd961d3b8ef56567db38290 model-00002-of-00004.safetensors | |
| f00e3e5f6a64db1ea49aa6c4ab40b8b035d27b623bf3b398cc09e3645e995b3f model-00003-of-00004.safetensors | |
| 6492d118875e76ee7a01016f9dfed6ba40d7535ea127052bcb13de4c1d1f2564 model-00004-of-00004.safetensors | |
| adbfcdb5440eabe6456e936f64e1630c359f67942dbd933dc50f3d752fdf5c66 model.safetensors.index.json | |
| cc8d3a0ce36466ccc1278bf987df5f71db1719b9ca6b4118264f45cb627bfe0f tokenizer.json | |
| 8227f6f1d959e2ded8be6351bf863a77b781bfd93b82b01e6f65d5d91d5cecb8 tokenizer_config.json | |