aiAI_coder_V2_4B / README.md
wefamm's picture
Update README.md
48e474c verified
|
Raw
History Blame Contribute Delete
6.51 kB
---
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! 🚀