Text Generation
Transformers
Safetensors
English
qwen2
awq
w4a16
compressed-tensors
quantized
vllm
code
conversational
text-generation-inference
Instructions to use kd13/Coder-o1-mini-reasoning-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kd13/Coder-o1-mini-reasoning-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kd13/Coder-o1-mini-reasoning-AWQ") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kd13/Coder-o1-mini-reasoning-AWQ") model = AutoModelForCausalLM.from_pretrained("kd13/Coder-o1-mini-reasoning-AWQ", 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
- vLLM
How to use kd13/Coder-o1-mini-reasoning-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kd13/Coder-o1-mini-reasoning-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kd13/Coder-o1-mini-reasoning-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kd13/Coder-o1-mini-reasoning-AWQ
- SGLang
How to use kd13/Coder-o1-mini-reasoning-AWQ 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 "kd13/Coder-o1-mini-reasoning-AWQ" \ --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": "kd13/Coder-o1-mini-reasoning-AWQ", "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 "kd13/Coder-o1-mini-reasoning-AWQ" \ --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": "kd13/Coder-o1-mini-reasoning-AWQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kd13/Coder-o1-mini-reasoning-AWQ with Docker Model Runner:
docker model run hf.co/kd13/Coder-o1-mini-reasoning-AWQ
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,28 +12,19 @@ tags:
|
|
| 12 |
- quantized
|
| 13 |
- vllm
|
| 14 |
- code
|
| 15 |
-
- text-generation
|
| 16 |
---
|
| 17 |
|
| 18 |
# Coder-o1-mini-reasoning - AWQ
|
| 19 |
|
| 20 |
-
4-bit AWQ quantization of [kd13/Coder-o1-mini-reasoning](https://huggingface.co/kd13/Coder-o1-mini-reasoning), a compact
|
| 21 |
-
Python-focused reasoning model for coding assistance, debugging, code explanation, and
|
| 22 |
-
math/logic reasoning.
|
| 23 |
|
| 24 |
-
Quantized with [llm-compressor](https://github.com/vllm-project/llm-compressor) using
|
| 25 |
-
`AWQModifier` + `W4A16_ASYM`. Calibrated on 256 code-instruction samples at
|
| 26 |
-
2048 tokens, with the model's own chat template applied.
|
| 27 |
|
| 28 |
`lm_head` is left at full precision. Weights are 4-bit; activations stay 16-bit.
|
| 29 |
|
| 30 |
## Format
|
| 31 |
|
| 32 |
-
This is **compressed-tensors** format, which is what current AWQ tooling produces.
|
| 33 |
-
vLLM and transformers both detect it automatically from `config.json` — you do not need
|
| 34 |
-
to pass `--quantization awq`. The older AutoAWQ format is not interchangeable with this
|
| 35 |
-
one; if a loader expects `quant_config.json`, it wants the legacy format and will not
|
| 36 |
-
read this repo.
|
| 37 |
|
| 38 |
## Usage
|
| 39 |
|
|
@@ -64,12 +55,9 @@ Requires `pip install compressed-tensors`.
|
|
| 64 |
|
| 65 |
## Hardware
|
| 66 |
|
| 67 |
-
A CUDA GPU is required — AWQ has no CPU path. For local or CPU inference use the GGUF
|
| 68 |
-
build instead.
|
| 69 |
|
| 70 |
-
On Ampere or newer (compute capability 8.0+) vLLM uses the Marlin kernel, which is where
|
| 71 |
-
the throughput gains come from. Turing cards such as the T4 fall back to a slower kernel
|
| 72 |
-
and see much less benefit.
|
| 73 |
|
| 74 |
## Chat template
|
| 75 |
|
|
@@ -83,23 +71,6 @@ ChatML, with Qwen-style tool calling:
|
|
| 83 |
<|im_start|>assistant
|
| 84 |
```
|
| 85 |
|
| 86 |
-
Tool definitions are injected into the system message inside `<tools>` tags, and the
|
| 87 |
-
model replies with a JSON object inside `<tool_call>` tags. Tool results are returned
|
| 88 |
-
wrapped in `<tool_response>`. vLLM exposes this through its OpenAI-compatible `tools`
|
| 89 |
-
parameter.
|
| 90 |
|
| 91 |
-
A default system prompt is applied when you do not supply one. Pass an explicit system
|
| 92 |
-
prompt to control the assistant's stated identity.
|
| 93 |
-
|
| 94 |
-
## Limitations
|
| 95 |
-
|
| 96 |
-
Everything in the [base model card](https://huggingface.co/kd13/Coder-o1-mini-reasoning) applies. This is
|
| 97 |
-
a small experimental reasoning model: good for Python learning, debugging help, code
|
| 98 |
-
explanation, and basic-to-intermediate problems. Not suited to hard competitive
|
| 99 |
-
programming, complex algorithmic work, non-Python languages, security-sensitive code, or
|
| 100 |
-
production use without review.
|
| 101 |
-
|
| 102 |
-
4-bit quantization does not improve any of that. Expect 1-3% degradation on most tasks,
|
| 103 |
-
concentrated in exactly the long multi-step reasoning this model is already weakest at.
|
| 104 |
-
If quality matters more than memory, use the unquantized model or an 8-bit build.
|
| 105 |
-
Always test generated code.
|
|
|
|
| 12 |
- quantized
|
| 13 |
- vllm
|
| 14 |
- code
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# Coder-o1-mini-reasoning - AWQ
|
| 18 |
|
| 19 |
+
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.
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
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.
|
|
|
|
|
|
|
| 22 |
|
| 23 |
`lm_head` is left at full precision. Weights are 4-bit; activations stay 16-bit.
|
| 24 |
|
| 25 |
## Format
|
| 26 |
|
| 27 |
+
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## Usage
|
| 30 |
|
|
|
|
| 55 |
|
| 56 |
## Hardware
|
| 57 |
|
| 58 |
+
A CUDA GPU is required — AWQ has no CPU path. For local or CPU inference use the GGUF build instead.
|
|
|
|
| 59 |
|
| 60 |
+
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.
|
|
|
|
|
|
|
| 61 |
|
| 62 |
## Chat template
|
| 63 |
|
|
|
|
| 71 |
<|im_start|>assistant
|
| 72 |
```
|
| 73 |
|
| 74 |
+
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.
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
+
A default system prompt is applied when you do not supply one. Pass an explicit system prompt to control the assistant's stated identity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|