codavidgarcia commited on
Commit
2e8ed21
·
verified ·
1 Parent(s): 5957a94

Update README.md (#1)

Browse files

- Update README.md (ae814f064bf4e10547266a9886a3ffaa835919ac)

Files changed (1) hide show
  1. README.md +242 -116
README.md CHANGED
@@ -1,210 +1,336 @@
1
- ---
2
- base_model: unsloth/qwen2.5-coder-14b-instruct-bnb-4bit
3
- library_name: peft
4
- pipeline_tag: text-generation
5
- tags:
6
- - base_model:adapter:unsloth/qwen2.5-coder-14b-instruct-bnb-4bit
7
- - lora
8
- - sft
9
- - transformers
10
- - trl
11
- - unsloth
12
- ---
13
-
14
- # Model Card for Model ID
15
 
16
- <!-- Provide a quick summary of what the model is/does. -->
17
 
 
18
 
 
19
 
20
- ## Model Details
21
-
22
- ### Model Description
23
 
24
- <!-- Provide a longer summary of what this model is. -->
25
 
 
 
 
 
 
26
 
 
27
 
28
- - **Developed by:** [More Information Needed]
29
- - **Funded by [optional]:** [More Information Needed]
30
- - **Shared by [optional]:** [More Information Needed]
31
- - **Model type:** [More Information Needed]
32
- - **Language(s) (NLP):** [More Information Needed]
33
- - **License:** [More Information Needed]
34
- - **Finetuned from model [optional]:** [More Information Needed]
35
 
36
- ### Model Sources [optional]
37
 
38
- <!-- Provide the basic links for the model. -->
39
 
40
- - **Repository:** [More Information Needed]
41
- - **Paper [optional]:** [More Information Needed]
42
- - **Demo [optional]:** [More Information Needed]
43
 
44
- ## Uses
 
 
 
 
45
 
46
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
47
 
48
- ### Direct Use
49
 
50
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
51
 
52
- [More Information Needed]
53
 
54
- ### Downstream Use [optional]
 
 
 
 
 
55
 
56
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
57
 
58
- [More Information Needed]
59
 
60
- ### Out-of-Scope Use
61
 
62
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
63
 
64
- [More Information Needed]
 
 
 
 
65
 
66
- ## Bias, Risks, and Limitations
67
 
68
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
 
 
 
69
 
70
- [More Information Needed]
71
 
72
- ### Recommendations
73
 
74
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
 
 
75
 
76
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
77
 
78
- ## How to Get Started with the Model
79
 
80
- Use the code below to get started with the model.
81
 
82
- [More Information Needed]
83
 
84
- ## Training Details
 
 
85
 
86
- ### Training Data
87
 
88
- <!-- 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. -->
89
 
90
- [More Information Needed]
 
 
 
 
91
 
92
- ### Training Procedure
93
 
94
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
95
 
96
- #### Preprocessing [optional]
97
 
98
- [More Information Needed]
99
 
 
100
 
101
- #### Training Hyperparameters
 
 
 
102
 
103
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
104
 
105
- #### Speeds, Sizes, Times [optional]
 
 
 
 
106
 
107
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
108
 
109
- [More Information Needed]
110
 
111
- ## Evaluation
112
 
113
- <!-- This section describes the evaluation protocols and provides the results. -->
 
 
 
 
 
 
114
 
115
- ### Testing Data, Factors & Metrics
116
 
117
- #### Testing Data
 
 
118
 
119
- <!-- This should link to a Dataset Card if possible. -->
120
 
121
- [More Information Needed]
122
 
123
- #### Factors
 
 
 
 
 
 
124
 
125
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
126
 
127
- [More Information Needed]
128
 
129
- #### Metrics
130
 
131
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
132
 
133
- [More Information Needed]
134
 
135
- ### Results
 
 
 
 
 
 
136
 
137
- [More Information Needed]
138
 
139
- #### Summary
140
 
 
141
 
 
 
 
 
142
 
143
- ## Model Examination [optional]
144
 
145
- <!-- Relevant interpretability work for the model goes here -->
146
 
147
- [More Information Needed]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
 
149
- ## Environmental Impact
150
 
151
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
152
 
153
- 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).
154
 
