Starred09 commited on
Commit
05e5a00
·
1 Parent(s): b75ef7d

Rewrite model card for Graphite 1.0 4B and add Apache-2.0 license

Browse files
Files changed (2) hide show
  1. LICENSE +162 -0
  2. README.md +330 -37
LICENSE ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation or
31
+ translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work (an example is provided in the Appendix
37
+ below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form,
40
+ that is based on (or derived from) the Work and for which the editorial
41
+ revisions, annotations, elaborations, or other modifications represent, as a
42
+ whole, an original work of authorship. For the purposes of this License,
43
+ Derivative Works shall not include works that remain separable from, or
44
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
45
+ Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including the original
48
+ version of the Work and any modifications or additions to that Work or
49
+ Derivative Works thereof, that is intentionally submitted to Licensor for
50
+ inclusion in the Work by the copyright owner or by an individual or Legal
51
+ Entity authorized to submit on behalf of the copyright owner. For the
52
+ purposes of this definition, "submitted" means any form of electronic, verbal,
53
+ or written communication sent to the Licensor or its representatives,
54
+ including but not limited to communication on electronic mailing lists,
55
+ source code control systems, and issue tracking systems that are managed by,
56
+ or on behalf of, the Licensor for the purpose of discussing and improving the
57
+ Work, but excluding communication that is conspicuously marked or otherwise
58
+ designated in writing by the copyright owner as "Not a Contribution."
59
+
60
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
61
+ behalf of whom a Contribution has been received by Licensor and subsequently
62
+ incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
65
+ License, each Contributor hereby grants to You a perpetual, worldwide,
66
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
67
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
68
+ sublicense, and distribute the Work and such Derivative Works in Source or
69
+ Object form.
70
+
71
+ 3. Grant of Patent License. Subject to the terms and conditions of this
72
+ License, each Contributor hereby grants to You a perpetual, worldwide,
73
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
74
+ section) patent license to make, have made, use, offer to sell, sell, import,
75
+ and otherwise transfer the Work, where such license applies only to those
76
+ patent claims licensable by such Contributor that are necessarily infringed
77
+ by their Contribution(s) alone or by combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You institute
79
+ patent litigation against any entity (including a cross-claim or counterclaim
80
+ in a lawsuit) alleging that the Work or a Contribution incorporated within
81
+ the Work constitutes direct or contributory patent infringement, then any
82
+ patent licenses granted to You under this License for that Work shall
83
+ terminate as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
86
+ Derivative Works thereof in any medium, with or without modifications, and in
87
+ Source or Object form, provided that You meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or Derivative Works a copy
90
+ of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices stating that
93
+ You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works that You
96
+ distribute, all copyright, patent, trademark, and attribution notices from
97
+ the Source form of the Work, excluding those notices that do not pertain to
98
+ any part of the Derivative Works; and
99
+
100
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
101
+ then any Derivative Works that You distribute must include a readable copy of
102
+ the attribution notices contained within such NOTICE file, excluding those
103
+ notices that do not pertain to any part of the Derivative Works, in at least
104
+ one of the following places: within a NOTICE text file distributed as part of
105
+ the Derivative Works; within the Source form or documentation, if provided
106
+ along with the Derivative Works; or, within a display generated by the
107
+ Derivative Works, if and wherever such third-party notices normally appear.
108
+ The contents of the NOTICE file are for informational purposes only and do
109
+ not modify the License. You may add Your own attribution notices within
110
+ Derivative Works that You distribute, alongside or as an addendum to the
111
+ NOTICE text from the Work, provided that such additional attribution notices
112
+ cannot be construed as modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may provide
115
+ additional or different license terms and conditions for use, reproduction,
116
+ or distribution of Your modifications, or for any such Derivative Works as a
117
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
118
+ complies with the conditions stated in this License.
119
+
120
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
121
+ Contribution intentionally submitted for inclusion in the Work by You to the
122
+ Licensor shall be under the terms and conditions of this License, without any
123
+ additional terms or conditions. Notwithstanding the above, nothing herein
124
+ shall supersede or modify the terms of any separate license agreement you may
125
+ have executed with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade names,
128
+ trademarks, service marks, or product names of the Licensor, except as
129
+ required for reasonable and customary use in describing the origin of the
130
+ Work and reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
133
+ writing, Licensor provides the Work (and each Contributor provides its
134
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
135
+ KIND, either express or implied, including, without limitation, any warranties
136
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
137
+ PARTICULAR PURPOSE. You are solely responsible for determining the
138
+ appropriateness of using or redistributing the Work and assume any risks
139
+ associated with Your exercise of permissions under this License.
140
+
141
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
142
+ tort (including negligence), contract, or otherwise, unless required by
143
+ applicable law (such as deliberate and grossly negligent acts) or agreed to
144
+ in writing, shall any Contributor be liable to You for damages, including any
145
+ direct, indirect, special, incidental, or consequential damages of any
146
+ character arising as a result of this License or out of the use or inability
147
+ to use the Work (including but not limited to damages for loss of goodwill,
148
+ work stoppage, computer failure or malfunction, or any and all other
149
+ commercial damages or losses), even if such Contributor has been advised of
150
+ the possibility of such damages.
151
+
152
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
153
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
154
+ acceptance of support, warranty, indemnity, or other liability obligations
155
+ and/or rights consistent with this License. However, in accepting such
156
+ obligations, You may act only on Your own behalf and on Your sole
157
+ responsibility, not on behalf of any other Contributor, and only if You agree
158
+ to indemnify, defend, and hold each Contributor harmless for any liability
159
+ incurred by, or claims asserted against, such Contributor by reason of your
160
+ accepting any such warranty or additional liability.
161
+
162
+ END OF TERMS AND CONDITIONS
README.md CHANGED
@@ -1,59 +1,352 @@
1
  ---
 
2
  base_model: Qwen/Qwen3.5-4B-Base
3
- library_name: transformers
4
- model_name: obsidian-critic-qwen35-4b-base-lora
 
 
 
 
5
  tags:
6
- - generated_from_trainer
7
- - sft
8
- - trl
 
9
  - unsloth
10
- licence: license
 
 
 
 
 
 
11
  ---
12
 
13
- # Model Card for obsidian-critic-qwen35-4b-base-lora
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- This model is a fine-tuned version of [Qwen/Qwen3.5-4B-Base](https://huggingface.co/Qwen/Qwen3.5-4B-Base).
16
- It has been trained using [TRL](https://github.com/huggingface/trl).
 
 
 
 
 
17
 
18
- ## Quick start
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  ```python
21
- from transformers import pipeline
 
 
 
 
 
22
 
23
- question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
24
- generator = pipeline("text-generation", model="Starred09/obsidian-critic-qwen35-4b-base-lora", device="cuda")
25
- output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
26
- print(output["generated_text"])
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ```
28
 
29
- ## Training procedure
 
 
 
 
 
 
 
 
30
 
31
-
32
 
 
33
 
34
- This model was trained with SFT.
 
 
 
 
35
 
36
- ### Framework versions
37
 
38
- - TRL: 0.24.0
39
- - Transformers: 5.3.0
40
- - Pytorch: 2.10.0+cu128
41
- - Datasets: 4.3.0
42
- - Tokenizers: 0.22.2
43
 
44
- ## Citations
45
 
 
46
 
 
47
 
48
- Cite TRL as:
49
-
50
- ```bibtex
51
- @misc{vonwerra2022trl,
52
- title = {{TRL: Transformer Reinforcement Learning}},
53
- author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
54
- year = 2020,
55
- journal = {GitHub repository},
56
- publisher = {GitHub},
57
- howpublished = {\url{https://github.com/huggingface/trl}}
58
- }
59
- ```
 
1
  ---
2
+ license: apache-2.0
3
  base_model: Qwen/Qwen3.5-4B-Base
4
+ library_name: peft
5
+ pipeline_tag: text-generation
6
+ model_name: Graphite 1.0 4B
7
+ language:
8
+ - en
9
+ - ru
10
  tags:
11
+ - qwen
12
+ - qwen3.5
13
+ - peft
14
+ - lora
15
  - unsloth
16
+ - trl
17
+ - sft
18
+ - code
19
+ - reasoning
20
+ - bilingual
21
+ - obsidian
22
+ - graphite
23
  ---
24
 
25
+ # Graphite 1.0 4B
26
+
27
+ `Graphite 1.0 4B` is the first public LoRA adapter from the Graphite / Obsidian-Critic training stream. It is built on top of [`Qwen/Qwen3.5-4B-Base`](https://huggingface.co/Qwen/Qwen3.5-4B-Base) and tuned for strict, grounded, low-noise responses across:
28
+
29
+ - repo repair and debugging
30
+ - agent tool-use formatting
31
+ - technical writing and Markdown workflows
32
+ - code review and integration tasks
33
+ - logic and factual precision
34
+ - bilingual Russian / English instruction following
35
+
36
+ This repository keeps the legacy slug `obsidian-critic-qwen35-4b-base-lora` because that was the original public upload target, but the public model name for documentation and grant material is **Graphite 1.0 4B**.
37
+
38
+ ## What This Repository Contains
39
+
40
+ This repo contains a **LoRA adapter**, not merged base weights.
41
+
42
+ - Base model: `Qwen/Qwen3.5-4B-Base`
43
+ - Adapter type: `LoRA`
44
+ - Rank: `r=16`
45
+ - Alpha: `16`
46
+ - Dropout: `0.0`
47
+ - Target modules: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj`
48
+
49
+ Files of interest:
50
+
51
+ - `adapter_model.safetensors`: LoRA weights
52
+ - `adapter_config.json`: PEFT adapter config
53
+ - `tokenizer.json`, `tokenizer_config.json`, `chat_template.jinja`: tokenizer assets
54
+ - `run_summary.json`: public training run summary
55
+ - `length_stats.json`: length filtering summary
56
+ - `masking_sanity.json`: formatting sanity check
57
+
58
+ ## Training Lineage
59
+
60
+ This adapter corresponds to the **first public Kaggle 2xT4 full fine-tune stream** before the later `Graphite 1.1` reweight experiment. For provenance purposes:
61
+
62
+ - the original dataset family is **`obsidian-critic-broad-mix-20260321`**
63
+ - the training stack is **Unsloth + TRL + torchrun DDP on dual T4**
64
+ - the public upload target for this run was this repo
65
+ - later `Graphite 1.1` experiments are intentionally excluded from this card
66
+
67
+ Notebook lineage used for this stream:
68
+
69
+ - `obsidian_critic_qwen35_t4x2_unsloth_kaggle.ipynb`: smoke-test notebook for the broad mix
70
+ - `obsidian_critic_qwen35_t4x2_unsloth_kaggle_full.ipynb`: full fine-tune lineage used to produce the public LoRA run
71
+
72
+ ## Dataset Provenance
73
+
74
+ The training data for this first public stream comes from the mixed dataset:
75
+
76
+ - dataset name: `obsidian-critic-broad-mix-20260321`
77
+ - local source dir: `/home/starred/datasets/obsidian-critic-broad-mix-20260321`
78
+ - examples in mixed dataset: `37,008`
79
+ - approximate token volume: `6,885,960`
80
+ - exact duplicate `(user, assistant)` pairs removed during mix build: `3,469`
81
+ - normalized near-duplicates removed from wave backfill rows: `201`
82
+ - dataset SHA-256: `5ba1924b46d08a8ab8ad7ed5e1f74b13cc3e847b3a04b714934953975fd9300a`
83
+
84
+ The public training run then created a deterministic train / validation split and applied sequence-length filtering:
85
 
86
+ - train rows before filter: `36,638`
87
+ - validation rows before filter: `370`
88
+ - train rows after filter: `36,081`
89
+ - validation rows after filter: `363`
90
+ - removed for length filtering: `564`
91
+ - minimum kept sequence length: `48`
92
+ - maximum kept sequence length: `2048`
93
 
94
+ ### Mix Roles
95
+
96
+ | Role | Examples | Approx. tokens |
97
+ | --- | ---: | ---: |
98
+ | `repair` | 5,353 | 983,890 |
99
+ | `tool_use` | 4,682 | 455,600 |
100
+ | `core_real` | 4,200 | 1,043,187 |
101
+ | `robustness` | 3,600 | 397,399 |
102
+ | `agent_core` | 3,200 | 645,426 |
103
+ | `logic` | 3,031 | 297,812 |
104
+ | `factual` | 2,960 | 142,787 |
105
+ | `obsidian_docs` | 2,740 | 490,850 |
106
+ | `reasoning` | 2,200 | 655,624 |
107
+ | `greenfield` | 1,488 | 563,331 |
108
+ | `integration` | 1,473 | 241,331 |
109
+ | `review` | 1,327 | 343,007 |
110
+ | `regularizer` | 500 | 55,840 |
111
+ | `wave_backfill` | 230 | 218,922 |
112
+ | `long_context` | 24 | 350,954 |
113
+
114
+ ### Source Datasets Included In The Broad Mix
115
+
116
+ - **`obsidian_docs`**: `docs-markdown-sft-20260318-v3`, `docs-engineering-review-topup-sft-20260320`, `docs-topup-sft-20260320`, `docs-topup-ru-sft-20260320`
117
+ - **`tool_use`**: `format-tool-discipline-sft-20260319`, `code-agent-tooluse-sft-20260319`, `code-agent-tooluse-ru-topup-sft-20260320`
118
+ - **`greenfield`**: `code-architecture-sft-20260319`, `ts-rust-coding-sft-20260318-v3`
119
+ - **`repair`**: `runtime-debug-grounded-sft-20260319`, `multi-file-repo-repair-sft-20260319`, `code-repair-patch-sft-20260319`, `code-fix-critical-topup-sft-20260321`
120
+ - **`review`**: `security-repair-review-sft-20260319`, `ts-rust-code-review-sft-20260318-v3`
121
+ - **`integration`**: `db-and-migrations-sft-20260319`, `backend-frontend-ops-sft-20260319`
122
+ - **`reasoning`**: `tdd-test-first-sft-20260319`, `multi-step-debug-sft-20260319`
123
+ - **`agent_core`**: `agent-gap-fixes-sft-20260320`, `agent-gap-fixes-ru-topup-sft-20260320`
124
+ - **`robustness`**: `robustness-noise-traps-sft-20260320`, `robustness-noise-traps-ru-topup-sft-20260320`
125
+ - **`core_real`**: `real-world-grounded-topup-sft-20260320`, `real-world-seed-expansion-sft-20260321`
126
+ - **`long_context`**: `long-context-memory-topup-sft-20260321`
127
+ - **`regularizer`**: `anti-overthinking-pack-sft-20260321`
128
+ - **`logic`**: `logic-core-sft-20260319`, `logic-sanity-sft-20260319`, `logic-precision-ru-sft-20260319`
129
+ - **`factual`**: `factual-erudition-sft-20260319`
130
+ - **`wave_backfill`**: `wave-01-growth-sft-20260319`, `wave-02-growth-sft-20260319`, `wave-03-growth-sft-20260320`
131
+
132
+ Explicitly excluded from the mix build:
133
+
134
+ - `anti-regression-eval-20260319`
135
+ - `curated-code-train-mix-20260320`
136
+ - `graphite-1.0-code-train-mix-20260321`
137
+ - `css-ui-premium-sft-20260319`
138
+ - `css-style-premium-sft-20260320`
139
+ - `css-style-premium-ru-topup-sft-20260320`
140
+ - `css-style-sft-20260318`
141
+
142
+ ## Representative Training Examples
143
+
144
+ These are short excerpts from the actual broad-mix and component datasets used in the first public stream.
145
+
146
+ ### Broad mix: grounded repo repair
147
+
148
+ **System**
149
+ ```text
150
+ Ground the answer in one active boundary, not in general advice.
151
+ ```
152
+
153
+ **User**
154
+ ```text
155
+ First fix failed. Repo: packages/notes-index
156
+ Patch 1 removed one fallback in `app/config.py`.
157
+ New evidence: `docker compose: service worker exited with code 1`.
158
+ Need the second minimal fix.
159
+ ```
160
+
161
+ **Assistant**
162
+ ```text
163
+ The first patch hit the wrong seam. The new signal points back to `app/config.py`.
164
+ ```
165
+
166
+ ### Broad mix: Russian ambiguity tightening
167
+
168
+ **System**
169
+ ```text
170
+ Пиши как строгий русскоязычный логический редактор: коротко, ясно, без филологии ради филологии.
171
+ ```
172
+
173
+ **User**
174
+ ```text
175
+ Оцени формулировку из инструкции:
176
+ `Разрешён доступ аналитики и владельцы без резервной копией.`
177
+ ```
178
+
179
+ **Assistant**
180
+ ```text
181
+ Да. Неясно, относится `без резервной копией` к обеим группам или только ко второй.
182
+ Строже: `И аналитики, и владельцы получают доступ без резервной копией.`
183
+ ```
184
+
185
+ ### Tool-use source: strict JSON action selection
186
+
187
+ **System**
188
+ ```text
189
+ Ты code-workspace агент. Возвращай только валидный JSON.
190
+ ```
191
+
192
+ **User**
193
+ ```text
194
+ Исправь этот сломанный tool call и верни только валидный JSON.
195
+ {"tool":"search_codebase","args":{"query":"normalize_note_path","path":"src","limit":"4"}}
196
+ ```
197
+
198
+ **Assistant**
199
+ ```json
200
+ {"tool":"search_codebase","arguments":{"query":"normalize_note_path","path":"src"}}
201
+ ```
202
+
203
+ ### Docs source: structured README generation
204
+
205
+ **System**
206
+ ```text
207
+ Ты technical writer для engineering workflows. Только полезная структура.
208
+ ```
209
+
210
+ **User**
211
+ ```text
212
+ Напиши полноценный README.md для `md-audit`.
213
+ Контекст: scan Markdown repositories for broken links, empty headings, duplicate slugs, and metadata regressions.
214
+ ```
215
+
216
+ ### Logic source: contradiction checking
217
+
218
+ **System**
219
+ ```text
220
+ Будь аккуратен с условиями и кванторами. Предпочитай точность эффектности.
221
+ ```
222
+
223
+ **User**
224
+ ```text
225
+ Проверь набор на непротиворечивость.
226
+ 1. `Борис` гость -> не может публиковать.
227
+ 2. `Борис` гость.
228
+ 3. `Борис` может публиковать.
229
+ ```
230
+
231
+ **Assistant**
232
+ ```text
233
+ Нет. Противоречие между выводом из 1+2 и пунктом 3.
234
+ ```
235
+
236
+ ## Training Recipe
237
+
238
+ The public run in this repo used:
239
+
240
+ - hardware: **Kaggle dual T4**
241
+ - distributed setup: **`torchrun` DDP**
242
+ - training framework: **Unsloth + TRL**
243
+ - base model loading: **4-bit**
244
+ - LoRA rank: **16**
245
+ - LoRA alpha: **16**
246
+ - LoRA dropout: **0.0**
247
+ - max sequence length: **2048**
248
+ - per-device train batch size: **1**
249
+ - gradient accumulation steps: **8**
250
+ - effective global batch size: **16** examples / optimization step
251
+ - epochs: **1**
252
+ - optimizer: **`adamw_8bit`**
253
+ - scheduler: **cosine**
254
+ - learning rate: **1e-4**
255
+ - warmup steps: **5**
256
+ - gradient checkpointing: **enabled**
257
+ - FP16: **forced**
258
+ - packing: **disabled**
259
+ - completion-only loss: **disabled**
260
+ - public run total steps: **2256**
261
+ - logging / eval / save cadence: **50 / 125 / 250**
262
+
263
+ Best public checkpoint recorded in `trainer_state.json`:
264
+
265
+ - best checkpoint: `checkpoint-2250`
266
+ - best metric: `0.18876151740550995`
267
+
268
+ ## Prompt Style
269
+
270
+ This adapter was trained on a simple, explicit prompt layout:
271
+
272
+ ```text
273
+ System:
274
+ <system prompt>
275
+
276
+ User:
277
+ <user prompt>
278
+
279
+ Assistant:
280
+ ```
281
+
282
+ For best results, keep prompts concise, grounded, and task-shaped. The adapter responds best to:
283
+
284
+ - repo repair tasks with concrete evidence
285
+ - exact wording / logic cleanup tasks
286
+ - tool-call selection with explicit schemas
287
+ - technical writing with clear requested sections
288
+ - review / integration prompts that specify files, symptoms, and expected outcomes
289
+
290
+ ## Quick Start
291
 
292
  ```python
293
+ import torch
294
+ from peft import PeftModel
295
+ from transformers import AutoModelForCausalLM, AutoTokenizer
296
+
297
+ base_id = "Qwen/Qwen3.5-4B-Base"
298
+ adapter_id = "Starred09/obsidian-critic-qwen35-4b-base-lora"
299
 
300
+ tokenizer = AutoTokenizer.from_pretrained(adapter_id)
301
+ base_model = AutoModelForCausalLM.from_pretrained(
302
+ base_id,
303
+ torch_dtype="auto",
304
+ device_map="auto",
305
+ )
306
+ model = PeftModel.from_pretrained(base_model, adapter_id)
307
+
308
+ system = "Return the smallest useful answer. Do not invent missing evidence."
309
+ user = "Repo: apps/desktop-shell. Build fails with ENOENT on dist/server.js. Point to the first file to inspect."
310
+ prompt = f"System:\\n{system}\\n\\nUser:\\n{user}\\n\\nAssistant:\\n"
311
+
312
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
313
+ with torch.no_grad():
314
+ out = model.generate(**inputs, max_new_tokens=160)
315
+
316
+ print(tokenizer.decode(out[0], skip_special_tokens=True))
317
  ```
318
 
319
+ ## Intended Use
320
+
321
+ Graphite 1.0 4B is intended for:
322
+
323
+ - local and server-side coding assistants
324
+ - repo triage and patch-planning copilots
325
+ - Markdown / docs tooling assistants
326
+ - logic and wording critique
327
+ - bilingual technical task routing
328
 
329
+ It is especially useful when you want **short, grounded, non-theatrical outputs** instead of generic assistant prose.
330
 
331
+ ## Limitations
332
 
333
+ - This is an **adapter**, not a standalone merged model.
334
+ - It is tuned for **structured technical work**, not general consumer chat.
335
+ - It inherits both strengths and weaknesses from `Qwen/Qwen3.5-4B-Base`.
336
+ - The broad mix is intentionally heavy on repair, tool-use, and reasoning, so purely creative behavior is not a target.
337
+ - This card documents the **first public stream only**. Later `Graphite 1.1` experiments are intentionally excluded.
338
 
339
+ ## License
340
 
341
+ This repository is released under **Apache License 2.0**. See [`LICENSE`](./LICENSE).
 
 
 
 
342
 
343
+ Please also review the license and usage terms of the base model:
344
 
345
+ - [`Qwen/Qwen3.5-4B-Base`](https://huggingface.co/Qwen/Qwen3.5-4B-Base)
346
 
347
+ ## Acknowledgements
348
 
349
+ - Alibaba Qwen team for the base model
350
+ - Unsloth for the efficient LoRA training stack
351
+ - TRL / Transformers / PEFT / PyTorch maintainers
352
+ - Kaggle dual-T4 environment used for the public training run