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
File size: 6,513 Bytes
a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 1fd57ef 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 48e474c a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e 48e474c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e 48e474c a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 9b70bc3 a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e a760b6c 768813e | 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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 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 68 69 70 71 72 73 74 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 110 111 112 113 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 149 150 151 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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | ---
library_name: transformers
tags:
- coding
- reasoning
- language
- python
- javascript
- sql
- agentic
- lora
- sft
- qwen
license: mit
base_model: Qwen/Qwen3.5-4B-Thinking
language:
- en
pipeline_tag: text-generation
---
# aiAI Coder V2
**4B Parameters • Production-Grade Code Generation • Full-Stack System Design**
---
## Model Details
- **Base Model:** Qwen/Qwen3.5-4B-Thinking
- **Parameter Count:** 4B
- **Language:** English
- **License:** MIT
---
## Model Description
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.
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.
This model was trained on a single cloud 5090 in under 2 hours, keeping costs low while achieving major capability gains.
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.
---
## Milestone Status
- Code Generation ✅ Achieved
- Debugging ✅ Achieved
- System Design ✅ Achieved
- Production Readiness ✅ Achieved
- Scaling Thinking ✅ Achieved
- Security Awareness ✅ Achieved
- Full-Stack Knowledge ✅ Achieved
- Agentic Capability 🚧 In Progress (V3)
## Reports
In a single prompt, aiAI Coder V2 (4B) generated a complete production-ready URL shortener including:
PostgreSQL schema with UUID PK, proper indexes, and atomic click counting
FastAPI backend with Redis caching, rate limiting, and collision handling
Multi-stage Docker + docker-compose with health checks
Frontend + scaling strategy for 100M requests/day
Security considerations (rate limiting, input validation, etc.)
DeepSeek evaluation: 10/10 across Database Schema, Backend API, Caching, Deployment, Scaling, and Security.
---
## Uses
### Direct Use
This model is intended for:
- Code generation and completion
- Debugging and bug fixing
- System design and architecture planning
- SQL query generation and optimization
- Educational purposes and prototyping
### Out-of-Scope Use
- Production deployment without human review
- Safety-critical systems without validation
- Generating malicious code
- Any use violating applicable laws
---
## Bias, Risks, and Limitations
- May occasionally hallucinate or produce incorrect code.
- Generated code should be reviewed for security vulnerabilities.
- Primarily trained on English data; other languages may perform poorly.
- Context window is large (262K tokens) but may degrade at extreme lengths.
- Not fully agentic; best used with tooling wrappers like OpenCode.
### Recommendations
- Review all generated code before deployment.
- Run generated code in sandboxed environments.
- Use safety filters for disallowed content.
---
## How to Get Started with the Model
### Load with Transformers
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "wefamm/aiAI_coder_V2_4B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto"
)
messages = [
{"role": "system", "content": "You are a helpful coding assistant."},
{"role": "user", "content": "Write a Python function to reverse a linked list in-place."}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(
inputs,
max_new_tokens=1024,
temperature=0.2,
do_sample=True
)
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
print(response)
```
Load with vLLM (Production)
```bash
vllm serve wefamm/aiAI_coder_V2_4B \
--max-model-len 8192 \
--tensor-parallel-size 1 \
--dtype bfloat16
```
Load with Ollama
Create a Modelfile:
```dockerfile
FROM wefamm/aiAI_coder_V2_4B
PARAMETER temperature 0.2
PARAMETER num_ctx 8192
TEMPLATE """{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
"""
```
Then run:
```bash
ollama create aiAI-coder -f Modelfile
ollama run aiAI-coder
```
---
Training Details
Training Data
· Source: Distilled completions from Grok
· Size: ~28,000 examples
· Format: Multi-turn conversations with reasoning blocks
· Focus Areas: Python, JavaScript, SQL, debugging, system design
Training Procedure
· Method: LoRA Supervised Fine-Tuning (SFT)
· Epochs: 1
· Hardware: Single NVIDIA 5090 (32GB VRAM)
· Training Time: <2 hours
---
Evaluation
Benchmarks
· HumanEval (Pass@1): Coming Soon
· LiveCodeBench-v6: 54.2% (base model score)
Internal Testing
The model passed comprehensive custom tests across:
· Advanced algorithms (Manacher's O(n) palindrome)
· System design (URL shortener with scaling)
· Debugging (identifying subtle bugs with explanations)
· OOP (encapsulation, validation)
· Async (concurrent downloads)
· Database design (PostgreSQL schema)
· Security (rate limiting, injection prevention)
---
Environmental Impact
· Hardware Type: NVIDIA 5090 (32GB VRAM)
· Hours Used: <2 hours
· Cloud Provider: AutoDL
· Carbon Emitted: Estimated ~0.5–1.0 kg CO2 equivalent
---
Technical Specifications
Hardware
· NVIDIA 5090 with 32GB VRAM
Software
· Transformers
· PEFT (LoRA)
· PyTorch
---
Citation
If you use this model in your research or applications, please cite:
```bibtex
@misc{aiAI-coder-V2,
author = {aiAI},
title = {aiAI Coder V2: Production-Grade 4B Coding Assistant},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/aiAI_coder_V2_4B}}
}
```
---
More Information
V3 is in development and will focus on:
· Full agentic capabilities
· Multi-turn task completion
· Tool calling integration
· Enhanced reasoning
· Expanded language support
---
Model Card Authors
· aiAI
· nitrous-0xide (funding)
Model Card Contact
wefam67@proton.me
---
Acknowledgments
· Base Model: Qwen/Qwen3.5-4B-Thinking by Alibaba
· Distillation Source: Grok
· Training Infrastructure: AutoDL
---
This model is imperfect — V3 will be better. We're iterating fast. Expect improvements in the coming days/weeks.
Happy coding! 🚀
|