Instructions to use OsaurusAI/Gemma-4-31B-it-JANG_4M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OsaurusAI/Gemma-4-31B-it-JANG_4M 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("OsaurusAI/Gemma-4-31B-it-JANG_4M") config = load_config("OsaurusAI/Gemma-4-31B-it-JANG_4M") # 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 OsaurusAI/Gemma-4-31B-it-JANG_4M with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Gemma-4-31B-it-JANG_4M"
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": "OsaurusAI/Gemma-4-31B-it-JANG_4M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use OsaurusAI/Gemma-4-31B-it-JANG_4M 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 "OsaurusAI/Gemma-4-31B-it-JANG_4M"
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 OsaurusAI/Gemma-4-31B-it-JANG_4M
Run Hermes
hermes
Gemma 4 31B-it — JANG_4M (Mixed-Precision, 4-bit)
JANG — Jang Adaptive N-bit Grading | Mixed-Precision Quantization for Apple Silicon
Osaurus natively supports JANG models. Download at osaurus.ai.
Model Details
| Property | Value |
|---|---|
| Base Model | google/gemma-4-31b-it |
| Architecture | Dense Transformer + Hybrid Sliding/Global Attention |
| Parameters | 31B (29.2B weights) |
| Profile | JANG_4M (CRITICAL=8-bit, COMPRESS=4-bit) |
| Avg Bits/Weight | 5.1 |
| Model Size | 18 GB |
| Vision | Yes (multimodal, float16 passthrough) |
| Context Length | 128K tokens |
| Layers | 60 |
| Format | JANG v2 (MLX-native safetensors, instant load) |
JANG_4M Bit Allocation
| Tier | Components | Bits |
|---|---|---|
| CRITICAL | Attention (Q/K/V/O), embeddings | 8 |
| COMPRESS | MLP (gate, up, down proj), remaining weights | 4 |
JANG protects attention at full precision while compressing MLP weights — where dense models are most tolerant of quantization. Vision encoder is preserved in float16 for full multimodal quality.
Vision Weight Verification
All 355 vision tower tensors verified present and non-zero. The 31B dense model is text+vision (no audio tower).
| Component | Tensor Count | Status |
|---|---|---|
| Vision Tower (SigLIP) | 355 | All non-zero |
| Language Model | remaining | All non-zero |
Benchmarks
200-question MMLU (20 per subject x 10 subjects). Thinking OFF (enable_thinking=False), greedy decoding (temp=0.0).
| Subject | JANG_4M |
|---|---|
| Abstract Algebra | 13/20 |
| Anatomy | 13/20 |
| Astronomy | 17/20 |
| College CS | 14/20 |
| College Physics | 14/20 |
| HS Biology | 19/20 |
| HS Chemistry | 15/20 |
| HS Mathematics | 9/20 |
| Logical Fallacies | 19/20 |
| World Religions | 20/20 |
| Total | 153/200 (76.5%) |
Architecture Highlights
- Dense transformer with 60 layers
- Hybrid attention: sliding-window + full-attention layers (every 6th layer is full)
- Dual head dimensions: 256 (sliding) / 512 (global)
- K=V weight sharing on global attention layers
- Vision encoder preserved in float16 for multimodal inference
Usage
# Requires Osaurus (https://osaurus.ai)
osaurus serve OsaurusAI/Gemma-4-31B-it-JANG_4M
Requirements
- Apple Silicon Mac with 24+ GB unified memory
- Osaurus or compatible MLX inference engine with Gemma 4 support
Quantized by Osaurus AI using JANG
- Downloads last month
- 184
Quantized