Update README.md
Browse files
README.md
CHANGED
@@ -1,22 +1,262 @@
|
|
1 |
---
|
2 |
-
base_model: unsloth/
|
3 |
tags:
|
4 |
- text-generation-inference
|
5 |
- transformers
|
6 |
- unsloth
|
7 |
- llama
|
8 |
-
-
|
9 |
-
|
|
|
10 |
language:
|
11 |
- en
|
|
|
12 |
---
|
13 |
|
14 |
-
#
|
15 |
|
16 |
- **Developed by:** dereklck
|
17 |
-
- **License:**
|
18 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
-
|
21 |
|
22 |
-
|
|
|
1 |
---
|
2 |
+
base_model: unsloth/DeepSeek-R1-Distill-Llama-8B
|
3 |
tags:
|
4 |
- text-generation-inference
|
5 |
- transformers
|
6 |
- unsloth
|
7 |
- llama
|
8 |
+
- gguf
|
9 |
+
- ollama
|
10 |
+
license: apache-2.0
|
11 |
language:
|
12 |
- en
|
13 |
+
|
14 |
---
|
15 |
|
16 |
+
# Kubernetes Assistant Model (8B)
|
17 |
|
18 |
- **Developed by:** dereklck
|
19 |
+
- **License:** Apache-2.0
|
20 |
+
- **Fine-tuned from model:** [unsloth/DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/unsloth/DeepSeek-R1-Distill-Llama-8B)
|
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 instructions.
|
27 |
+
2. **Providing concise explanations about Kubernetes** for general queries.
|
28 |
+
3. **Politely requesting additional information** if the instruction is incomplete or ambiguous.
|
29 |
+
|
30 |
+
**Update:** The **8B model** provides improved accuracy and reliability compared to previous versions, including better adherence to guidelines and reduced hallucinations. Users can expect more precise responses when interacting with this model.
|
31 |
+
|
32 |
+
The model was trained efficiently using [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face's TRL library.
|
33 |
+
|
34 |
+
---
|
35 |
+
|
36 |
+
## How to Use the Model
|
37 |
+
|
38 |
+
This section provides instructions on how to run the model using Ollama and the provided Modelfile.
|
39 |
+
|
40 |
+
### Prerequisites
|
41 |
+
|
42 |
+
- Install [Ollama](https://github.com/jmorganca/ollama) on your system.
|
43 |
+
- Ensure you have access to the model hosted on Hugging Face: `hf.co/dereklck/kubernetes_operator_8b_deepseek_peft_gguf`.
|
44 |
+
|
45 |
+
### Steps
|
46 |
+
|
47 |
+
1. **Create the Modelfile**
|
48 |
+
|
49 |
+
Save the following content as a file named `Modelfile`:
|
50 |
+
|
51 |
+
```plaintext
|
52 |
+
FROM hf.co/dereklck/kubernetes_operator_8b_deepseek_peft_gguf
|
53 |
+
|
54 |
+
PARAMETER temperature 0.3
|
55 |
+
PARAMETER stop "</s>"
|
56 |
+
|
57 |
+
TEMPLATE """
|
58 |
+
You are an AI assistant that helps users with Kubernetes commands and questions.
|
59 |
+
|
60 |
+
**IMPORTANT: Strictly follow the guidelines below. Do not deviate under any circumstances.**
|
61 |
+
|
62 |
+
---
|
63 |
+
|
64 |
+
### **Your Behavior Guidelines:**
|
65 |
+
|
66 |
+
#### **1. For clear and complete instructions:**
|
67 |
+
|
68 |
+
- **Provide ONLY** the exact `kubectl` command needed to fulfill the user's request.
|
69 |
+
- **DO NOT** include extra explanations, placeholders (like `<pod_name>`, `my-pod`), example values, or context.
|
70 |
+
- **Enclose the command within a code block** using `bash` syntax highlighting.
|
71 |
+
|
72 |
+
#### **2. For incomplete or ambiguous instructions:**
|
73 |
+
|
74 |
+
- **Politely ask** the user for the specific missing information **in one sentence**.
|
75 |
+
- **DO NOT** provide any commands, examples, or placeholders in your response.
|
76 |
+
- **Respond in plain text**, clearly stating what information is needed.
|
77 |
+
- **DO NOT** include any additional information or text beyond the question.
|
78 |
+
|
79 |
+
#### **3. For general Kubernetes questions:**
|
80 |
+
|
81 |
+
- **Provide a concise and accurate explanation**.
|
82 |
+
- **DO NOT** include any commands unless specifically requested.
|
83 |
+
- **Ensure that the explanation fully addresses the user's question without irrelevant information.
|
84 |
+
|
85 |
+
---
|
86 |
+
|
87 |
+
### **IMPORTANT RULES (READ CAREFULLY):**
|
88 |
+
|
89 |
+
- **DO NOT generate CLI commands containing placeholders or example values** (e.g., `<pod_name>`, `my-pod`, `your-pod`).
|
90 |
+
- **DO NOT invent resource names or use generic names**. If the resource name is not provided, ask for it.
|
91 |
+
- **Always ensure CLI commands are complete, valid, and executable AS IS**.
|
92 |
+
- **If user input is insufficient to form a complete command, ASK FOR CLARIFICATION** instead of using placeholders or examples.
|
93 |
+
- **DO NOT output any additional text beyond what's necessary**.
|
94 |
+
|
95 |
+
---
|
96 |
+
|
97 |
+
### Instruction:
|
98 |
+
{{ .Prompt }}
|
99 |
+
|
100 |
+
### Response:
|
101 |
+
"""
|
102 |
+
|
103 |
+
```
|
104 |
+
|
105 |
+
2. **Create the Model with Ollama**
|
106 |
+
|
107 |
+
Open your terminal and run the following command to create the model:
|
108 |
+
|
109 |
+
```bash
|
110 |
+
ollama create kubernetes_assistant_8b -f Modelfile
|
111 |
+
```
|
112 |
+
|
113 |
+
This command tells Ollama to create a new model named `kubernetes_assistant_8b` using the configuration specified in `Modelfile`.
|
114 |
+
|
115 |
+
3. **Run the Model**
|
116 |
+
|
117 |
+
Start interacting with your model:
|
118 |
+
|
119 |
+
```bash
|
120 |
+
ollama run kubernetes_assistant_8b
|
121 |
+
```
|
122 |
+
|
123 |
+
This will initiate the model and prompt you for input based on the template provided.
|
124 |
+
|
125 |
+
Alternatively, you can provide an instruction directly:
|
126 |
+
|
127 |
+
```bash
|
128 |
+
ollama run kubernetes_assistant_8b -p "Create a namespace called 'production'."
|
129 |
+
```
|
130 |
+
|
131 |
+
**Example Output:**
|
132 |
+
|
133 |
+
```bash
|
134 |
+
kubectl create namespace production
|
135 |
+
```
|
136 |
+
|
137 |
+
---
|
138 |
+
|
139 |
+
## Model Details
|
140 |
+
|
141 |
+
### Purpose
|
142 |
+
|
143 |
+
The model assists users by:
|
144 |
+
|
145 |
+
- **Generating accurate `kubectl` commands** based on natural language instructions.
|
146 |
+
- **Providing concise explanations about Kubernetes** for general queries.
|
147 |
+
- **Politely requesting additional information** if the instruction is incomplete or ambiguous.
|
148 |
+
|
149 |
+
### Intended Users
|
150 |
+
|
151 |
+
- Kubernetes administrators
|
152 |
+
- DevOps engineers
|
153 |
+
- Developers working with Kubernetes clusters
|
154 |
+
|
155 |
+
### Training Process
|
156 |
+
|
157 |
+
- **Base Model:** Unsloth's DeepSeek-R1-Distill-Llama-8B
|
158 |
+
- **Fine-tuning:** Leveraged the Unsloth framework and Hugging Face's TRL library for efficient training.
|
159 |
+
- **Training Data:** Customized dataset focused on Kubernetes operations, including:
|
160 |
+
- **`kubectl` Command Generation:** Commands for various Kubernetes tasks.
|
161 |
+
- **Clarification Requests:** Responses requesting specific information when instructions are incomplete.
|
162 |
+
- **Explanations:** Concise explanations of Kubernetes concepts.
|
163 |
+
- The dataset contains approximately 1,500 entries.
|
164 |
+
|
165 |
+
---
|
166 |
+
|
167 |
+
## Model Features
|
168 |
+
|
169 |
+
### 1. Command Generation in Bash Format
|
170 |
+
|
171 |
+
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.
|
172 |
+
|
173 |
+
### 2. Handling Ambiguity with Polite Clarifications
|
174 |
+
|
175 |
+
If the instruction is incomplete or ambiguous, the model will politely ask for the specific missing information instead of making assumptions. This ensures accuracy and prevents the execution of incorrect commands.
|
176 |
+
|
177 |
+
### 3. Providing Concise Explanations
|
178 |
+
|
179 |
+
For general Kubernetes questions, the model offers concise and accurate explanations without unnecessary details, helping users understand concepts quickly.
|
180 |
+
|
181 |
+
### 4. Enhanced Accuracy with 8B Model
|
182 |
+
|
183 |
+
The transition to the 8B model has significantly **improved accuracy and reduced hallucinations** compared to smaller models. The 8B model provides more precise and reliable responses, enhancing the overall user experience.
|
184 |
+
|
185 |
+
---
|
186 |
+
|
187 |
+
## Examples
|
188 |
+
|
189 |
+
### Example 1: Generating a Command
|
190 |
+
|
191 |
+
**Instruction:**
|
192 |
+
|
193 |
+
```
|
194 |
+
Get the list of all pods in the 'staging' namespace.
|
195 |
+
```
|
196 |
+
|
197 |
+
**Response:**
|
198 |
+
|
199 |
+
```bash
|
200 |
+
kubectl get pods -n staging
|
201 |
+
```
|
202 |
+
|
203 |
+
---
|
204 |
+
|
205 |
+
### Example 2: Handling Ambiguity
|
206 |
+
|
207 |
+
**Instruction:**
|
208 |
+
|
209 |
+
```
|
210 |
+
Delete the deployment.
|
211 |
+
```
|
212 |
+
|
213 |
+
**Response:**
|
214 |
+
|
215 |
+
```
|
216 |
+
Please specify the name of the deployment you wish to delete.
|
217 |
+
```
|
218 |
+
|
219 |
+
---
|
220 |
+
|
221 |
+
### Example 3: Providing Explanations
|
222 |
+
|
223 |
+
**Instruction:**
|
224 |
+
|
225 |
+
```
|
226 |
+
What is a StatefulSet in Kubernetes?
|
227 |
+
```
|
228 |
+
|
229 |
+
**Response:**
|
230 |
+
|
231 |
+
```
|
232 |
+
A StatefulSet manages the deployment and scaling of a set of pods, providing guarantees about the ordering and uniqueness of those pods. It's commonly used for stateful applications requiring stable network identities and persistent storage.
|
233 |
+
```
|
234 |
+
|
235 |
+
---
|
236 |
+
|
237 |
+
## Limitations and Considerations
|
238 |
+
|
239 |
+
- **Accuracy:** While the 8B model significantly improves accuracy, the model may occasionally produce incorrect or suboptimal commands. Always review the output before execution.
|
240 |
+
- **Resource Requirements:** The 8B model may require more computational resources compared to smaller models. Ensure your environment meets the necessary requirements for smooth operation.
|
241 |
+
- **Security:** Be cautious when executing generated commands, especially in production environments.
|
242 |
+
|
243 |
+
---
|
244 |
+
|
245 |
+
## Feedback and Contributions
|
246 |
+
|
247 |
+
We welcome any comments or participation to improve the model and dataset. If you encounter issues or have suggestions for improvement:
|
248 |
+
|
249 |
+
- **GitHub:** [Unsloth Repository](https://github.com/unslothai/unsloth)
|
250 |
+
- **Contact:** Reach out to the developer, **dereklck**, for further assistance.
|
251 |
+
|
252 |
+
---
|
253 |
+
|
254 |
+
**Note:** This model provides assistance in generating Kubernetes commands and explanations based on user input. Always verify the generated commands in a safe environment before executing them in a production cluster.
|
255 |
+
|
256 |
+
---
|
257 |
+
|
258 |
+
## Summary
|
259 |
|
260 |
+
The **Kubernetes Assistant Model (8B)** is a powerful tool designed to help users interact with Kubernetes clusters more efficiently. By leveraging advanced language modeling techniques, the model provides accurate `kubectl` commands, helpful explanations, and polite clarifications when necessary. The use of the 8B model enhances the precision and reliability of responses, making it a valuable asset for anyone working with Kubernetes.
|
261 |
|
262 |
+
---
|