dereklck commited on
Commit
5e0cd9d
·
verified ·
1 Parent(s): 528891d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -117
README.md CHANGED
@@ -21,7 +21,13 @@ language:
21
  - **Model type:** GGUF (compatible with Ollama)
22
  - **Language:** English
23
 
24
- This Llama-based model was fine-tuned to generate `kubectl` commands based on user descriptions. It was trained efficiently using [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face's TRL library.
 
 
 
 
 
 
25
 
26
  ---
27
 
@@ -31,9 +37,9 @@ This Llama-based model was fine-tuned to generate `kubectl` commands based on us
31
 
32
  The model assists users by:
33
 
34
- - **Generating accurate `kubectl` commands** based on natural language descriptions.
35
  - **Providing brief explanations about Kubernetes** for general queries.
36
- - **Requesting additional information** if the instruction is incomplete or ambiguous.
37
 
38
  ### Intended Users
39
 
@@ -44,67 +50,28 @@ The model assists users by:
44
  ### Training Process
45
 
46
  - **Base Model:** Unsloth's Llama-3.2-1B-Instruct-bnb-4bit
47
- - **Fine-tuning:** Leveraged the Unsloth framework and Hugging Face's TRL library for efficient training.
48
  - **Training Data:** Customized dataset focused on Kubernetes operations and `kubectl` command usage, containing approximately 200 entries.
49
 
50
- ### Features
51
-
52
- - **Command Generation:** Translates user instructions into executable `kubectl` commands.
53
- - **Clarification Requests:** Politely asks for more details when the instruction is incomplete.
54
- - **Knowledge Base:** Provides concise explanations for general Kubernetes concepts.
55
-
56
  ---
57
 
58
- ## Usage
59
-
60
- ### Prompt Template
61
-
62
- The model uses the following prompt template to generate responses:
63
-
64
- ```plaintext
65
- You are an AI assistant that helps users with Kubernetes commands and questions.
66
-
67
- **Your Behavior Guidelines:**
68
 
69
- 1. **For clear and complete instructions:**
70
- - **Provide only** the exact `kubectl` command needed to fulfill the user's request.
71
- - Do not include extra explanations, placeholders, or context.
72
- - **Enclose the command within a code block** with `bash` syntax highlighting.
73
 
74
- 2. **For incomplete or ambiguous instructions:**
75
- - **Politely ask** the user for the specific missing information.
76
- - Do **not** provide any commands or placeholders in your response.
77
- - Respond in plain text, clearly stating what information is needed.
78
 
79
- 3. **For general Kubernetes questions:**
80
- - Provide a **concise and accurate explanation**.
81
- - Do **not** include any commands unless specifically requested.
82
- - Ensure that the explanation fully addresses the user's question.
83
 
84
- **Important Rules:**
85
 
86
- - Do **not** generate commands with placeholders like `<pod_name>` or `<resource_name>`.
87
- - Always ensure that commands provided are **valid and executable** as-is.
88
- - If unsure or the instruction is unclear, **ask for clarification** without including any commands.
89
- - Do **not** output any additional text beyond what's necessary.
90
 
91
- **Formatting:**
92
-
93
- - **Commands**: Use code blocks with `bash` syntax:
94
- ```bash
95
- kubectl <command>
96
- ```
97
-
98
- - **Clarifications and Explanations**: Respond in plain text, politely and clearly.
99
 
100
  ---
101
 
102
- ### Instruction:
103
- {instruction}
104
-
105
- ### Response:
106
- {response}
107
- ```
108
 
109
  ### Parameters
110
 
@@ -113,9 +80,9 @@ You are an AI assistant that helps users with Kubernetes commands and questions.
113
 
114
  ---
115
 
116
- ### Examples
117
 
118
- #### Example 1: Generating a Command
119
 
120
  **Instruction:**
121
 
@@ -131,7 +98,7 @@ kubectl create namespace development
131
 
132
  ---
133
 
134
- #### Example 2: Handling Ambiguity
135
 
136
  **Instruction:**
137
 
@@ -147,7 +114,7 @@ Which pod's logs would you like to retrieve?
147
 
148
  ---
149
 
150
- #### Example 3: Providing Explanations
151
 
152
  **Instruction:**
153
 
@@ -163,6 +130,25 @@ A Deployment provides declarative updates for Pods and ReplicaSets, allowing you
163
 
164
  ---
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  ## Deployment with Ollama
167
 
168
  ### Prerequisites
@@ -179,43 +165,8 @@ A Deployment provides declarative updates for Pods and ReplicaSets, allowing you
179
  ```plaintext
180
  FROM kubectl_operator.Q8_0.gguf
181
 
182
- SYSTEM "You are an AI assistant that helps users with Kubernetes commands and questions.
183
-
184
- **Your Behavior Guidelines:**
185
-
186
- 1. **For clear and complete instructions:**
187
- - **Provide only** the exact `kubectl` command needed to fulfill the user's request.
188
- - Do not include extra explanations, placeholders, or context.
189
- - **Enclose the command within a code block** with `bash` syntax highlighting.
190
-
191
- 2. **For incomplete or ambiguous instructions:**
192
- - **Politely ask** the user for the specific missing information.
193
- - Do **not** provide any commands or placeholders in your response.
194
- - Respond in plain text, clearly stating what information is needed.
195
-
196
- 3. **For general Kubernetes questions:**
197
- - Provide a **concise and accurate explanation**.
198
- - Do **not** include any commands unless specifically requested.
199
- - Ensure that the explanation fully addresses the user's question.
200
-
201
- **Important Rules:**
202
-
203
- - Do **not** generate commands with placeholders like `<pod_name>` or `<resource_name>`.
204
- - Always ensure that commands provided are **valid and executable** as-is.
205
- - If unsure or the instruction is unclear, **ask for clarification** without including any commands.
206
- - Do **not** output any additional text beyond what's necessary.
207
-
208
- **Formatting:**
209
-
210
- - **Commands**: Use code blocks with `bash` syntax:
211
- ```bash
212
- kubectl <command>
213
- ```
214
-
215
- - **Clarifications and Explanations**: Respond in plain text, politely and clearly."
216
-
217
- PARAMETER --temperature 0.3
218
- PARAMETER --stop "\n</s>"
219
 
220
  TEMPLATE """
221
  You are an AI assistant that helps users with Kubernetes commands and questions.
@@ -239,28 +190,16 @@ A Deployment provides declarative updates for Pods and ReplicaSets, allowing you
239
 
240
  **Important Rules:**
241
 
242
- - Do **not** generate commands with placeholders like `<pod_name>` or `<resource_name>`.
243
- - Always ensure that commands provided are **valid and executable** as-is.
244
- - If unsure or the instruction is unclear, **ask for clarification** without including any commands.
245
- - Do **not** output any additional text beyond what's necessary.
246
-
247
- **Formatting:**
248
-
249
- - **Commands**: Use code blocks with `bash` syntax:
250
- ```bash
251
- kubectl <command>
252
- ```
253
-
254
- - **Clarifications and Explanations**: Respond in plain text, politely and clearly.
255
-
256
- ---
257
 
258
  ### Instruction:
259
  {{ .Prompt }}
260
 
261
  ### Response:
262
  """
263
-
264
  ```
265
 
266
  2. **Create the Model with Ollama**
@@ -285,14 +224,6 @@ A Deployment provides declarative updates for Pods and ReplicaSets, allowing you
285
 
286
  ---
287
 
288
- ## Limitations and Considerations
289
-
290
- - **Accuracy:** The model may occasionally produce incorrect or suboptimal commands. Always review the output before execution.
291
- - **Hallucinations:** In rare cases, the model might generate irrelevant or incorrect information. If the response seems off-topic, consider rephrasing your instruction.
292
- - **Security:** Be cautious when executing generated commands, especially in production environments.
293
-
294
- ---
295
-
296
  ## Feedback and Contributions
297
 
298
  We welcome any comments or participation to improve the model and dataset. If you encounter issues or have suggestions for improvement:
@@ -300,4 +231,8 @@ We welcome any comments or participation to improve the model and dataset. If yo
300
  - **GitHub:** [Unsloth Repository](https://github.com/unslothai/unsloth)
301
  - **Contact:** Reach out to the developer, **dereklck**, for further assistance.
302
 
303
- ---
 
 
 
 
 
21
  - **Model type:** GGUF (compatible with Ollama)
22
  - **Language:** English
23
 
24
+ This Llama-based model was fine-tuned to assist users with Kubernetes commands and questions. It has three primary features:
25
+
26
+ 1. **Generating accurate `kubectl` commands** based on user descriptions.
27
+ 2. **Providing brief explanations about Kubernetes** for general queries.
28
+ 3. **Politely requesting additional information** if the instruction is incomplete or ambiguous.
29
+
30
+ **Important Note:** The **1B model may sometimes generate non-executable CLI commands containing placeholders** like `<pod_name>` or `<resource_name>`. This can lead to hallucinations and commands that cannot be executed directly. Users are advised to replace these placeholders with actual values before execution. This issue has been significantly **improved in the 3B model**, which generates more accurate and executable commands without unnecessary placeholders.
31
 
32
  ---
33
 
 
37
 
38
  The model assists users by:
39
 
40
+ - **Generating `kubectl` commands** based on natural language descriptions.
41
  - **Providing brief explanations about Kubernetes** for general queries.
42
+ - **Politely requesting additional information** if the instruction is incomplete or ambiguous.
43
 
44
  ### Intended Users
45
 
 
50
  ### Training Process
51
 
52
  - **Base Model:** Unsloth's Llama-3.2-1B-Instruct-bnb-4bit
53
+ - **Fine-tuning:** Utilized the Unsloth framework and Hugging Face's TRL library for efficient training.
54
  - **Training Data:** Customized dataset focused on Kubernetes operations and `kubectl` command usage, containing approximately 200 entries.
55
 
 
 
 
 
 
 
56
  ---
57
 
58
+ ## Model Features
 
 
 
 
 
 
 
 
 
59
 
60
+ ### 1. Command Generation in Bash Format
 
 
 
61
 
62
+ When the model generates CLI commands, it provides them in `bash` format, enclosed within code blocks for easy execution and clarity. This allows users to copy and paste the commands directly into their terminal.
 
 
 
63
 
64
+ ### 2. Handling Ambiguity with Polite Clarifications
 
 
 
65
 
66
+ If the instruction is incomplete or ambiguous, the model politely asks for the specific missing information instead of making assumptions. This ensures accuracy and prevents the execution of incorrect commands.
67
 
68
+ ### 3. Providing Concise Explanations
 
 
 
69
 
70
+ For general Kubernetes questions, the model offers concise and accurate explanations without unnecessary details, helping users understand concepts quickly.
 
 
 
 
 
 
 
71
 
72
  ---
73
 
74
+ ## Usage
 
 
 
 
 
75
 
76
  ### Parameters
77
 
 
80
 
81
  ---
82
 
83
+ ## Examples
84
 
85
+ ### Example 1: Generating a Command
86
 
87
  **Instruction:**
88
 
 
98
 
99
  ---
100
 
101
+ ### Example 2: Handling Ambiguity
102
 
103
  **Instruction:**
104
 
 
114
 
115
  ---
116
 
117
+ ### Example 3: Providing Explanations
118
 
119
  **Instruction:**
120
 
 
130
 
131
  ---
132
 
133
+ ## Limitations and Considerations
134
+
135
+ - **Accuracy:** The model may occasionally produce incorrect or suboptimal commands. Always review the output before execution.
136
+ - **Hallucinations:** The **1B model may generate CLI commands with placeholders** (e.g., `<pod_name>`, `<resource_name>`), resulting in commands that are **not directly executable**. Users should carefully replace these placeholders with actual values.
137
+
138
+ - **Improvement in 3B Model:** This issue has been addressed in the **3B model**, where the generation of non-executable commands with placeholders has been significantly reduced, providing more accurate and usable outputs.
139
+
140
+ - **Security:** Be cautious when executing generated commands, especially in production environments.
141
+
142
+ ---
143
+
144
+ ## Future Revisions
145
+
146
+ - **Addressing Hallucinations:** Efforts are underway to further reduce hallucinations in future versions, building upon improvements made in the 3B model.
147
+ - **Enhanced Dataset:** Expanding the training dataset to include a wider range of Kubernetes operations to improve the model's versatility.
148
+ - **Fine-tuning Techniques:** Implementing advanced fine-tuning methods to enhance accuracy and reliability.
149
+
150
+ ---
151
+
152
  ## Deployment with Ollama
153
 
154
  ### Prerequisites
 
165
  ```plaintext
166
  FROM kubectl_operator.Q8_0.gguf
167
 
168
+ PARAMETER temperature 0.3
169
+ PARAMETER stop "</s>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  TEMPLATE """
172
  You are an AI assistant that helps users with Kubernetes commands and questions.
 
190
 
191
  **Important Rules:**
192
 
193
+ - **Do not generate CLI commands containing placeholders** (e.g., `<pod_name>`, `<resource_name>`).
194
+ - Ensure all CLI commands are **complete, valid, and executable** as provided.
195
+ - If user input is insufficient to form a complete command, **ask for clarification** instead of using placeholders.
196
+ - Provide only the necessary CLI command output without any additional text.
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  ### Instruction:
199
  {{ .Prompt }}
200
 
201
  ### Response:
202
  """
 
203
  ```
204
 
205
  2. **Create the Model with Ollama**
 
224
 
225
  ---
226
 
 
 
 
 
 
 
 
 
227
  ## Feedback and Contributions
228
 
229
  We welcome any comments or participation to improve the model and dataset. If you encounter issues or have suggestions for improvement:
 
231
  - **GitHub:** [Unsloth Repository](https://github.com/unslothai/unsloth)
232
  - **Contact:** Reach out to the developer, **dereklck**, for further assistance.
233
 
234
+ ---
235
+
236
+ **Note:** This model assists in generating `kubectl` commands based on user input. Always verify the generated commands and replace any placeholders with actual values before executing them in a production cluster.
237
+
238
+ ---