Text Generation
Transformers
Safetensors
English
gemma2
gemma
rl-mpq
mixed-precision
quantization
fake-quantization
conservative
text-generation-inference
Instructions to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AvoCahDoe/gemma-2-9b-rlmpq-conservative")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AvoCahDoe/gemma-2-9b-rlmpq-conservative") model = AutoModelForCausalLM.from_pretrained("AvoCahDoe/gemma-2-9b-rlmpq-conservative", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AvoCahDoe/gemma-2-9b-rlmpq-conservative" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AvoCahDoe/gemma-2-9b-rlmpq-conservative", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AvoCahDoe/gemma-2-9b-rlmpq-conservative
- SGLang
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative 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 "AvoCahDoe/gemma-2-9b-rlmpq-conservative" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AvoCahDoe/gemma-2-9b-rlmpq-conservative", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "AvoCahDoe/gemma-2-9b-rlmpq-conservative" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AvoCahDoe/gemma-2-9b-rlmpq-conservative", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AvoCahDoe/gemma-2-9b-rlmpq-conservative with Docker Model Runner:
docker model run hf.co/AvoCahDoe/gemma-2-9b-rlmpq-conservative
metadata
license: gemma
base_model: google/gemma-2-9b
pipeline_tag: text-generation
language:
- en
tags:
- gemma
- text-generation
- rl-mpq
- mixed-precision
- quantization
- fake-quantization
- conservative
library_name: transformers
datasets:
- wikitext
widget:
- text: The capital of France is
Gemma 2 9B — RL-MPQ Conservative
Standalone RL-MPQ (Reinforcement Learning Mixed-Precision Quantization) checkpoint for the Conservative scenario — a quantized variant of google/gemma-2-9b.
| Field | Value |
|---|---|
| Base model | google/gemma-2-9b |
| Scenario | Conservative |
| Avg bits / weight | 5.1429 |
| Compression vs FP16 | 3.1111× |
| WikiText-2 PPL | 116.5244 |
| Layers | 42 |
| Bit distribution | {'4': 30, '8': 12} |
| Format | Fake-quant FP16 + rlmpq_policy.json |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "AvoCahDoe/gemma-2-9b-rlmpq-conservative"
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="float16")
tokenizer = AutoTokenizer.from_pretrained(repo)
Other Gemma 2 9B scenarios
| Scenario | Avg bits | Compression | WikiText-2 PPL |
|---|---|---|---|
| Aggressive | 3.6667 | 4.3636x | 162.8437 |
| Balanced | 4.2857 | 3.7333x | 127.0798 |
| Extreme Survival | 2.7857 | 5.7436x | 424.7991 |
| High Fidelity | 7.0476 | 2.2703x | 104.8098 |
Grouped archive (all scenarios in one repo): AvoCahDoe/gemma-2-9b-rlmpq
Method
- Phase 3 — PPO agent assigns per-layer bit widths under the Conservative reward target.
- Phase 4 — Policy replayed on real weights; WikiText-2 perplexity validates quality.
- Export — Fake-quantized FP16 weights compatible with Hugging Face Transformers.
Files
| File | Description |
|---|---|
config.json |
Llama architecture + RL-MPQ metadata |
model.safetensors |
Fake-quantized weights |
rlmpq_policy.json |
Per-layer bit-width policy |
rlmpq_metrics.json |
Validation & PPL summary |
Citation
@misc{rlmpq_gemma_2_9b_conservative_2026,
title = {RL-MPQ Conservative: Gemma 2 9B Mixed-Precision Quantization},
author = {AvoCahDoe},
year = {2026},
url = {https://huggingface.co/AvoCahDoe/gemma-2-9b-rlmpq-conservative}
}