Instructions to use OptGear/Opt.Gear-1B-qat-int4-g32-unquantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OptGear/Opt.Gear-1B-qat-int4-g32-unquantized with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OptGear/Opt.Gear-1B-qat-int4-g32-unquantized", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("OptGear/Opt.Gear-1B-qat-int4-g32-unquantized", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OptGear/Opt.Gear-1B-qat-int4-g32-unquantized with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OptGear/Opt.Gear-1B-qat-int4-g32-unquantized
- SGLang
How to use OptGear/Opt.Gear-1B-qat-int4-g32-unquantized 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 "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized" \ --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": "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized", "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 "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized" \ --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": "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OptGear/Opt.Gear-1B-qat-int4-g32-unquantized with Docker Model Runner:
docker model run hf.co/OptGear/Opt.Gear-1B-qat-int4-g32-unquantized
Opt.Gear-1B-QAT
This repository contains the Quantization-Aware Training (QAT) checkpoint of Opt.Gear-1B: master weights adapted to the deployment INT4 grid, together with the learned group-wise quantization scales.
The deployment format is W4A16 (group-size-32 symmetric INT4 weights, 16-bit activations). The checkpoint performs best with its learned QAT scales, and also re-quantizes stably with other INT4 PTQ methods (RTN, AWQ, GPTQ).
For the full-precision model, see Opt.Gear-1B.
Making a model small is not enough for real devices. Beyond parameter count, the memory occupied by weights, memory bandwidth, arithmetic precision, and the kernels supported by the accelerator determine final inference performance. The question is: how much of the original quality survives when the model is squeezed into 4 bits?
Opt.Gear-1B-QAT adapts the trained model directly to the deployment INT4 grid via Quantization-Aware Training. On six English/Korean benchmarks, the QAT model loses only ~1.0 point on average from the Base model โ under the exact group-size-32 symmetric W4A16 grid used at deployment time.
QAT Highlights
- Group-size-32 symmetric INT4 weight quantization with a W4A16 deployment format
- Hessian-based scale initialization: group-wise INT4 scales initialized by a layer-wise output reconstruction objective measured on calibration activations โ not simple max-based statistics
- Learned Step Size Quantization (LSQ): weights and step sizes jointly optimized under the full language-modeling objective, with straight-through gradient estimation
- No quantizer mismatch: the same group-wise INT4 grid is used during initialization, QAT, and final weight conversion, so the learned quantization structure survives deployment export
- Quantization-friendly weights: the checkpoint re-quantizes stably with RTN/AWQ/GPTQ, giving deployment pipelines freedom in quantizer choice
For more details, please refer to our tech report and blog post.
Quantization Configuration
| Item | Setting |
|---|---|
| Weight precision | INT4 |
| Activation precision | INT16 |
| Quantization format | W4A16 |
| Weight quantization | Symmetric (zero-point fixed at 0) |
| Group size | 32 |
| Scale initialization | Hessian-based output reconstruction |
| Scale optimization | Learned Step Size Quantization |
| QAT length | 1,000 steps |
The scale for each quantization group is initialized as
ฮ* = argmin_ฮ โ WX โ Q_ฮ(W)X โยฒ_F
where W is the full-precision weight matrix, X contains the calibration inputs, and Q_ฮ(W) denotes the weights quantized with scale ฮ. This objective accounts for the relative importance of different input directions instead of treating all weight perturbations equally. Starting from this initialization, QAT jointly refines the weights and the LSQ step sizes under the global training objective, while the forward pass consistently emulates the final W4A16 deployment format.
Benchmark Results
Base, QAT, and PTQ results of Opt.Gear-1B and Gemma3-1B on six English/Korean benchmarks. RTN, AWQ, and GPTQ rows re-quantize the master weights of the QAT checkpoint with each PTQ method; the QAT row evaluates the final QAT quantizer including learned scales. All results are obtained using the LM Evaluation Harness.
| Method | MMLU | HellaSwag | WinoGrande | KMMLU | KoBEST | HAERAE | Avg. | ฮ |
|---|---|---|---|---|---|---|---|---|
| Opt.Gear-1B | ||||||||
| Base | 43.2 | 56.0 | 58.2 | 36.0 | 60.3 | 44.2 | 49.7 | โ |
| QAT | 41.3 | 54.0 | 58.3 | 35.0 | 60.4 | 42.7 | 48.6 | -1.0 |
| RTN | 39.8 | 53.9 | 56.9 | 33.8 | 59.8 | 39.9 | 47.4 | -2.3 |
| AWQ | 39.5 | 52.6 | 56.5 | 32.7 | 59.6 | 38.2 | 46.5 | -3.1 |
| GPTQ | 39.6 | 53.5 | 57.1 | 34.4 | 59.6 | 41.0 | 47.5 | -2.1 |
| Gemma3-1B (reference) | ||||||||
| Base | 39.8 | 60.0 | 58.7 | 30.7 | 59.5 | 35.3 | 47.3 | โ |
| QAT | 35.8 | 51.4 | 55.0 | 26.9 | 56.2 | 31.2 | 42.8 | -4.6 |
| RTN | 32.5 | 48.5 | 53.8 | 21.2 | 55.1 | 23.6 | 39.1 | -8.2 |
| AWQ | 34.3 | 50.5 | 53.7 | 23.3 | 56.4 | 29.7 | 41.3 | -6.0 |
| GPTQ | 34.9 | 49.6 | 54.9 | 23.3 | 55.1 | 27.1 | 40.8 | -6.5 |
* Avg. is the simple average of the six benchmark scores; ฮ is the difference from each model's Base average.
* PTQ results of Llama3.2-1B, Qwen3-1.7B, and EXAONE4-1B are available in the tech report.
Re-quantization Stability
The QAT checkpoint performs best with its learned scales, and the QAT-trained weights themselves respond stably to other INT4 quantizers:
| Model | Quantizer | Avg | ฮ vs QAT |
|---|---|---|---|
| Opt.Gear-1B-QAT | Learned QAT scale | 48.6 | โ |
| RTN | 47.4 | -1.3 | |
| AWQ | 46.5 | -2.1 | |
| GPTQ | 47.5 | -1.1 | |
| Gemma3-1B-QAT | Learned QAT scale | 42.8 | โ |
| RTN | 39.1 | -3.6 | |
| AWQ | 41.3 | -1.4 | |
| GPTQ | 40.8 | -1.9 |
Under identical RTN re-quantization, Opt.Gear-1B loses only 1.3 points on average, versus 3.6 points for Gemma3-1B. The Opt.Gear-1B-QAT checkpoint is not merely a set of learned scale parameters โ the weights themselves have been adapted to be quantization-friendly, giving deployment pipelines freedom in quantizer choice.
Quickstart
This checkpoint is intended for INT4 deployment. For best quality, export with the included learned group-wise scales (the same group-size-32 symmetric W4A16 grid used during QAT). Re-quantizing with RTN/AWQ/GPTQ is supported and remains stable, at a small cost in accuracy (see table above).
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "OptGear/Opt.Gear-1B-qat-int4-g32-unquantized"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [
{"role": "user", "content": "์จ๋๋ฐ์ด์ค AI๊ฐ ์ ์ค์ํ์ง ์ค๋ช
ํด์ค."},
]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True))
Best Practices
Use the learned scales when possible: The learned QAT quantizer gives the best accuracy (Avg. 48.6). Switch to RTN/GPTQ only when your deployment toolchain requires it โ the accuracy cost is small but non-zero.
Keep the grid consistent: The checkpoint was trained against a group-size-32 symmetric INT4 grid with 16-bit activations (W4A16). Exporting to a different group size or asymmetric grid discards the learned quantization structure.
Termination tokens: Same as the full-precision model โ the Instruction model terminates with
<EOT>, the Base model with<EOS>.Model capabilities: Task capability follows Opt.Gear-1B โ Korean-English bilingual understanding and instruction following; not intended for code generation. See the base model card for full benchmark results and architecture details.
Citation
If you find our work helpful, feel free to give us a cite.
@misc{optgear2026,
title = {{Opt-Gear} Technical Report},
author = {{Opt.Gear Team}},
year = {2026},
url = {https://arxiv.org/abs/2608.01034}
}
Correspondence: contact@opt-ai.kr ยท Hugging Face: huggingface.co/OptGear
- Downloads last month
- 29