Text Generation
OpenVINO
Transformers
English
optimum-intel
qwen3
computer-science
software-engineering
programming
coding
int4
quantized
cpu
gpu
npu
Instructions to use Irfanuruchi/Qwen3-4B-Computer-Science-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Irfanuruchi/Qwen3-4B-Computer-Science-Models with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Irfanuruchi/Qwen3-4B-Computer-Science-Models")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Irfanuruchi/Qwen3-4B-Computer-Science-Models", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Irfanuruchi/Qwen3-4B-Computer-Science-Models with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Irfanuruchi/Qwen3-4B-Computer-Science-Models" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Irfanuruchi/Qwen3-4B-Computer-Science-Models", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Irfanuruchi/Qwen3-4B-Computer-Science-Models
- SGLang
How to use Irfanuruchi/Qwen3-4B-Computer-Science-Models 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 "Irfanuruchi/Qwen3-4B-Computer-Science-Models" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Irfanuruchi/Qwen3-4B-Computer-Science-Models", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Irfanuruchi/Qwen3-4B-Computer-Science-Models" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Irfanuruchi/Qwen3-4B-Computer-Science-Models", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Irfanuruchi/Qwen3-4B-Computer-Science-Models with Docker Model Runner:
docker model run hf.co/Irfanuruchi/Qwen3-4B-Computer-Science-Models
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,74 +1,208 @@
|
|
| 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 |
-
Original BF16 release intended for Hugging Face Transformers, fine-tuning, and general inference.
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
-
Activation-Aware Weight Quantization (AWQ) release using the Compressed-Tensors format for supported inference frameworks.
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
|
| 37 |
-
|
| 38 |
-
Optimized 8-bit MLX release providing a balance between quality and memory usage.
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
Full-precision BF16 MLX release for maximum inference quality on Apple Silicon.
|
| 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 |
-
- ✅ GGUF
|
| 68 |
-
- ✅ AWQ
|
| 69 |
-
- ✅ MLX 4-bit
|
| 70 |
-
- ✅ MLX 8-bit
|
| 71 |
-
- ✅ MLX BF16
|
| 72 |
-
- ✅ OpenVINO INT4
|
| 73 |
|
| 74 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: Irfanuruchi/Qwen3-4B-Computer-Science
|
| 6 |
+
base_model_relation: quantized
|
| 7 |
+
library_name: optimum-intel
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
inference: false
|
| 10 |
+
tags:
|
| 11 |
+
- qwen3
|
| 12 |
+
- qwen3-for-causal-lm
|
| 13 |
+
- computer-science
|
| 14 |
+
- software-engineering
|
| 15 |
+
- programming
|
| 16 |
+
- coding
|
| 17 |
+
- openvino
|
| 18 |
+
- optimum-intel
|
| 19 |
+
- int4
|
| 20 |
+
- quantized
|
| 21 |
+
- cpu
|
| 22 |
+
- transformers
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
# Qwen3-4B-Computer-Science OpenVINO INT4
|
| 26 |
+
|
| 27 |
+
This repository provides an **OpenVINO INT4** version of **Qwen3-4B-Computer-Science**, optimized for efficient inference using **Intel OpenVINO** and **Optimum Intel**.
|
| 28 |
+
|
| 29 |
+
The model is optimized for software engineering and computer science workloads while significantly reducing storage requirements and memory usage through INT4 weight compression, enabling efficient CPU inference on OpenVINO-supported hardware.
|
| 30 |
|
| 31 |
+
---
|
| 32 |
|
| 33 |
+
# Model Information
|
| 34 |
+
|
| 35 |
+
| Property | Value |
|
| 36 |
+
|----------|-------|
|
| 37 |
+
| Base Model | Irfanuruchi/Qwen3-4B-Computer-Science |
|
| 38 |
+
| Base Architecture | Qwen3 |
|
| 39 |
+
| Parameters | ~4 Billion |
|
| 40 |
+
| Model Format | OpenVINO IR |
|
| 41 |
+
| Weight Compression | INT4 Asymmetric |
|
| 42 |
+
| Compression Group Size | 128 |
|
| 43 |
+
| Runtime | OpenVINO Runtime |
|
| 44 |
+
| Library | Optimum Intel |
|
| 45 |
+
| Primary Hardware | CPU |
|
| 46 |
+
| License | Apache License 2.0 |
|
| 47 |
|
| 48 |
---
|
| 49 |
|
| 50 |
+
# Features
|
| 51 |
|
| 52 |
+
- Optimized OpenVINO IR format
|
| 53 |
+
- INT4 asymmetric weight compression
|
| 54 |
+
- Reduced storage footprint
|
| 55 |
+
- Lower memory usage
|
| 56 |
+
- CPU-optimized inference
|
| 57 |
+
- Compatible with Hugging Face Transformers through Optimum Intel
|
| 58 |
+
- Exported tokenizer and detokenizer
|
| 59 |
+
- Chat template included
|
| 60 |
+
- Ready for local deployment
|
| 61 |
|
| 62 |
---
|
| 63 |
|
| 64 |
+
# Export Configuration
|
| 65 |
|
| 66 |
+
The model was exported using:
|
|
|
|
| 67 |
|
| 68 |
+
```bash
|
| 69 |
+
optimum-cli export openvino \
|
| 70 |
+
--model Irfanuruchi/Qwen3-4B-Computer-Science \
|
| 71 |
+
--task text-generation-with-past \
|
| 72 |
+
--weight-format int4 \
|
| 73 |
+
Qwen3-4B-Computer-Science-OpenVINO-INT4
|
| 74 |
+
```
|
| 75 |
|
| 76 |
+
Compression summary:
|
|
|
|
| 77 |
|
| 78 |
+
- **252 transformer layers** compressed using **INT4 asymmetric** with **group size 128**
|
| 79 |
+
- **1 auxiliary layer** stored using **INT8 per-channel**
|
| 80 |
|
| 81 |
+
---
|
|
|
|
| 82 |
|
| 83 |
+
# Installation
|
|
|
|
| 84 |
|
| 85 |
+
```bash
|
| 86 |
+
pip install -U openvino optimum-intel transformers
|
| 87 |
+
```
|
| 88 |
|
| 89 |
---
|
| 90 |
|
| 91 |
+
# Example Usage
|
| 92 |
+
|
| 93 |
+
```python
|
| 94 |
+
from transformers import AutoTokenizer
|
| 95 |
+
from optimum.intel.openvino import OVModelForCausalLM
|
| 96 |
+
|
| 97 |
+
model_id = "Irfanuruchi/Qwen3-4B-Computer-Science-OpenVINO-INT4"
|
| 98 |
+
|
| 99 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 100 |
|
| 101 |
+
model = OVModelForCausalLM.from_pretrained(
|
| 102 |
+
model_id,
|
| 103 |
+
device="CPU",
|
| 104 |
+
)
|
| 105 |
|
| 106 |
+
messages = [
|
| 107 |
+
{
|
| 108 |
+
"role": "system",
|
| 109 |
+
"content": "You are a computer science assistant."
|
| 110 |
+
},
|
| 111 |
+
{
|
| 112 |
+
"role": "user",
|
| 113 |
+
"content": "Explain Floyd's cycle detection algorithm."
|
| 114 |
+
},
|
| 115 |
+
]
|
| 116 |
|
| 117 |
+
prompt = tokenizer.apply_chat_template(
|
| 118 |
+
messages,
|
| 119 |
+
tokenize=False,
|
| 120 |
+
add_generation_prompt=True,
|
| 121 |
+
)
|
| 122 |
+
|
| 123 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 124 |
+
|
| 125 |
+
outputs = model.generate(
|
| 126 |
+
**inputs,
|
| 127 |
+
max_new_tokens=256,
|
| 128 |
+
do_sample=False,
|
| 129 |
+
)
|
| 130 |
+
|
| 131 |
+
response = tokenizer.decode(
|
| 132 |
+
outputs[0][inputs["input_ids"].shape[1]:],
|
| 133 |
+
skip_special_tokens=True,
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
print(response)
|
| 137 |
+
```
|
| 138 |
|
| 139 |
---
|
| 140 |
|
| 141 |
+
# Validation
|
| 142 |
+
|
| 143 |
+
The exported model was successfully validated using:
|
| 144 |
+
|
| 145 |
+
- OpenVINO 2026.2.1
|
| 146 |
+
- CPU inference
|
| 147 |
+
- Chat template support
|
| 148 |
+
- Greedy decoding
|
| 149 |
+
- Software engineering benchmark prompts
|
| 150 |
+
|
| 151 |
+
Validation confirmed successful generation of technically correct programming responses, including algorithm implementation and complexity analysis.
|
| 152 |
+
|
| 153 |
+
---
|
| 154 |
+
|
| 155 |
+
# Intended Use
|
| 156 |
+
|
| 157 |
+
This model is intended for:
|
| 158 |
+
|
| 159 |
+
- Software engineering assistance
|
| 160 |
+
- Computer science education
|
| 161 |
+
- Programming support
|
| 162 |
+
- Code generation
|
| 163 |
+
- Code review
|
| 164 |
+
- Debugging
|
| 165 |
+
- Algorithm design
|
| 166 |
+
- Technical documentation
|
| 167 |
+
- Technical question answering
|
| 168 |
+
|
| 169 |
+
---
|
| 170 |
+
|
| 171 |
+
# Model Family
|
| 172 |
+
|
| 173 |
+
The **Qwen3-4B-Computer-Science** release family currently includes:
|
| 174 |
+
|
| 175 |
+
| Model | Status |
|
| 176 |
+
|------|:------:|
|
| 177 |
+
| Transformers BF16 | ✅ |
|
| 178 |
+
| GGUF (Multiple Quantization Variants) | ✅ |
|
| 179 |
+
| AWQ | ✅ |
|
| 180 |
+
| MLX 4-bit | ✅ |
|
| 181 |
+
| MLX 8-bit | ✅ |
|
| 182 |
+
| MLX BF16 | ✅ |
|
| 183 |
+
| OpenVINO INT4 | ✅ |
|
| 184 |
+
|
| 185 |
+
Each release is maintained in its own repository with runtime-specific documentation, usage examples, integrity verification files, and configuration for its respective inference backend.
|
| 186 |
+
|
| 187 |
+
---
|
| 188 |
+
|
| 189 |
+
# Limitations
|
| 190 |
+
|
| 191 |
+
Like other large language models, this model may occasionally:
|
| 192 |
+
|
| 193 |
+
- Generate incorrect or incomplete code
|
| 194 |
+
- Hallucinate APIs or implementation details
|
| 195 |
+
- Produce inefficient implementations
|
| 196 |
+
- Misinterpret ambiguous instructions
|
| 197 |
+
|
| 198 |
+
All generated code should be reviewed and tested before use in production or safety-critical environments.
|
| 199 |
+
|
| 200 |
+
INT4 weight compression may introduce minor quality differences compared with higher-precision model variants.
|
| 201 |
+
|
| 202 |
+
---
|
| 203 |
|
| 204 |
+
# License
|
| 205 |
|
| 206 |
+
This repository is distributed under the **Apache License 2.0**.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 207 |
|
| 208 |
+
See the included **LICENSE** file for the complete license text and applicable attribution requirements.
|