kd13's picture
Update README.md
92becf4 verified
|
Raw
History Blame Contribute Delete
2.82 kB
---
base_model: kd13/Coder-o1-mini-reasoning
library_name: transformers
pipeline_tag: text-generation
license: mit
language:
- en
tags:
- awq
- w4a16
- compressed-tensors
- quantized
- vllm
- code
---
# Coder-o1-mini-reasoning - AWQ
4-bit AWQ quantization of [kd13/Coder-o1-mini-reasoning](https://huggingface.co/kd13/Coder-o1-mini-reasoning), a compact Python-focused reasoning model for coding assistance, debugging, code explanation, and math/logic reasoning.
Quantized with [llm-compressor](https://github.com/vllm-project/llm-compressor) using `AWQModifier` + `W4A16_ASYM`. Calibrated on 256 code-instruction samples at 2048 tokens, with the model's own chat template applied.
`lm_head` is left at full precision. Weights are 4-bit; activations stay 16-bit.
## Format
This is **compressed-tensors** format, which is what current AWQ tooling produces. vLLM and transformers both detect it automatically from `config.json` — you do not need to pass `--quantization awq`. The older AutoAWQ format is not interchangeable with this one; if a loader expects `quant_config.json`, it wants the legacy format and will not read this repo.
## Usage
### vLLM
```bash
vllm serve kd13/Coder-o1-mini-reasoning-AWQ --max-model-len 8192
```
### Transformers
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("kd13/Coder-o1-mini-reasoning-AWQ", device_map="auto")
tok = AutoTokenizer.from_pretrained("kd13/Coder-o1-mini-reasoning-AWQ")
msgs = [
{"role": "system", "content": "You are a helpful Python coding assistant."},
{"role": "user", "content": "Explain list comprehensions with an example."},
]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(**ids, max_new_tokens=300)[0]))
```
Requires `pip install compressed-tensors`.
## Hardware
A CUDA GPU is required — AWQ has no CPU path. For local or CPU inference use the GGUF build instead.
On Ampere or newer (compute capability 8.0+) vLLM uses the Marlin kernel, which is where the throughput gains come from. Turing cards such as the T4 fall back to a slower kernel and see much less benefit.
## Chat template
ChatML, with Qwen-style tool calling:
```
<|im_start|>system
{system}<|im_end|>
<|im_start|>user
{message}<|im_end|>
<|im_start|>assistant
```
Tool definitions are injected into the system message inside `<tools>` tags, and the model replies with a JSON object inside `<tool_call>` tags. Tool results are returned wrapped in `<tool_response>`. vLLM exposes this through its OpenAI-compatible `tools` parameter.
A default system prompt is applied when you do not supply one. Pass an explicit system prompt to control the assistant's stated identity.