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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 5 |
+
tags:
|
| 6 |
+
- qwen2.5
|
| 7 |
+
- cloud
|
| 8 |
+
- azure
|
| 9 |
+
- aws
|
| 10 |
+
- terraform
|
| 11 |
+
- docker
|
| 12 |
+
- kubernetes
|
| 13 |
+
- linux
|
| 14 |
+
- iac
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Cloud Expert Qwen
|
| 18 |
+
|
| 19 |
+
This is a version 1 of Qwen 2.5-Coder 1.5B fine-tuned for cloud computing & IaC
|
| 20 |
+
|
| 21 |
+
Fine-tuned on comprehensive cloud computing, Infrastructure as Code, containerization, and Linux system administration documentation.
|
| 22 |
+
|
| 23 |
+
## π― What This Model Knows
|
| 24 |
+
|
| 25 |
+
- **Cloud Platforms**: Azure, AWS, GCP
|
| 26 |
+
- **Infrastructure as Code**: Terraform, CloudFormation, ARM templates
|
| 27 |
+
- **Containers & Orchestration**: Docker, Kubernetes
|
| 28 |
+
- **Linux**: System administration, troubleshooting, networking
|
| 29 |
+
- **DevOps**: CI/CD, monitoring, security best practices
|
| 30 |
+
|
| 31 |
+
## π Quick Start
|
| 32 |
+
|
| 33 |
+
### Option 1: Use with Transformers (Python)
|
| 34 |
+
```python
|
| 35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 36 |
+
from peft import PeftModel
|
| 37 |
+
import torch
|
| 38 |
+
|
| 39 |
+
# Load base model
|
| 40 |
+
base_model = "Qwen/Qwen2.5-Coder-1.5B-Instruct"
|
| 41 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 42 |
+
base_model,
|
| 43 |
+
torch_dtype=torch.float16,
|
| 44 |
+
device_map="auto",
|
| 45 |
+
trust_remote_code=True
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
# Load fine-tuned LoRA adapters
|
| 49 |
+
model = PeftModel.from_pretrained(model, "jsdjsdequinia/cloud-expert-qwen/lora-adapters")
|
| 50 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
|
| 51 |
+
|
| 52 |
+
# Ask a question
|
| 53 |
+
question = "How do I troubleshoot SSH connection issues on Linux?"
|
| 54 |
+
prompt = f"<|im_start|>user\n{question}<|im_end|>\n<|im_start|>assistant\n"
|
| 55 |
+
|
| 56 |
+
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
|
| 57 |
+
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
|
| 58 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 59 |
+
|
| 60 |
+
print(response)
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### Option 2: Use with Ollama (Recommended for CPU)
|
| 64 |
+
|
| 65 |
+
**Perfect for laptops without GPU!**
|
| 66 |
+
|
| 67 |
+
1. **Install Ollama**: https://ollama.ai/download
|
| 68 |
+
|
| 69 |
+
2. **Download the model**:
|
| 70 |
+
```bash
|
| 71 |
+
huggingface-cli download jsdjsdequinia/cloud-expert-qwen cloud-expert-qwen-q8_0.gguf --local-dir ./
|
| 72 |
+
huggingface-cli download jsdjsdequinia/cloud-expert-qwen Modelfile --local-dir ./
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
3. **Create Ollama model**:
|
| 76 |
+
```bash
|
| 77 |
+
ollama create cloud-expert -f Modelfile
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
4. **Run it**:
|
| 81 |
+
```bash
|
| 82 |
+
ollama run cloud-expert
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
5. **Or use in code**:
|
| 86 |
+
```python
|
| 87 |
+
import ollama
|
| 88 |
+
|
| 89 |
+
response = ollama.chat(model='cloud-expert', messages=[
|
| 90 |
+
{'role': 'user', 'content': 'What is Azure Virtual Machine?'}
|
| 91 |
+
])
|
| 92 |
+
print(response['message']['content'])
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
## π¦ Available Formats
|
| 96 |
+
|
| 97 |
+
| Format | Size | Use Case | Download |
|
| 98 |
+
|--------|------|----------|----------|
|
| 99 |
+
| **LoRA Adapters** | ~100MB | Fine-tuning, GPU inference | `lora-adapters/` |
|
| 100 |
+
| **Merged Model** | ~3GB | Full model, GPU inference | `merged-model/` |
|
| 101 |
+
| **GGUF (q8_0)** | ~1.5GB | CPU inference with Ollama | `*.gguf` |
|
| 102 |
+
|
| 103 |
+
## π Training Details
|
| 104 |
+
|
| 105 |
+
- **Base Model**: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 106 |
+
- **Training Method**: LoRA (Low-Rank Adaptation)
|
| 107 |
+
- **Training Data**: 43 examples
|
| 108 |
+
- Manual Q&A pairs on cloud services
|
| 109 |
+
- Scraped official documentation (Azure, Docker, Kubernetes, etc.)
|
| 110 |
+
- Linux troubleshooting guides
|
| 111 |
+
- **Training Time**: ~20-30 minutes on RTX 3070
|
| 112 |
+
- **Trainable Parameters**: ~2% (LoRA efficient training)
|
| 113 |
+
|
| 114 |
+
## π‘ Example Questions
|
| 115 |
+
```
|
| 116 |
+
- What is Microsoft Azure?
|
| 117 |
+
- How do I deploy a Docker container?
|
| 118 |
+
- Explain Terraform state management
|
| 119 |
+
- How do I troubleshoot disk usage on Linux?
|
| 120 |
+
- Compare Azure VM vs AWS EC2
|
| 121 |
+
- What are Kubernetes best practices?
|
| 122 |
+
- How do I configure a Linux firewall?
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
## π₯οΈ System Requirements
|
| 126 |
+
|
| 127 |
+
### For Training:
|
| 128 |
+
- GPU with 8GB+ VRAM
|
| 129 |
+
- 16GB RAM
|
| 130 |
+
- CUDA 12.1+
|
| 131 |
+
|
| 132 |
+
### For Inference:
|
| 133 |
+
**With Transformers (GPU):**
|
| 134 |
+
- GPU with 4GB+ VRAM
|
| 135 |
+
- 8GB RAM
|
| 136 |
+
|
| 137 |
+
**With Ollama (CPU - Recommended for work laptops):**
|
| 138 |
+
- Any modern CPU
|
| 139 |
+
- 4GB RAM
|
| 140 |
+
- No GPU needed! β
|
| 141 |
+
|
| 142 |
+
## β‘ Performance
|
| 143 |
+
|
| 144 |
+
| Setup | Tokens/Second | Use Case |
|
| 145 |
+
|-------|---------------|----------|
|
| 146 |
+
| GPU (RTX 3070) | ~50 tok/s | Development, training |
|
| 147 |
+
| CPU (Ollama, 16GB RAM) | ~10-15 tok/s | Work laptop, portable |
|
| 148 |
+
|
| 149 |
+
## π Use Cases
|
| 150 |
+
|
| 151 |
+
β
Learning cloud technologies
|
| 152 |
+
β
Quick reference for DevOps tasks
|
| 153 |
+
β
Understanding IaC best practices
|
| 154 |
+
β
Linux troubleshooting assistance
|
| 155 |
+
β
Comparing cloud services
|
| 156 |
+
β
Interview preparation
|
| 157 |
+
|
| 158 |
+
## β οΈ Limitations
|
| 159 |
+
|
| 160 |
+
- Knowledge cutoff: Training data as of 2024
|
| 161 |
+
- May not reflect very recent service updates
|
| 162 |
+
- Best for general concepts and established practices
|
| 163 |
+
- Always verify critical production decisions with official docs
|
| 164 |
+
- Not a replacement for hands-on experience
|
| 165 |
+
|
| 166 |
+
## π License
|
| 167 |
+
|
| 168 |
+
Apache 2.0 - Free for commercial and personal use
|
| 169 |
+
|
| 170 |
+
## π Credits
|
| 171 |
+
|
| 172 |
+
- Base model: [Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct)
|
| 173 |
+
- Fine-tuned by: jsdjsdequinia
|
| 174 |
+
- Documentation sources: Microsoft Azure, Docker, Kubernetes, DigitalOcean, HashiCorp
|
| 175 |
+
|
| 176 |
+
## π Feedback
|
| 177 |
+
|
| 178 |
+
Found an issue or have suggestions? Feel free to open an issue on the model page!
|
| 179 |
+
|
| 180 |
+
---
|
| 181 |
+
|
| 182 |
+
**Built with β€οΈ for the DevOps community**
|