初始化项目,由ModelHub XC社区提供模型

Model: froogai/NousCoder-14B-AWQ
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-06-05 09:43:18 +08:00
commit 58331be6b7
13 changed files with 153047 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

249
README.md Normal file
View File

@@ -0,0 +1,249 @@
---
license: apache-2.0
base_model: NousResearch/NousCoder-14B
tags:
- awq
- transformers
- autotrain-llm
- llama-cpp
- gguf-my-repo
- quantized
- 4-bit
- coding
- competitive-programming
- qwen
language:
- en
- code
pipeline_tag: text-generation
---
# NousCoder-14B-AWQ
## Model Description
**NousCoder-14B-AWQ** is a 4-bit AWQ (Activation-aware Weight Quantization) quantized version of [NousResearch/NousCoder-14B](https://huggingface.co/NousResearch/NousCoder-14B).
This model specializes in **competitive programming** and **coding tasks**, achieving 67.87% Pass@1 on LiveCodeBench v6. It has been post-trained on Qwen3-14B using reinforcement learning on 24k verifiable coding problems.
### Key Features
- 🔥 **Specialized for Coding**: Trained with RL on competitive programming problems
-**4-bit Quantized**: 66% smaller (9.4GB vs 28GB) with minimal quality loss
- 🚀 **Fast Inference**: Optimized for AWQ Marlin kernel (2-3x faster)
- 💻 **Production Ready**: Tested and verified for deployment
## Model Stats
| Metric | Value |
|--------|-------|
| **Base Model** | Qwen3-14B |
| **Quantization** | 4-bit AWQ |
| **Size** | 9.4 GB (from 28 GB) |
| **VRAM** | ~6GB per GPU (2x GPUs) |
| **Context Length** | 16,384 tokens |
| **LiveCodeBench v6 Pass@1** | 67.87% |
| **Training** | 24k coding problems (RL) |
## Usage
### With AutoAWQ
```python
from awq import AutoAWQForCausalLM
from transformers import AutoTokenizer
model = AutoAWQForCausalLM.from_quantized(
"froogai/NousCoder-14B-AWQ",
device_map="auto",
safetensors=True,
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"froogai/NousCoder-14B-AWQ",
trust_remote_code=True,
)
# Generate code
prompt = "Write a Python function to implement binary search:"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.2,
top_p=0.95,
)
code = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(code)
```
### With vLLM (Recommended for Production)
```bash
python -m vllm.entrypoints.openai.api_server \
--model froogai/NousCoder-14B-AWQ \
--quantization awq_marlin \
--tensor-parallel-size 2 \
--max-model-len 16384 \
--gpu-memory-utilization 0.85 \
--trust-remote-code
```
### With OpenAI-Compatible API
```bash
# Start vLLM server
vllm serve froogai/NousCoder-14B-AWQ \
--quantization awq_marlin \
--tensor-parallel-size 2
# Make API requests
curl http://localhost:8000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "froogai/NousCoder-14B-AWQ",
"prompt": "def quicksort(arr):",
"max_tokens": 512
}'
```
## Quantization Details
This model was quantized using AutoAWQ with the following configuration:
```python
{
"zero_point": True,
"q_group_size": 128,
"w_bit": 4,
"version": "GEMM",
}
```
### Calibration
- **Dataset**: pileval (128 samples)
- **Method**: Activation-aware Weight Quantization
- **Preservation**: Coding intelligence maintained through careful calibration
## Performance
### Benchmarks
| Benchmark | Score |
|-----------|-------|
| LiveCodeBench v6 Pass@1 | 67.87% |
| Base Model Pass@1 | 60.79% |
| **Improvement** | **+7.08%** |
### Inference Speed
| Hardware | Speed (tokens/sec) |
|----------|-------------------|
| 2x RTX 5060 Ti (awq_marlin) | 15-25 |
| 2x RTX 5060 Ti (awq) | 8-12 |
| Single A100 (awq_marlin) | 40-60 |
### Memory Usage
| Configuration | VRAM Usage |
|---------------|------------|
| 2x RTX 5060 Ti (TP=2) | ~6GB per GPU |
| Single RTX 5060 Ti | ~12GB |
| Single A100 | ~6GB |
## Best Use Cases
This model excels at:
- ✅ Competitive programming problems
- ✅ Algorithm implementation
- ✅ Data structure design
- ✅ Code debugging and optimization
- ✅ Technical interview preparation
- ✅ LeetCode-style challenges
### Recommended Generation Parameters
For coding tasks, use these settings:
- **temperature**: 0.1-0.3 (for deterministic code)
- **top_p**: 0.95
- **max_tokens**: 2048+ (for complete solutions)
- **presence_penalty**: 0.0
- **frequency_penalty**: 0.0
## Hardware Requirements
### Minimum Requirements
- **VRAM**: 12GB (single GPU) or 6GB (2 GPUs with tensor parallelism)
- **RAM**: 24GB
- **Storage**: 10GB
### Recommended Requirements
- **GPUs**: 2x NVIDIA RTX 5060 Ti 16GB (32GB total VRAM)
- **RAM**: 128GB
- **Storage**: 20GB (for model + cache)
### Compatible Hardware
- NVIDIA GPUs with compute capability 7.0+ (for AWQ Marlin)
- CUDA 11.8+ or 12.1+
- Python 3.10+
## Limitations
- Quantized model may have slight accuracy degradation compared to FP16
- Requires AWQ-compatible libraries (AutoAWQ or vLLM)
- Best performance on NVIDIA GPUs (CPU inference slower)
## Training Details
### Base Model
- **Architecture**: Qwen3-14B
- **Parameters**: 14B
- **License**: Apache 2.0
### Post-Training
- **Method**: Reinforcement Learning
- **Dataset**: 24k verifiable coding problems
- **Hardware**: 48 B200 GPUs
- **Duration**: 4 days
- **Framework**: Atropos (NousResearch training system)
## Acknowledgments
- **Original Model**: [NousResearch/NousCoder-14B](https://huggingface.co/NousResearch/NousCoder-14B)
- **Base Model**: [Qwen/Qwen3-14B](https://huggingface.co/Qwen/Qwen3-14B)
- **Quantization**: AutoAWQ library
- **Training Team**: Joe Li (@JoeLi5050) at NousResearch
## Citation
If you use this model, please cite:
```bibtex
@misc{nouscoder_14b_2025,
title={NousCoder-14B: Competitive Programming AI Model},
author={Li, Joe},
organization={NousResearch},
year={2025},
month={January},
url={https://huggingface.co/NousResearch/NousCoder-14B}
}
```
## License
This model is licensed under the **Apache 2.0 License**. See the [LICENSE](https://huggingface.co/datasets/choose-a-license) file for details.
## Model Card Authors
Quantized by: **froogai**
For questions or issues, please:
- Open an issue on the [model repository](https://huggingface.co/froogai/NousCoder-14B-AWQ/issues)
- Contact: [HuggingFace profile](https://huggingface.co/froogai)
---
**Note**: This is a quantized version of the original model. For best performance, use the vLLM inference engine with the `awq_marlin` quantization backend.

28
added_tokens.json Normal file
View File

@@ -0,0 +1,28 @@
{
"</think>": 151668,
"</tool_call>": 151658,
"</tool_response>": 151666,
"<think>": 151667,
"<tool_call>": 151657,
"<tool_response>": 151665,
"<|box_end|>": 151649,
"<|box_start|>": 151648,
"<|endoftext|>": 151643,
"<|file_sep|>": 151664,
"<|fim_middle|>": 151660,
"<|fim_pad|>": 151662,
"<|fim_prefix|>": 151659,
"<|fim_suffix|>": 151661,
"<|im_end|>": 151645,
"<|im_start|>": 151644,
"<|image_pad|>": 151655,
"<|object_ref_end|>": 151647,
"<|object_ref_start|>": 151646,
"<|quad_end|>": 151651,
"<|quad_start|>": 151650,
"<|repo_name|>": 151663,
"<|video_pad|>": 151656,
"<|vision_end|>": 151653,
"<|vision_pad|>": 151654,
"<|vision_start|>": 151652
}

42
config.json Normal file
View File

@@ -0,0 +1,42 @@
{
"architectures": [
"Qwen3ForCausalLM"
],
"attention_bias": false,
"attention_dropout": 0.0,
"bos_token_id": 151643,
"eos_token_id": 151645,
"head_dim": 128,
"hidden_act": "silu",
"hidden_size": 5120,
"initializer_range": 0.02,
"intermediate_size": 17408,
"max_position_embeddings": 81920,
"max_window_layers": 40,
"model_type": "qwen3",
"num_attention_heads": 40,
"num_hidden_layers": 40,
"num_key_value_heads": 8,
"quantization_config": {
"bits": 4,
"group_size": 128,
"modules_to_not_convert": null,
"quant_method": "awq",
"version": "gemm",
"zero_point": true
},
"rms_norm_eps": 1e-06,
"rope_scaling": {
"factor": 2.0,
"original_max_position_embeddings": 40960,
"rope_type": "yarn"
},
"rope_theta": 1000000,
"sliding_window": null,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.51.3",
"use_cache": false,
"use_sliding_window": false,
"vocab_size": 151936
}

13
generation_config.json Normal file
View File

@@ -0,0 +1,13 @@
{
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95,
"transformers_version": "4.51.3"
}

151388
merges.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0b10c13e0d3854adc9a1689f7b612fcb0957c22a424be054753e733bd1f0ff04
size 4988339696

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:700d86788d9e0faa2a0bf4894957deb6e9f7cb763068710fc901475cc22d01bf
size 4988350264

1010
model.safetensors.index.json Normal file

File diff suppressed because it is too large Load Diff

31
special_tokens_map.json Normal file
View File

@@ -0,0 +1,31 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"eos_token": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

BIN
tokenizer.json (Stored with Git LFS) Normal file

Binary file not shown.

240
tokenizer_config.json Normal file
View File

@@ -0,0 +1,240 @@
{
"add_bos_token": false,
"add_prefix_space": false,
"added_tokens_decoder": {
"151643": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151644": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151645": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151646": {
"content": "<|object_ref_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151647": {
"content": "<|object_ref_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151648": {
"content": "<|box_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151649": {
"content": "<|box_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151650": {
"content": "<|quad_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151651": {
"content": "<|quad_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151652": {
"content": "<|vision_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151653": {
"content": "<|vision_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151654": {
"content": "<|vision_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151655": {
"content": "<|image_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151656": {
"content": "<|video_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"151657": {
"content": "<tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151658": {
"content": "</tool_call>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151659": {
"content": "<|fim_prefix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151660": {
"content": "<|fim_middle|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151661": {
"content": "<|fim_suffix|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151662": {
"content": "<|fim_pad|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151663": {
"content": "<|repo_name|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151664": {
"content": "<|file_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151665": {
"content": "<tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151666": {
"content": "</tool_response>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151667": {
"content": "<think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
},
"151668": {
"content": "</think>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": false
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|object_ref_start|>",
"<|object_ref_end|>",
"<|box_start|>",
"<|box_end|>",
"<|quad_start|>",
"<|quad_end|>",
"<|vision_start|>",
"<|vision_end|>",
"<|vision_pad|>",
"<|image_pad|>",
"<|video_pad|>"
],
"bos_token": null,
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if message.content is string %}\n {%- set content = message.content %}\n {%- else %}\n {%- set content = '' %}\n {%- endif %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
"clean_up_tokenization_spaces": false,
"eos_token": "<|im_end|>",
"errors": "replace",
"extra_special_tokens": {},
"model_max_length": 131072,
"pad_token": "<|endoftext|>",
"split_special_tokens": false,
"tokenizer_class": "Qwen2Tokenizer",
"unk_token": null
}

1
vocab.json Normal file

File diff suppressed because one or more lines are too long