Instructions to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit 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("SirSahOl/gemma-3-1b-it-chat-mlx-8bit") 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) - Transformers
How to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SirSahOl/gemma-3-1b-it-chat-mlx-8bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SirSahOl/gemma-3-1b-it-chat-mlx-8bit") model = AutoModelForCausalLM.from_pretrained("SirSahOl/gemma-3-1b-it-chat-mlx-8bit", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SirSahOl/gemma-3-1b-it-chat-mlx-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SirSahOl/gemma-3-1b-it-chat-mlx-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SirSahOl/gemma-3-1b-it-chat-mlx-8bit
- SGLang
How to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SirSahOl/gemma-3-1b-it-chat-mlx-8bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SirSahOl/gemma-3-1b-it-chat-mlx-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SirSahOl/gemma-3-1b-it-chat-mlx-8bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SirSahOl/gemma-3-1b-it-chat-mlx-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - MLX LM
How to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "SirSahOl/gemma-3-1b-it-chat-mlx-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "SirSahOl/gemma-3-1b-it-chat-mlx-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SirSahOl/gemma-3-1b-it-chat-mlx-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use SirSahOl/gemma-3-1b-it-chat-mlx-8bit with Docker Model Runner:
docker model run hf.co/SirSahOl/gemma-3-1b-it-chat-mlx-8bit
- Atomic Chat
gemma-3-1b-it-mlx-8bit
8-bit MLX conversion of google/gemma-3-1b-it optimized for Apple Silicon native GPU inference.
Converted by: SirSahOl
Source Model: google/gemma-3-1b-it
Framework: MLX by Apple
Quantization: 8-bit (Average 8.25 bits per weight)
Format: safetensors
License: gemma
Model Details
- Architecture: Gemma3ForCausalLM
- Parameters: 1B
- Context Length: 32,768 tokens
- Format: MLX (Apple Silicon native GPU format)
- Quantization: 8-bit (Average 8.25 bits per weight)
- Active VRAM Footprint: ~1.5 GB (Minimum recommended: 8 GB Unified Memory)
Quick Start
Installation
pip install mlx-lm
Usage
CLI
# Chat interactively
mlx_lm.chat --model SirSahOl/gemma-3-1b-it-chat-mlx-8bit
# Generate text
mlx_lm.generate --model SirSahOl/gemma-3-1b-it-chat-mlx-8bit --prompt "Write a short poem about artificial intelligence."
Python API (with Chat Template)
from mlx_lm import load, generate
model, tokenizer = load("SirSahOl/gemma-3-1b-it-chat-mlx-8bit")
messages = [
{"role": "user", "content": "Explain quantum superposition in simple terms."}
]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, verbose=True)
print(response)
Performance Benchmarks
Measured Benchmarks (Apple M1)
| Metric | 4-bit | 8-bit | 16-bit |
|---|---|---|---|
| Tokens/sec | 50.45 | 38.56 | 20.92 |
| TTFT | 20.0 ms | 26.01 ms | 48.02 ms |
| Peak Memory | 55.8 MB | 67.7 MB | 64.7 MB |
Benchmarked on Apple M1 with 8GB unified memory. Average over 5 runs with 256 max tokens.
Multi-Quantization Comparison
Evaluate your hardware budget and choose the optimal precision:
| Variant | Disk Size | VRAM Footprint | Target Apple Silicon Hardware | Key Advantage |
|---|---|---|---|---|
| 4-bit MLX | ~0.9 GB | ~0.9 GB | M1 / M2 / M3 / M4 (8GB+) | Maximum generation speed and lowest RAM overhead. |
| 8-bit MLX (This Repository) | ~1.5 GB | ~1.5 GB | M1 / M2 / M3 / M4 Pro/Max (16GB+) | Balanced accuracy and generation speed; near-lossless reasoning. |
| 16-bit MLX | ~2.8 GB | ~2.8 GB | M2 / M3 / M4 Max/Ultra (32GB+) | Full unquantized precision; reference evaluation quality. |
Who Should Use This?
| Your Hardware | Recommended Quantization |
|---|---|
| M1/M2/M3/M4 (8GB – 16GB) | 4-bit — Best balance of speed, low memory, and multitasking capability |
| M1/M2/M3/M4 Pro/Max (18GB – 36GB) | 8-bit — Higher quality reasoning with comfortable memory headroom |
| M1/M2/M3/M4 Max/Ultra (36GB – 192GB) | 16-bit — Unquantized full precision, zero quality degradation |
General guidance:
- Use 4-bit if you want to run this model alongside IDEs, browsers, and background development tools.
- Use 8-bit if you have 16GB+ unified memory and require superior reasoning and code accuracy.
- Use 16-bit for research, benchmarking, evaluation, or high-end workstation deployments.
Other Quantization Variants
| Variant | Link |
|---|---|
| 4-bit | SirSahOl/gemma-3-1b-it-chat-mlx-4bit |
| 8-bit | SirSahOl/gemma-3-1b-it-chat-mlx-8bit |
| 16-bit | SirSahOl/gemma-3-1b-it-chat-mlx-16bit |
LM Studio & Local Inference Setup Guide
To prevent runaway loops and ensure correct conversational turn-taking, configure custom stop tokens in your local inference runtime:
<|im_start|><|im_end|><|endoftext|>
Prompt Template Formatting
- System Prefix:
<|im_start|>system\n - System Suffix:
<|im_end|>\n - User Prefix:
<|im_start|>user\n - Assistant Suffix:
<|im_end|>\n<|im_start|>assistant\n
Ollama Quickstart
FROM SirSahOl/gemma-3-1b-it-chat-mlx-8bit
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
PARAMETER temperature 0.7
ollama create gemma-3-1b-it-chat-mlx-8bit -f Modelfile
ollama run gemma-3-1b-it-chat-mlx-8bit
Conversion Details
| Property | Value |
|---|---|
| Source Model | google/gemma-3-1b-it |
| Quantization | 8-bit |
| mlx-lm Version | 0.31.3 |
| Conversion Time | 9.15s |
| Output Size | 1.0 GB |
| Date | 2026-09-22T06:26:28.687214+00:00 |
Reproduction
To reproduce this conversion:
pip install mlx-lm==0.31.3
python3 -m mlx_lm convert --hf-path /Users/z4/.cache/huggingface/hub/models--google--gemma-3-1b-it/snapshots/dcc83ea841ab6100d6b47a070329e1ba4cf78752 --mlx-path output/gemma-3-1b-it-mlx-8bit -q --q-bits 8
Limitations & Known Issues
- 4-bit group-wise quantization introduces minor precision loss compared to unquantized weights; for deep mathematical derivations or precision-critical reasoning, test the 8-bit or 16-bit variants.
- High context sequences (>32K tokens) require sufficient unified memory headroom; ensure unified memory is not overcommitted.
- This is a weight-only MLX conversion designed specifically for Apple Silicon GPUs (M1/M2/M3/M4 series).
License
This model conversion inherits the license of the source model: gemma.
See the original model card for full license details.
Changelog
| Version | Date | Changes |
|---|---|---|
| v1.0 | 2026-09-22 | Initial conversion |
Converted with MLX Foundry — a professional pipeline for converting models to Apple MLX format.
- Downloads last month
- -
8-bit