Instructions to use baa-ai/Gemma-4-31B-it-RAM-3bit-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use baa-ai/Gemma-4-31B-it-RAM-3bit-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("baa-ai/Gemma-4-31B-it-RAM-3bit-MLX") config = load_config("baa-ai/Gemma-4-31B-it-RAM-3bit-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
- LM Studio
- Pi new
How to use baa-ai/Gemma-4-31B-it-RAM-3bit-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 "baa-ai/Gemma-4-31B-it-RAM-3bit-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": "baa-ai/Gemma-4-31B-it-RAM-3bit-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use baa-ai/Gemma-4-31B-it-RAM-3bit-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 "baa-ai/Gemma-4-31B-it-RAM-3bit-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 baa-ai/Gemma-4-31B-it-RAM-3bit-MLX
Run Hermes
hermes
Gemma-4-31B-it — RAM 3bit (MLX)
A quantized build of google/gemma-4-31B-it produced by baa.ai. Retains the full vision tower, unlike other pre-quantized MLX variants of this model.
| Property | Value |
|---|---|
| Size on disk | 19.49 GB |
| Format | MLX |
| Base model | google/gemma-4-31B-it |
| Vision tower | Retained |
Usage
from mlx_vlm import load, generate
model, processor = load("baa-ai/Gemma-4-31B-it-RAM-3bit-MLX")
prompt = processor.tokenizer.apply_chat_template(
[{"role": "user", "content": [{"type": "text", "text": "Hello!"}]}],
add_generation_prompt=True, tokenize=False,
)
result = generate(model, processor, prompt, max_tokens=512, verbose=True)
print(result.text)
Benchmark results
Measured on vanilla MMLU (500 questions) and MathVision MCQ (20 questions).
Unsloth Gemma 4 MLX variants strip the vision tower — they cannot process images.
This model vs Unsloth Gemma-4-31B 3bit (500-question MMLU):
- RAM: 89.2% · Unsloth: 75.6% · Gap: +13.6 pp
- Size: Unsloth 19.52 GB → RAM 19.49 GB (30 MB smaller, vision retained)
- MathVision: RAM 50.0% · Unsloth: N/A (no vision)
Full results table — all 31B variants
80-question run
| Bits | Unsloth MMLU | RAM MMLU | GAP | RAM Vision |
|---|---|---|---|---|
| 8bit | 70.7% | 90.0% | +19.3 | 55.0% |
| 4bit | 73.8% | 86.2% | +12.4 | 60.0% |
| 3bit | 72.5% | 86.2% | +13.7 | 50.0% |
500-question run
| Bits | Unsloth MMLU | RAM MMLU | GAP |
|---|---|---|---|
| 8bit | 71.8% | 90.4% | +18.6 |
| 4bit | 71.8% | 89.0% | +17.2 |
| 3bit | 75.6% | 89.2% | +13.6 |
License
Inherited from the upstream Gemma license.
Black Sheep AI Products
Shepherd — Private AI deployment platform that shrinks frontier models by 50-60% through RAM compression, enabling enterprises to run sophisticated AI on single GPU instances or Apple Silicon hardware. Deploy in your VPC with zero data leaving your infrastructure. Includes CI/CD pipeline integration, fleet deployment across Apple Silicon clusters, air-gapped and sovereign deployment support, and multi-format export (MLX, GGUF). Annual cloud costs from ~$2,700 — or run on a Mac Studio for electricity only.
Watchman — Capability audit and governance platform for compressed AI models. Know exactly what your quantized model can do before it goes live. Watchman predicts which capabilities survive compression in minutes — replacing weeks of benchmarking. Includes compliance-ready reporting for regulated industries, quality valley warnings for counterproductive memory allocations, instant regression diagnosis tracing issues to specific tensors, and 22 adversarial security probes scanning for injection, leakage, hallucination, and code vulnerabilities.
Learn more at baa.ai — Sovereign AI.
- Downloads last month
- 486
4-bit
