wefamm commited on
Commit
768813e
·
verified ·
1 Parent(s): 6043671

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +199 -103
README.md CHANGED
@@ -1,199 +1,295 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
 
11
 
12
  ## Model Details
13
 
14
- ### Model Description
 
 
 
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
 
20
- - **Developed by:** [More Information Needed]
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
- ### Model Sources [optional]
29
 
30
- <!-- Provide the basic links for the model. -->
31
 
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
- ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
 
40
- ### Direct Use
 
 
 
 
 
 
 
41
 
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
 
44
- [More Information Needed]
45
 
46
- ### Downstream Use [optional]
47
 
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
- [More Information Needed]
 
 
 
 
51
 
52
  ### Out-of-Scope Use
53
 
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
 
 
 
55
 
56
- [More Information Needed]
57
 
58
  ## Bias, Risks, and Limitations
59
 
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
 
 
63
 
64
  ### Recommendations
65
 
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
 
 
67
 
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
  ## How to Get Started with the Model
71
 
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
 
76
- ## Training Details
 
 
77
 
78
- ### Training Data
79
 
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
 
 
 
 
 
81
 
82
- [More Information Needed]
 
 
 
83
 
84
- ### Training Procedure
 
 
 
 
85
 
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
 
 
 
 
 
87
 
88
- #### Preprocessing [optional]
 
 
89
 
90
- [More Information Needed]
91
 
 
 
 
 
 
 
92
 
93
- #### Training Hyperparameters
94
 
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
 
97
- #### Speeds, Sizes, Times [optional]
 
98
 
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
 
100
 
101
- [More Information Needed]
 
 
 
 
 
 
102
 
103
- ## Evaluation
104
 
105
- <!-- This section describes the evaluation protocols and provides the results. -->
 
 
 
106
 
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
 
115
- #### Factors
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
- [More Information Needed]
 
 
 
120
 
121
- #### Metrics
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
 
 
 
124
 
125
- [More Information Needed]
126
 
127
- ### Results
 
 
 
 
 
 
 
128
 
129
- [More Information Needed]
130
 
131
- #### Summary
132
 
 
133
 
 
 
134
 
135
- ## Model Examination [optional]
136
 
137
- <!-- Relevant interpretability work for the model goes here -->
138
 
139
- [More Information Needed]
 
 
 
 
 
 
140
 
141
- ## Environmental Impact
142
 
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
 
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
 
 
 
146
 
147
- - **Hardware Type:** [More Information Needed]
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
- ## Technical Specifications [optional]
154
 
155
- ### Model Architecture and Objective
156
 
157
- [More Information Needed]
158
 
159
- ### Compute Infrastructure
160
 
161
- [More Information Needed]
 
 
162
 
163
- #### Hardware
164
 
165
- [More Information Needed]
166
 
167
- #### Software
168
 
169
- [More Information Needed]
 
 
 
 
 
 
 
 
170
 
171
- ## Citation [optional]
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
- **BibTeX:**
176
 
177
- [More Information Needed]
 
 
 
 
178
 
179
- **APA:**
180
 
181
- [More Information Needed]
182
 
183
- ## Glossary [optional]
 
184
 
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
 
187
- [More Information Needed]
188
 
189
- ## More Information [optional]
190
 
191
- [More Information Needed]
192
 
193
- ## Model Card Authors [optional]
 
 
194
 
195
- [More Information Needed]
196
 
197
- ## Model Card Contact
198
 
199
- [More Information Needed]
 
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! 🚀