Transformers
Safetensors
PEFT
English
text-generation-inference
gemma4
lora
cybersecurity
docker
container-security
devsecops
Instructions to use rezaduty/gemma4-e2b-docker-container-security with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rezaduty/gemma4-e2b-docker-container-security with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rezaduty/gemma4-e2b-docker-container-security", dtype="auto") - PEFT
How to use rezaduty/gemma4-e2b-docker-container-security with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Add specialized README for Docker & Container Security
Browse files
README.md
CHANGED
|
@@ -1,22 +1,90 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
| 6 |
-
- unsloth
|
| 7 |
- gemma4
|
| 8 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
license: apache-2.0
|
| 10 |
language:
|
| 11 |
- en
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
- **Finetuned from model :** unsloth/gemma-4-e2b-it-unsloth-bnb-4bit
|
| 19 |
|
| 20 |
-
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: google/gemma-4-e2b-it
|
| 3 |
tags:
|
| 4 |
- text-generation-inference
|
| 5 |
- transformers
|
|
|
|
| 6 |
- gemma4
|
| 7 |
+
- peft
|
| 8 |
+
- lora
|
| 9 |
+
- cybersecurity
|
| 10 |
+
- docker
|
| 11 |
+
- container-security
|
| 12 |
+
- devsecops
|
| 13 |
+
- cybersecurity
|
| 14 |
license: apache-2.0
|
| 15 |
language:
|
| 16 |
- en
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# Gemma 4 E2B — Docker & Container Security Expert
|
| 20 |
|
| 21 |
+
A QLoRA fine-tuned version of [Gemma 4 E2B Instruct](https://huggingface.co/google/gemma-4-e2b-it) specialized in **docker & container security**.
|
| 22 |
+
Specialized in **Docker and container security**: image hardening, rootless containers, seccomp/AppArmor profiles, runtime threat detection, and container escape techniques and mitigations.
|
|
|
|
| 23 |
|
| 24 |
+
Part of the [rezaduty cybersecurity model family](https://huggingface.co/rezaduty).
|
| 25 |
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
## Expertise
|
| 29 |
+
|
| 30 |
+
- Docker daemon security and socket exposure risks
|
| 31 |
+
- Image scanning, distroless images, and minimal base images
|
| 32 |
+
- Rootless containers, user namespaces, and capability dropping
|
| 33 |
+
- Runtime security with Falco, seccomp, and AppArmor
|
| 34 |
+
- Container escape techniques and kernel exploit mitigations
|
| 35 |
+
- Dockerfile best practices and supply-chain integrity
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## Model Details
|
| 40 |
+
|
| 41 |
+
| Property | Value |
|
| 42 |
+
|---|---|
|
| 43 |
+
| **Base model** | google/gemma-4-e2b-it (2B parameters) |
|
| 44 |
+
| **Fine-tuning method** | QLoRA (rank 16, α 16) |
|
| 45 |
+
| **Domain** | Docker & Container Security |
|
| 46 |
+
| **License** | Apache 2.0 |
|
| 47 |
+
|
| 48 |
+
---
|
| 49 |
+
|
| 50 |
+
## Usage
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 54 |
+
from peft import PeftModel
|
| 55 |
+
import torch
|
| 56 |
+
|
| 57 |
+
base_model = "google/gemma-4-e2b-it"
|
| 58 |
+
adapter = "rezaduty/gemma4-e2b-docker-container-security"
|
| 59 |
+
|
| 60 |
+
tokenizer = AutoTokenizer.from_pretrained(adapter)
|
| 61 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 62 |
+
base_model, torch_dtype=torch.bfloat16, device_map="auto"
|
| 63 |
+
)
|
| 64 |
+
model = PeftModel.from_pretrained(model, adapter)
|
| 65 |
+
|
| 66 |
+
messages = [
|
| 67 |
+
{"role": "system", "content": [{"type": "text", "text": "You are an expert in Docker and container security. You provide deep, production-level answers on container hardening, image security, runtime protection, and container escape prevention."}]},
|
| 68 |
+
{"role": "user", "content": [{"type": "text", "text": "Your question here"}]},
|
| 69 |
+
]
|
| 70 |
+
inputs = tokenizer.apply_chat_template(
|
| 71 |
+
messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
|
| 72 |
+
).to(model.device)
|
| 73 |
+
output = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
| 74 |
+
print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True))
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## System Prompt
|
| 80 |
+
|
| 81 |
+
```
|
| 82 |
+
You are an expert in Docker and container security. You provide deep, production-level answers on container hardening, image security, runtime protection, and container escape prevention.
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## See Also
|
| 88 |
+
|
| 89 |
+
- [General cybersecurity model](https://huggingface.co/rezaduty/gemma4-e2b-cybersecurity-interview) — full 646-example dataset
|
| 90 |
+
- [All rezaduty models](https://huggingface.co/rezaduty)
|