155
- - **Hardware Type:** [More Information Needed]
156
- - **Hours used:** [More Information Needed]
157
- - **Cloud Provider:** [More Information Needed]
158
- - **Compute Region:** [More Information Needed]
159
- - **Carbon Emitted:** [More Information Needed]
160
 
161
- ## Technical Specifications [optional]
 
162
 
163
- ### Model Architecture and Objective
 
 
 
 
 
164
 
165
- [More Information Needed]
166
 
167
- ### Compute Infrastructure
 
168
 
169
- [More Information Needed]
 
 
 
 
 
170
 
171
- #### Hardware
172
 
173
- [More Information Needed]
 
174
 
175
- #### Software
 
 
 
176
 
177
- [More Information Needed]
 
178
 
179
- ## Citation [optional]
180
 
181
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
182
 
183
- **BibTeX:**
184
 
185
- [More Information Needed]
186
 
187
- **APA:**
188
 
189
- [More Information Needed]
 
 
190
 
191
- ## Glossary [optional]
192
 
193
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
194
 
195
- [More Information Needed]
196
 
197
- ## More Information [optional]
 
 
198
 
199
- [More Information Needed]
200
 
201
- ## Model Card Authors [optional]
202
 
203
- [More Information Needed]
204
 
205
- ## Model Card Contact
206
 
207
- [More Information Needed]
208
- ### Framework versions
209
 
210
- - PEFT 0.18.0
 
1
+ # Qwen2.5-Coder-14B-Frontend-UI-Architect
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
+ A finetuned variant of **Qwen2.5-Coder-14B-Instruct**, specialized for **frontend engineering**, with a strong focus on **React + TypeScript** and **Tailwind CSS**.
4
 
5
+ The goal of this model is **not** to be a frontier / SOTA LLM, but to be a **practical, fast and reliable workhorse** you can run on **consumer hardware** (via GGUF) while getting UI code quality close to what you would normally expect from paid API models — all fully local and with effectively unlimited usage.
6
 
7
+ ---
8
 
9
+ ## Why This Model
 
 
10
 
11
+ Instead of chasing leaderboard scores, this finetune is designed around a few pragmatic goals:
12
 
13
+ - **Run comfortably on a single consumer GPU or small server** using GGUF quantizations.
14
+ - **Behave like a seasoned frontend engineer** for UI-focused tasks.
15
+ - **Prioritize latency and iteration speed** for rapid UI/UX prototyping.
16
+ - **Produce full, shippable React + TypeScript components**, not just snippets.
17
+ - **Integrate naturally with Tailwind CSS (v4-style utilities)** and modern layout patterns.
18
 
19
+ If you’re building dashboards, internal tools, marketing pages or app shells and want a local model that “just writes solid UI code” at high speed, this is what this finetune is trying to solve.
20
 
21
+ ---
 
 
 
 
 
 
22
 
23
+ ## Model Choice: Why Qwen2.5-Coder and Not Qwen 3.0-Instruct?
24
 
25
+ I experimented with **Qwen 3.0 Instruct** as a base model and actually **finetuned both** Qwen 3.0 and Qwen2.5-Coder on similar frontend/UI datasets.
26
 
27
+ In practice:
 
 
28
 
29
+ - During training, **Qwen2.5-Coder** showed **cleaner, more stable behavior** on UI-heavy examples (React + TS + Tailwind).
30
+ - On downstream tests (building real pages, dashboards and forms), **Qwen2.5-Coder consistently produced better structured UI code**:
31
+ - Fewer hallucinated patterns,
32
+ - More realistic component boundaries,
33
+ - Better alignment with TypeScript + Tailwind usage.
34
 
35
+ Even though Qwen 3.0 is the newer family, for this **very specific niche (frontend UI codegen)**, the **coder-oriented 2.5 base** simply gave better practical results after finetuning. That’s why this release is based on **Qwen2.5-Coder-14B-Instruct** instead of Qwen 3.0.
36
 
37
+ ---
38
 
39
+ ## Overview
40
 
41
+ **Qwen2.5-Coder-14B-Frontend-UI-Architect** is tuned for high-quality code generation across:
42
 
