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)# 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=40) 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
- aiAI Coder V2
- Model Details
- Model Description
- Milestone Status
- 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
- Bias, Risks, and Limitations
- How to Get Started with the Model
- Model Details
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
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)
vllm serve wefamm/aiAI_coder_V2_4B \
--max-model-len 8192 \
--tensor-parallel-size 1 \
--dtype bfloat16
Load with Ollama
Create a Modelfile:
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:
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:
@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
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! 🚀
- Downloads last month
- 391
docker model run hf.co/wefamm/aiAI_coder_V2_4B