Instructions to use stamsam/MedusaGemma-E4B_MLX_4Bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use stamsam/MedusaGemma-E4B_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("stamsam/MedusaGemma-E4B_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
- LM Studio
- Pi new
How to use stamsam/MedusaGemma-E4B_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 "stamsam/MedusaGemma-E4B_MLX_4Bit"
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": "stamsam/MedusaGemma-E4B_MLX_4Bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use stamsam/MedusaGemma-E4B_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 "stamsam/MedusaGemma-E4B_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 stamsam/MedusaGemma-E4B_MLX_4Bit
Run Hermes
hermes
- MLX LM
How to use stamsam/MedusaGemma-E4B_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 "stamsam/MedusaGemma-E4B_MLX_4Bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "stamsam/MedusaGemma-E4B_MLX_4Bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stamsam/MedusaGemma-E4B_MLX_4Bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
MedusaGemma-E4B-MLX-4Bit
Tagline: One spine. Many heads.
Started as a MacBook Pro experiment and grew into a full composite release.
Model Summary
MedusaGemma-E4B-MLX-4Bit is the compact Apple Silicon build of MedusaGemma-E4B: a fused local model for offline inference, reasoning, and practical work.
What Went Into It
This is the 4-bit MLX release for Apple Silicon local use. The donor lineage and adaptation work are baked in so this repo is a single downloadable model artifact.
Primary lineage:
google/gemma-4-E4B-itDavidAU/gemma-4-E4B-it-The-DECKARD-HERETIC-UNCENSORED-ThinkingDavidAU/gemma-4-E4B-it-The-DECKARD-V2-Strong-HERETIC-UNCENSORED-ThinkingJiunsong/supergemma4-e4b-abliterated
Stamsam custom dojo / training
The adaptation stack was built on:
pocket-polymath-seam-adapterpocket-polymath-legacy-adapterpocket-polymath-legacy-4096-adapterpocket-polymath-broad-growth-adapterpocket-polymath-ultimate-dojo-adapter
Synthetic dojo data came from glm-5.1:cloud via Ollama, plus Gemini-generated material from the same workflow.
Quantization Notes
- Format: MLX
- Quantization: 4-bit
- Target hardware: Apple Silicon
Best For
- fast Apple Silicon local inference
- offline assistant work
- structured reasoning and business analysis
- general writing and summarization
- practical code generation
- integration with the Pocket Polymath stack
Keep In Mind
- The bare MLX build can still make arithmetic mistakes without the stack.
- The bare MLX build can still miss exact refusal behavior without the stack.
- The bare MLX build can still miss strict formatting constraints without validators.
Evaluation Snapshot
- Fresh full holdout: 40/40
- External-lite cleaned: 256/265, 96.6%
- MBPP repair mode: 20/20 final on the cleaned slice and fresh holdout
- Reasoning leaks: 0
- Bad claims: 0
Safety and Reliability
The Pocket Polymath stack adds:
- reasoning leak guard
- missing-data refusal router
- arithmetic router
- structured-output validators
- completion checks
- optional sandboxed code verifier/repair mode
Release Names
- Raw model:
MedusaGemma-E4B - MLX 4-bit:
MedusaGemma-E4B-MLX-Q4 - Default stack:
Pocket Polymath: MedusaGemma-E4B RC2 - Optional code mode:
Pocket Polymath: MedusaGemma-E4B RC2.1 Code Repair
- Downloads last month
- 24
4-bit