43
+ - **React** (Vite/CRA/Next-style patterns adapted to vanilla React)
44
+ - **TypeScript** (strict-oriented, explicit typing where it adds clarity)
45
+ - **Tailwind CSS v4** (atomic-first, utility-driven styling)
46
+ - **Component architecture & layout composition**
47
+ - **State management** (Zustand, Context API, basic Jotai patterns)
48
+ - **UI/UX best practices** (visual hierarchy, spacing, responsiveness, basic accessibility)
49
 
50
+ It is particularly good at acting as a **UI prototyping companion**: give it a clear description of the page, and it will return a realistic, ready-to-tweak implementation.
51
 
52
+ ---
53
 
54
+ ## What It Does Well
55
 
56
+ ### Frontend / UI Generation
57
 
58
+ - Full **React + TypeScript** component files, ready to drop into a project.
59
+ - **Layouts, dashboards, forms, modals, settings pages**, landing pages.
60
+ - Tailwind-style utility usage with attention to **spacing, typography and alignment**.
61
+ - Sensible **component decomposition** (breaking larger pages into subcomponents when asked).
62
+ - **Responsive behavior** using common breakpoint patterns (e.g. `sm`, `md`, `lg`, `xl`).
63
 
64
+ ### Architecture & Reasoning
65
 
66
+ - Suggests **file/folder structures** for scalable UI projects.
67
+ - Proposes **design system primitives** (buttons, cards, inputs, layout shells, etc.).
68
+ - Can refactor an existing UI into **cleaner, more composable components**.
69
+ - Offers **naming, props design and variant ideas** for design-system-level components.
70
 
71
+ ### Practical Speed & Local Usage
72
 
73
+ Running via **GGUF** in tools like LM Studio, it is tuned to be **fast enough for interactive use**:
74
 
75
+ - Short prompts return full pages in a single generation.
76
+ - Great for “**one screen at a time**” workflows.
77
+ - Well-suited as a **local UI copilot** for iterative front-end work.
78
 
79
+ ---
80
 
81
+ ## Limitations & Recommended Usage Patterns
82
 
83
+ This model sits on top of the Qwen2.5 14B architecture and inherits its **context and scaling limitations**. A few practical notes:
84
 
85
+ ### 1. Best for *building* interfaces, not scanning huge codebases
86
 
87
+ - Works best when you ask it to **create or refactor a single page / screen at a time**.
88
+ - It is **not intended as a repo-wide code-understanding model** for massive monorepos.
89
+ - For large refactors, feed it **just the relevant components** and a **clear description** of the target state.
90
 
91
+ ### 2. Use a “token system” for multi-page apps
92
 
93
+ For complex products, a good pattern is:
94
 
95
+ 1. Define a small **token vocabulary** in your docs or prompt, e.g.:
96
+ - `[DASHBOARD]` – main analytics view
97
+ - `[SETTINGS_ACCOUNT]` – account settings page
98
+ - `[SETTINGS_BILLING]` – billing page
99
+ - `[ADMIN_USERS]` – user management view
100
 
101
+ 2. When prompting the model, **remind it which token you’re working on** and provide a short spec, for example:
102
 
103
+ > “Generate the React + TS page for [SETTINGS_BILLING]: …”
104
 
105
+ 3. Keep each generation centered on **one token/page at a time**, and stitch things together in your codebase.
106
 
107
+ This keeps the context clean and helps the model stay **consistent and focused**, while still supporting high-quality, reusable UIs.
108
 
109
+ ### 3. Refactoring vs. long-context editing
110
 
111
+ - You *can* paste existing components and ask for **refactors, cleanup, or modernized layout**.
112
+ - For very long files, consider:
113
+ - Sending only the parts you actually want to change.
114
+ - Asking for **stepwise changes** (e.g., first refactor layout, then add accessibility tweaks).
115
 
116
+ ### 4. General model limitations
117
 
118
+ - Not a frontier model; for very complex multi-step reasoning or huge refactors, **SOTA hosted models will still be stronger**.
119
+ - Can occasionally:
120
+ - Over-abstract components when you over-emphasize “architecture”.
121
+ - Invent imports or hooks if you’re not explicit about your tech stack.
122
+ - Works best when the prompt is **concrete about libraries and constraints** (React version, routing, state management, etc.).
123
 
