Text Generation
Transformers
Safetensors
English
qwen3_5_text
coding
reasoning
language
python
javascript
sql
agentic
lora
sft
qwen
conversational
Instructions to use wefamm/aiAI_coder_V2_4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wefamm/aiAI_coder_V2_4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wefamm/aiAI_coder_V2_4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("wefamm/aiAI_coder_V2_4B") model = AutoModelForCausalLM.from_pretrained("wefamm/aiAI_coder_V2_4B", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wefamm/aiAI_coder_V2_4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wefamm/aiAI_coder_V2_4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wefamm/aiAI_coder_V2_4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wefamm/aiAI_coder_V2_4B
- SGLang
How to use wefamm/aiAI_coder_V2_4B 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 "wefamm/aiAI_coder_V2_4B" \ --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": "wefamm/aiAI_coder_V2_4B", "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 "wefamm/aiAI_coder_V2_4B" \ --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": "wefamm/aiAI_coder_V2_4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wefamm/aiAI_coder_V2_4B with Docker Model Runner:
docker model run hf.co/wefamm/aiAI_coder_V2_4B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,295 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
-
|
| 21 |
-
- **Funded by [optional]:** [More Information Needed]
|
| 22 |
-
- **Shared by [optional]:** [More Information Needed]
|
| 23 |
-
- **Model type:** [More Information Needed]
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
###
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
### Out-of-Scope Use
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
-
|
| 57 |
|
| 58 |
## Bias, Risks, and Limitations
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
|
|
|
|
|
|
| 63 |
|
| 64 |
### Recommendations
|
| 65 |
|
| 66 |
-
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
## How to Get Started with the Model
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
[More Information Needed]
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
|
|
|
|
|
|
|
| 89 |
|
| 90 |
-
|
| 91 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
| 96 |
|
| 97 |
-
|
|
|
|
| 98 |
|
| 99 |
-
|
|
|
|
| 100 |
|
| 101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
|
| 103 |
-
|
| 104 |
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
|
| 115 |
-
|
| 116 |
|
| 117 |
-
|
| 118 |
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
|
| 122 |
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
-
|
| 126 |
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
-
|
| 130 |
|
| 131 |
-
|
| 132 |
|
|
|
|
| 133 |
|
|
|
|
|
|
|
| 134 |
|
| 135 |
-
|
| 136 |
|
| 137 |
-
|
| 138 |
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
-
|
| 142 |
|
| 143 |
-
|
| 144 |
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
-
-
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
|
| 153 |
-
|
| 154 |
|
| 155 |
-
|
| 156 |
|
| 157 |
-
|
| 158 |
|
| 159 |
-
|
| 160 |
|
| 161 |
-
|
|
|
|
|
|
|
| 162 |
|
| 163 |
-
|
| 164 |
|
| 165 |
-
|
| 166 |
|
| 167 |
-
|
| 168 |
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
-
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
| 176 |
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
-
|
| 180 |
|
| 181 |
-
|
| 182 |
|
| 183 |
-
|
|
|
|
| 184 |
|
| 185 |
-
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
| 190 |
|
| 191 |
-
|
| 192 |
|
| 193 |
-
|
|
|
|
|
|
|
| 194 |
|
| 195 |
-
|
| 196 |
|
| 197 |
-
|
| 198 |
|
| 199 |
-
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- coding
|
| 5 |
+
- reasoning
|
| 6 |
+
- language
|
| 7 |
+
- python
|
| 8 |
+
- javascript
|
| 9 |
+
- sql
|
| 10 |
+
- agentic
|
| 11 |
+
- lora
|
| 12 |
+
- sft
|
| 13 |
+
- qwen
|
| 14 |
+
license: mit
|
| 15 |
+
base_model: Qwen/Qwen3.5-4B-Thinking
|
| 16 |
+
language:
|
| 17 |
+
- en
|
| 18 |
+
pipeline_tag: text-generation
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# aiAI Coder V2
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
**4B Parameters • Production-Grade Code Generation • Full-Stack System Design**
|
| 24 |
|
| 25 |
+
---
|
| 26 |
|
| 27 |
## Model Details
|
| 28 |
|
| 29 |
+
- **Base Model:** Qwen/Qwen3.5-4B-Thinking
|
| 30 |
+
- **Parameter Count:** 4B
|
| 31 |
+
- **Language:** English
|
| 32 |
+
- **License:** MIT
|
| 33 |
|
| 34 |
+
---
|
| 35 |
|
| 36 |
+
## Model Description
|
| 37 |
|
| 38 |
+
aiAI Coder V2 is a fine-tuned version of Qwen3.5-4B-Thinking, trained on a custom dataset distilled from Grok. This release represents a significant step forward from V1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
V1 (~5.6K examples) produced competent interview-style code. V2 (~28K examples) generates production-grade code across Python, JavaScript, and SQL, and can design scalable, load-balanced applications with proper prompting.
|
| 41 |
|
| 42 |
+
This model was trained on a single cloud 5090 in under 2 hours, keeping costs low while achieving major capability gains.
|
| 43 |
|
| 44 |
+
For user convenience, we have merged the LoRA adapter with the base model so you can download and test directly with Transformers without needing to load the base model separately.
|
|
|
|
|
|
|
| 45 |
|
| 46 |
+
---
|
| 47 |
|
| 48 |
+
## Milestone Status
|
| 49 |
|
| 50 |
+
- Code Generation ✅ Achieved
|
| 51 |
+
- Debugging ✅ Achieved
|
| 52 |
+
- System Design ✅ Achieved
|
| 53 |
+
- Production Readiness ✅ Achieved
|
| 54 |
+
- Scaling Thinking ✅ Achieved
|
| 55 |
+
- Security Awareness ✅ Achieved
|
| 56 |
+
- Full-Stack Knowledge ✅ Achieved
|
| 57 |
+
- Agentic Capability 🚧 In Progress (V3)
|
| 58 |
|
| 59 |
+
---
|
| 60 |
|
| 61 |
+
## Uses
|
| 62 |
|
| 63 |
+
### Direct Use
|
| 64 |
|
| 65 |
+
This model is intended for:
|
| 66 |
|
| 67 |
+
- Code generation and completion
|
| 68 |
+
- Debugging and bug fixing
|
| 69 |
+
- System design and architecture planning
|
| 70 |
+
- SQL query generation and optimization
|
| 71 |
+
- Educational purposes and prototyping
|
| 72 |
|
| 73 |
### Out-of-Scope Use
|
| 74 |
|
| 75 |
+
- Production deployment without human review
|
| 76 |
+
- Safety-critical systems without validation
|
| 77 |
+
- Generating malicious code
|
| 78 |
+
- Any use violating applicable laws
|
| 79 |
|
| 80 |
+
---
|
| 81 |
|
| 82 |
## Bias, Risks, and Limitations
|
| 83 |
|
| 84 |
+
- May occasionally hallucinate or produce incorrect code.
|
| 85 |
+
- Generated code should be reviewed for security vulnerabilities.
|
| 86 |
+
- Primarily trained on English data; other languages may perform poorly.
|
| 87 |
+
- Context window is large (262K tokens) but may degrade at extreme lengths.
|
| 88 |
+
- Not fully agentic; best used with tooling wrappers like OpenCode.
|
| 89 |
|
| 90 |
### Recommendations
|
| 91 |
|
| 92 |
+
- Review all generated code before deployment.
|
| 93 |
+
- Run generated code in sandboxed environments.
|
| 94 |
+
- Use safety filters for disallowed content.
|
| 95 |
|
| 96 |
+
---
|
| 97 |
|
| 98 |
## How to Get Started with the Model
|
| 99 |
|
| 100 |
+
### Load with Transformers
|
|
|
|
|
|
|
| 101 |
|
| 102 |
+
```python
|
| 103 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 104 |
+
import torch
|
| 105 |
|
| 106 |
+
model_name = "aiAI_coder_V2_4B"
|
| 107 |
|
| 108 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 109 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 110 |
+
model_name,
|
| 111 |
+
torch_dtype=torch.bfloat16,
|
| 112 |
+
device_map="auto"
|
| 113 |
+
)
|
| 114 |
|
| 115 |
+
messages = [
|
| 116 |
+
{"role": "system", "content": "You are a helpful coding assistant."},
|
| 117 |
+
{"role": "user", "content": "Write a Python function to reverse a linked list in-place."}
|
| 118 |
+
]
|
| 119 |
|
| 120 |
+
inputs = tokenizer.apply_chat_template(
|
| 121 |
+
messages,
|
| 122 |
+
add_generation_prompt=True,
|
| 123 |
+
return_tensors="pt"
|
| 124 |
+
).to(model.device)
|
| 125 |
|
| 126 |
+
outputs = model.generate(
|
| 127 |
+
inputs,
|
| 128 |
+
max_new_tokens=1024,
|
| 129 |
+
temperature=0.2,
|
| 130 |
+
do_sample=True
|
| 131 |
+
)
|
| 132 |
|
| 133 |
+
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
|
| 134 |
+
print(response)
|
| 135 |
+
```
|
| 136 |
|
| 137 |
+
Load with vLLM (Production)
|
| 138 |
|
| 139 |
+
```bash
|
| 140 |
+
vllm serve aiAI_coder_V2_4B \
|
| 141 |
+
--max-model-len 8192 \
|
| 142 |
+
--tensor-parallel-size 1 \
|
| 143 |
+
--dtype bfloat16
|
| 144 |
+
```
|
| 145 |
|
| 146 |
+
Load with Ollama
|
| 147 |
|
| 148 |
+
Create a Modelfile:
|
| 149 |
|
| 150 |
+
```dockerfile
|
| 151 |
+
FROM aiAI_coder_V2_4B
|
| 152 |
|
| 153 |
+
PARAMETER temperature 0.2
|
| 154 |
+
PARAMETER num_ctx 8192
|
| 155 |
|
| 156 |
+
TEMPLATE """{{ if .System }}<|im_start|>system
|
| 157 |
+
{{ .System }}<|im_end|>
|
| 158 |
+
{{ end }}{{ if .Prompt }}<|im_start|>user
|
| 159 |
+
{{ .Prompt }}<|im_end|>
|
| 160 |
+
{{ end }}<|im_start|>assistant
|
| 161 |
+
"""
|
| 162 |
+
```
|
| 163 |
|
| 164 |
+
Then run:
|
| 165 |
|
| 166 |
+
```bash
|
| 167 |
+
ollama create aiAI-coder -f Modelfile
|
| 168 |
+
ollama run aiAI-coder
|
| 169 |
+
```
|
| 170 |
|
| 171 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
+
Training Details
|
| 174 |
|
| 175 |
+
Training Data
|
| 176 |
|
| 177 |
+
· Source: Distilled completions from Grok
|
| 178 |
+
· Size: ~28,000 examples
|
| 179 |
+
· Format: Multi-turn conversations with reasoning blocks
|
| 180 |
+
· Focus Areas: Python, JavaScript, SQL, debugging, system design
|
| 181 |
|
| 182 |
+
Training Procedure
|
| 183 |
|
| 184 |
+
· Method: LoRA Supervised Fine-Tuning (SFT)
|
| 185 |
+
· Epochs: 1
|
| 186 |
+
· Hardware: Single NVIDIA 5090 (32GB VRAM)
|
| 187 |
+
· Training Time: <2 hours
|
| 188 |
|
| 189 |
+
Training Hyperparameters
|
| 190 |
|
| 191 |
+
Parameter Value
|
| 192 |
+
LoRA Rank (r) 16
|
| 193 |
+
LoRA Alpha 32
|
| 194 |
+
Learning Rate 2e-4
|
| 195 |
+
Batch Size 4
|
| 196 |
+
Context Length 2048
|
| 197 |
+
Optimizer AdamW
|
| 198 |
+
Scheduler Cosine with warmup
|
| 199 |
|
| 200 |
+
---
|
| 201 |
|
| 202 |
+
Evaluation
|
| 203 |
|
| 204 |
+
Benchmarks
|
| 205 |
|
| 206 |
+
· HumanEval (Pass@1): Coming Soon
|
| 207 |
+
· LiveCodeBench-v6: 54.2% (base model score)
|
| 208 |
|
| 209 |
+
Internal Testing
|
| 210 |
|
| 211 |
+
The model passed comprehensive custom tests across:
|
| 212 |
|
| 213 |
+
· Advanced algorithms (Manacher's O(n) palindrome)
|
| 214 |
+
· System design (URL shortener with scaling)
|
| 215 |
+
· Debugging (identifying subtle bugs with explanations)
|
| 216 |
+
· OOP (encapsulation, validation)
|
| 217 |
+
· Async (concurrent downloads)
|
| 218 |
+
· Database design (PostgreSQL schema)
|
| 219 |
+
· Security (rate limiting, injection prevention)
|
| 220 |
|
| 221 |
+
---
|
| 222 |
|
| 223 |
+
Environmental Impact
|
| 224 |
|
| 225 |
+
· Hardware Type: NVIDIA 5090 (32GB VRAM)
|
| 226 |
+
· Hours Used: <2 hours
|
| 227 |
+
· Cloud Provider: AutoDL
|
| 228 |
+
· Carbon Emitted: Estimated ~0.5–1.0 kg CO2 equivalent
|
| 229 |
|
| 230 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
+
Technical Specifications
|
| 233 |
|
| 234 |
+
Hardware
|
| 235 |
|
| 236 |
+
· NVIDIA 5090 with 32GB VRAM
|
| 237 |
|
| 238 |
+
Software
|
| 239 |
|
| 240 |
+
· Transformers
|
| 241 |
+
· PEFT (LoRA)
|
| 242 |
+
· PyTorch
|
| 243 |
|
| 244 |
+
---
|
| 245 |
|
| 246 |
+
Citation
|
| 247 |
|
| 248 |
+
If you use this model in your research or applications, please cite:
|
| 249 |
|
| 250 |
+
```bibtex
|
| 251 |
+
@misc{aiAI-coder-V2,
|
| 252 |
+
author = {aiAI},
|
| 253 |
+
title = {aiAI Coder V2: Production-Grade 4B Coding Assistant},
|
| 254 |
+
year = {2026},
|
| 255 |
+
publisher = {Hugging Face},
|
| 256 |
+
howpublished = {\url{https://huggingface.co/aiAI_coder_V2_4B}}
|
| 257 |
+
}
|
| 258 |
+
```
|
| 259 |
|
| 260 |
+
---
|
| 261 |
|
| 262 |
+
More Information
|
| 263 |
|
| 264 |
+
V3 is in development and will focus on:
|
| 265 |
|
| 266 |
+
· Full agentic capabilities
|
| 267 |
+
· Multi-turn task completion
|
| 268 |
+
· Tool calling integration
|
| 269 |
+
· Enhanced reasoning
|
| 270 |
+
· Expanded language support
|
| 271 |
|
| 272 |
+
---
|
| 273 |
|
| 274 |
+
Model Card Authors
|
| 275 |
|
| 276 |
+
· aiAI
|
| 277 |
+
· nitrous-0xide (funding)
|
| 278 |
|
| 279 |
+
Model Card Contact
|
| 280 |
|
| 281 |
+
wefam67@proton.me
|
| 282 |
|
| 283 |
+
---
|
| 284 |
|
| 285 |
+
Acknowledgments
|
| 286 |
|
| 287 |
+
· Base Model: Qwen/Qwen3.5-4B-Thinking by Alibaba
|
| 288 |
+
· Distillation Source: Grok
|
| 289 |
+
· Training Infrastructure: AutoDL
|
| 290 |
|
| 291 |
+
---
|
| 292 |
|
| 293 |
+
This model is imperfect — V3 will be better. We're iterating fast. Expect improvements in the coming days/weeks.
|
| 294 |
|
| 295 |
+
Happy coding! 🚀
|