PEFT
Safetensors
English
lora
router-agent
vertex-ai
Alovestocode commited on
Commit
ace24c6
·
verified ·
1 Parent(s): ea7d6f8

Update model card

Browse files
Files changed (1) hide show
  1. README.md +82 -198
README.md CHANGED
@@ -1,208 +1,92 @@
1
  ---
2
  base_model: google/gemma-3-27b-it
 
 
3
  library_name: peft
4
- pipeline_tag: text-generation
5
  tags:
6
- - axolotl
7
- - base_model:adapter:/tmp/base_model_dir/vertex-model-garden-restricted-us/gemma3/gemma-3-27b-it
8
  - lora
9
- - transformers
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
- # Model Card for Model ID
13
-
14
- <!-- Provide a quick summary of what the model is/does. -->
15
-
16
 
 
17
 
18
  ## Model Details
19
-
20
- ### Model Description
21
-
22
- <!-- Provide a longer summary of what this model is. -->
23
-
24
-
25
-
26
- - **Developed by:** [More Information Needed]
27
- - **Funded by [optional]:** [More Information Needed]
28
- - **Shared by [optional]:** [More Information Needed]
29
- - **Model type:** [More Information Needed]
30
- - **Language(s) (NLP):** [More Information Needed]
31
- - **License:** [More Information Needed]
32
- - **Finetuned from model [optional]:** [More Information Needed]
33
-
34
- ### Model Sources [optional]
35
-
36
- <!-- Provide the basic links for the model. -->
37
-
38
- - **Repository:** [More Information Needed]
39
- - **Paper [optional]:** [More Information Needed]
40
- - **Demo [optional]:** [More Information Needed]
41
-
42
- ## Uses
43
-
44
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
45
-
46
- ### Direct Use
47
-
48
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
49
-
50
- [More Information Needed]
51
-
52
- ### Downstream Use [optional]
53
-
54
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
55
-
56
- [More Information Needed]
57
-
58
- ### Out-of-Scope Use
59
-
60
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
61
-
62
- [More Information Needed]
63
-
64
- ## Bias, Risks, and Limitations
65
-
66
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
67
-
68
- [More Information Needed]
69
-
70
- ### Recommendations
71
-
72
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
73
-
74
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
75
-
76
- ## How to Get Started with the Model
77
-
78
- Use the code below to get started with the model.
79
-
80
- [More Information Needed]
81
-
82
- ## Training Details
83
-
84
- ### Training Data
85
-
86
- <!-- 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. -->
87
-
88
- [More Information Needed]
89
-
90
- ### Training Procedure
91
-
92
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
93
-
94
- #### Preprocessing [optional]
95
-
96
- [More Information Needed]
97
-
98
-
99
- #### Training Hyperparameters
100
-
101
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
102
-
103
- #### Speeds, Sizes, Times [optional]
104
-
105
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
106
-
107
- [More Information Needed]
108
-
109
- ## Evaluation
110
-
111
- <!-- This section describes the evaluation protocols and provides the results. -->
112
-
113
- ### Testing Data, Factors & Metrics
114
-
115
- #### Testing Data
116
-
117
- <!-- This should link to a Dataset Card if possible. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Factors
122
-
123
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
124
-
125
- [More Information Needed]
126
-
127
- #### Metrics
128
-
129
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
130
-
131
- [More Information Needed]
132
-
133
- ### Results
134
-
135
- [More Information Needed]
136
-
137
- #### Summary
138
-
139
-
140
-
141
- ## Model Examination [optional]
142
-
143
- <!-- Relevant interpretability work for the model goes here -->
144
-
145
- [More Information Needed]
146
-
147
- ## Environmental Impact
148
-
149
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
150
-
151
- 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).
152
-
153
- - **Hardware Type:** [More Information Needed]
154
- - **Hours used:** [More Information Needed]
155
- - **Cloud Provider:** [More Information Needed]
156
- - **Compute Region:** [More Information Needed]
157
- - **Carbon Emitted:** [More Information Needed]
158
-
159
- ## Technical Specifications [optional]
160
-
161
- ### Model Architecture and Objective
162
-
163
- [More Information Needed]
164
-
165
- ### Compute Infrastructure
166
-
167
- [More Information Needed]
168
-
169
- #### Hardware
170
-
171
- [More Information Needed]
172
-
173
- #### Software
174
-
175
- [More Information Needed]
176
-
177
- ## Citation [optional]
178
-
179
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
180
-
181
- **BibTeX:**
182
-
183
- [More Information Needed]
184
-
185
- **APA:**
186
-
187
- [More Information Needed]
188
-
189
- ## Glossary [optional]
190
-
191
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
192
-
193
- [More Information Needed]
194
-
195
- ## More Information [optional]
196
-
197
- [More Information Needed]
198
-
199
- ## Model Card Authors [optional]
200
-
201
- [More Information Needed]
202
-
203
- ## Model Card Contact
204
-
205
- [More Information Needed]
206
- ### Framework versions
207
-
208
- - PEFT 0.17.1
 