124
+ If you run into consistent failure patterns, I would genuinely appreciate detailed reports (see **Feedback** below).
125
 
126
+ ---
127
 
128
+ ## Training Details
129
 
130
+ - **Base model:** `Qwen/Qwen2.5-Coder-14B-Instruct`
131
+ - **Finetuning method:** QLoRA (via Unsloth)
132
+ - **Trainable parameters:** ~68.8M (≈0.46%)
133
+ - **Epochs:** 2
134
+ - **Training examples:** 12,805
135
+ - **Effective batch size:** 16
136
+ - **Hardware:** A100-40GB (Unsloth-accelerated pipeline)
137
 
138
+ The dataset is heavily biased toward:
139
 
140
+ - **Full React + TS component files** (not fragments).
141
+ - **Tailwind-based layouts**.
142
+ - Clear, real-world-style UI specs (dashboards, settings, CRUD, internal tools, etc.).
143
 
144
+ ### Loss Curve (Summary)
145
 
146
+ This is a simple snapshot of the training loss:
147
 
148
+ | Step | Loss |
149
+ |------|------|
150
+ | 20 | 1.24 |
151
+ | 100 | 0.35 |
152
+ | 500 | 0.29 |
153
+ | 1000 | 0.25 |
154
+ | Final | **0.26** |
155
 
156
+ Loss converged smoothly with no visible instability. A small held-out set of UI-oriented instructions showed stable behavior (sensible structure, no collapse). The main focus was **practical behavior** over chasing the lowest possible loss.
157
 
158
+ ---
159
 
160
+ ## Files & Formats
161
 
162
+ ### HuggingFace (safetensors)
163
 
164
+ Typical HF layout:
165
 
166
+ - `config.json`
167
+ - `tokenizer.json`
168
+ - `tokenizer_config.json`
169
+ - `vocab.json`
170
+ - `merges.txt`
171
+ - `model-00001-of-00006.safetensors` … `model-00006-of-00006.safetensors`
172
+ - `model.safetensors.index.json`
173
 
174
+ ### GGUF (for llama.cpp, LM Studio, etc.)
175
 
176
+ Converted via a Qwen2-compatible fork of `convert_hf_to_gguf.py` from `llama.cpp`.
177
 
178
+ Available variants:
179
 
180
+ - `qwen2.5-coder-14b-frontend-ui-architect-q4_K_M.gguf`
181
+ - `qwen2.5-coder-14b-frontend-ui-architect-q5_K_M.gguf`
182
+ - `qwen2.5-coder-14b-frontend-ui-architect-q8_0.gguf`
183
+ - `qwen2.5-coder-14b-frontend-ui-architect-f16.gguf`
184
 
185
+ Pick the quantization that best fits your hardware and latency needs. For most consumer GPUs and recent CPUs, **q4_K_M** is a good starting point.
186
 
187
+ ---
188
 
189
+ ## Usage
190
+
191
+ ### Python (Transformers)
192
+
193
+ ```python
194
+ from transformers import AutoModelForCausalLM, AutoTokenizer
195
+ import torch
196
+
197
+ model_name = "codavidgarcia/qwen2.5-coder-14b-frontend-ui-architect"
198
+
199
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
200
+ model = AutoModelForCausalLM.from_pretrained(
201
+ model_name,
202
+ torch_dtype=torch.float16,
203
+ device_map="auto"
204
+ )
205
+
206
+ prompt = (
207
+ "You are a senior frontend engineer.
208
+
209
+ "
210
+ "Build a clean, production-ready React + TypeScript page using Tailwind CSS.
211
+ "
212
+ "Requirements:
213
+ "
214
+ "- Dashboard layout with sidebar and top bar
215
+ "
216
+ "- Cards for key metrics
217
+ "
218
+ "- Responsive behavior for mobile and desktop
219
+ "
220
+ "- Return a full file, no pseudo-code.
221
+ "
222
+ )
223
+
224
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
225
+ outputs = model.generate(
226
+ **inputs,
227
+ max_new_tokens=800,
228
+ do_sample=True,
229
+ temperature=0.3,
230
+ top_p=0.9
231
+ )
232
+
233
+ print(tokenizer.decode(outputs[0], skip_special_tokens=True))
234
+ ```
235
+
236
+ ### LM Studio (GGUF)
237
+
238
+ 1. Download one of the `*.gguf` files.
239
+ 2. In **LM Studio**: go to **Local Models → Add model** and load the GGUF file.
240
+ 3. Suggested configuration:
241
+ - **Context length:** 8192
242
+ - **Temperature:** 0.2–0.4
243
+ - **Repetition penalty:** 1.05–1.15
244
+
245
+ 4. Use a focused system / instruction prompt, for example:
246
+
247
+ ```text
248
+ You are a senior frontend engineer.
249
+
250
+ Always:
251
+ - Produce full, production-ready React + TypeScript components.
252
+ - Use Tailwind CSS utility classes (v4-style).
253
+ - Prefer clear layout hierarchy, good spacing and readable typography.
254
+ - Avoid pseudo-code. Return concrete code that can be pasted into a project.
255
+ ```
256
+
257
+ Then provide your page or component requirements in the user message.
258
 
