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
| 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. |