File size: 2,821 Bytes
30b238c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92becf4
30b238c
92becf4
30b238c
 
 
 
 
92becf4
30b238c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92becf4
30b238c
92becf4
30b238c
 
 
 
 
 
 
 
 
 
 
 
 
92becf4
30b238c
92becf4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
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.