259
+ ---
260
 
261
+ ## Recommended Prompting Patterns
262
 
263
+ A few patterns that tend to work well in practice:
264
 
265
+ ### 1. React Page / Screen
 
 
 
 
266
 
267
+ ```text
268
+ You are a senior frontend engineer.
269
 
270
+ Build a clean, production-ready React + TypeScript page:
271
+ - Use Tailwind CSS for all styling.
272
+ - Return a single full `.tsx` file.
273
+ - Include a default export component.
274
+ - No comments, no placeholder lorem ipsum – use realistic labels.
275
+ ```
276
 
277
+ ### 2. Component Library / Design System Primitives
278
 
279
+ ```text
280
+ Act as a frontend architect.
281
 
282
+ Design a small component system for a product dashboard:
283
+ - Button, Card, PageShell, Sidebar, TopBar
284
+ - Show props and variants for each component
285
+ - Use React + TypeScript + Tailwind
286
+ - Suggest a folder structure for these components
287
+ ```
288
 
289
+ ### 3. Refactor an Existing Component
290
 
291
+ ```text
292
+ You are a senior frontend engineer.
293
 
294
+ Refactor the following React + TypeScript component:
295
+ - Improve the layout and spacing using Tailwind.
296
+ - Keep the existing behavior.
297
+ - Extract repeated pieces into smaller components if it helps readability.
298
 
299
+ [PASTE COMPONENT HERE]
300
+ ```
301
 
302
+ Feel free to adapt these patterns to your own stack and conventions.
303
 
304
+ ---
305
 
306
+ ## Feedback & Improvements
307
 
308
+ This is a relatively small, targeted finetune, and I’m quite happy with how much UI behavior it managed to internalize given the scale. That said, **I absolutely welcome feedback**.
309
 
310
+ If you:
311
 
312
+ - Notice systematic mistakes,
313
+ - See opportunities for better architectural defaults,
314
+ - Or have specific failure cases (prompt + input + expected vs actual output),
315
 
316
+ please open an **Issue or Discussion** on the HuggingFace repo. Concrete examples are extremely valuable for future finetuning rounds and for improving the prompt recommendations.
317
 
318
+ ---
319
 
320
+ ## License
321
 
322
+ - **Base model:** Qwen/Qwen2.5-Coder-14B-Instruct — follows the original Qwen license.
323
+ - **Finetuning code, configuration, and additional assets:** released under the **MIT License**.
324
+ - **Finetuned weights:** inherit any obligations from the base model’s license. Please refer to Qwen’s official license terms for usage in commercial or sensitive contexts.
325
 
326
+ Attribution to the original finetune author (`codavidgarcia`) is appreciated but not strictly required beyond what the underlying licenses demand.
327
 
328
+ ---
329
 
330
+ ## Contact
331
 
332
+ For questions, feedback, or suggestions:
333
 
334
+ - Open an **Issue** or **Discussion** on the HuggingFace model page.
 
335
 
336
+ If you end up using this model in your own tools, dashboards, or UI builders, I’d genuinely love to hear how it performs for you and what could be improved in the next iteration.