1
  ---
2
  base_model: google/gemma-3-27b-it
3
+ language:
4
+ - en
5
  library_name: peft
6
+ license: gemma
7
  tags:
 
 
8
  - lora
9
+ - peft
10
+ - router-agent
11
+ - vertex-ai
12
+ datasets:
13
+ - CourseGPT-Pro-DSAI-Lab-Group-6/router-dataset
14
+ metrics:
15
+ - name: eval_loss
16
+ type: loss
17
+ value: 0.6080
18
+ - name: eval_perplexity
19
+ type: perplexity
20
+ value: 1.8368
21
  ---
22
 
23
+ # Router Gemma 3 27B PEFT Adapter
 
 
 
24
 
25
+ This repository hosts the LoRA adapter for **google/gemma-3-27b-it**, tuned as a tool-routing brain with strong reasoning headroom. The model reads user queries, decides which agents (e.g., `/math`, `/code`, `/general-search`) should run, and emits strict JSON aligned with our Milestone 2 router schema.
26
 
27
  ## Model Details
28
+ - **Base model:** [google/gemma-3-27b-it](https://huggingface.co/google/gemma-3-27b-it)
29
+ - **Adapter type:** QLoRA rank 16 on attention + MLP projections (Vertex AI managed tuning)
30
+ - **Training:** 3 epochs, micro-batch size 2, cosine LR with warmup, gradient checkpointing enabled
31
+ - **Hardware:** NVIDIA H100/A3 (Vertex managed OSS tuning)
32
+ - **Context length:** 128K tokens
33
+ - **Validation metrics:** loss ≈ 0.6080, perplexity ≈ 1.84, eval runtime ≈ 15.4 s
34
+
35
+ Gemma’s larger capacity gives higher-quality routing decisions, especially for multi-step orchestration across math/code/search specialists.
36
+
37
+ ## Intended Use
38
+ Use this adapter when you need premium routing quality and can afford deploying on higher-memory GPUs (L4 with quantization or A100/H100 in full precision). It is well-suited for research copilots, analytics assistants, and multilingual routing scenarios.
39
+
40
+ ### Out-of-scope
41
+ - Direct Q/A without tool execution
42
+ - High-risk/sensitive domains without additional alignment checks
43
+
44
+ ## Quick Start
45
+ ```python
46
+ from peft import PeftModel
47
+ from transformers import AutoTokenizer, AutoModelForCausalLM
48
+
49
+ base = "google/gemma-3-27b-it"
50
+ adapter = "CourseGPT-Pro-DSAI-Lab-Group-6/router-gemma3-peft"
51
+
52
+ tokenizer = AutoTokenizer.from_pretrained(base, trust_remote_code=True)
53
+ model = AutoModelForCausalLM.from_pretrained(
54
+ base,
55
+ device_map="auto",
56
+ torch_dtype="auto",
57
+ trust_remote_code=True,
58
+ )
59
+ model = PeftModel.from_pretrained(model, adapter)
60
+
61
+ prompt = (
62
+ "System: Emit strict JSON with route_plan, route_rationale, thinking_outline, and handoff_plan.\n"
63
+ "User: Draft a pipeline combining symbolic integration, Python experimentation, and literature review."
64
+ )
65
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
66
+ output = model.generate(**inputs, max_new_tokens=1200)
67
+ print(tokenizer.decode(output[0], skip_special_tokens=True))
68
+ ```
69
+
70
+ ## Training Data
71
+ - CourseGPT router dataset (Milestone 2), converted to Vertex supervised JSONL (prompt/completion pairs)
72
+ - Structured completions include route plan arrays, rationale, acceptance criteria, metrics, and more
73
+
74
+ ## Evaluation Summary
75
+ - Held-out validation subset (≈10%)
76
+ - Metrics: loss ≈ 0.6080, perplexity ≈ 1.84
77
+ - Qualitative review shows consistent JSON structure and accurate tool choices on complex problems
78
+
79
+ ## Deployment Tips
80
+ - Quantize adapters for L4 deployment (bitsandbytes 4-bit)
81
+ - Validate JSON outputs and retry when necessary
82
+ - Extend the prompt with custom tool definitions if your stack differs from `/math`, `/code`, `/general-search`
83
+
84
+ ## Citation
85
+ ```
86
+ @software{CourseGPTRouterGemma3,
87
+ title = {Router Gemma 3 27B PEFT Adapter},
88
+ author = {CourseGPT Pro DSAI Lab Group 6},
89
+ year = {2025},
90
+ url = {https://huggingface.co/CourseGPT-Pro-DSAI-Lab-Group-6/router-gemma3-peft}
91
+ }
92
+ ```