Transformers
Safetensors
PEFT
English
text-generation-inference
gemma4
lora
cybersecurity
kubernetes
k8s
container-security
devsecops
Instructions to use rezaduty/gemma4-e2b-kubernetes-security with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rezaduty/gemma4-e2b-kubernetes-security with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rezaduty/gemma4-e2b-kubernetes-security", dtype="auto") - PEFT
How to use rezaduty/gemma4-e2b-kubernetes-security with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
| base_model: google/gemma-4-e2b-it | |
| tags: | |
| - text-generation-inference | |
| - transformers | |
| - gemma4 | |
| - peft | |
| - lora | |
| - cybersecurity | |
| - kubernetes | |
| - k8s | |
| - container-security | |
| - devsecops | |
| - cybersecurity | |
| license: apache-2.0 | |
| language: | |
| - en | |
| # Gemma 4 E2B — Kubernetes Security Expert | |
| A QLoRA fine-tuned version of [Gemma 4 E2B Instruct](https://huggingface.co/google/gemma-4-e2b-it) specialized in **kubernetes security**. | |
| Specialized in **Kubernetes security**: RBAC design, Pod Security Standards, network policies, admission controllers, etcd encryption, and multi-tenant cluster hardening. | |
| Part of the [rezaduty cybersecurity model family](https://huggingface.co/rezaduty). | |
| --- | |
| ## Expertise | |
| - RBAC least-privilege design and audit logging | |
| - Pod Security Standards (Restricted, Baseline, Privileged) | |
| - Network policies and service mesh security (Istio/Linkerd) | |
| - Admission controllers: OPA Gatekeeper, Kyverno, Falco | |
| - Secrets encryption at rest and external secrets management | |
| - Supply-chain security: image signing, SBOM, admission control | |
| --- | |
| ## Model Details | |
| | Property | Value | | |
| |---|---| | |
| | **Base model** | google/gemma-4-e2b-it (2B parameters) | | |
| | **Fine-tuning method** | QLoRA (rank 16, α 16) | | |
| | **Domain** | Kubernetes Security | | |
| | **License** | Apache 2.0 | | |
| --- | |
| ## Usage | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import PeftModel | |
| import torch | |
| base_model = "google/gemma-4-e2b-it" | |
| adapter = "rezaduty/gemma4-e2b-kubernetes-security" | |
| tokenizer = AutoTokenizer.from_pretrained(adapter) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| base_model, torch_dtype=torch.bfloat16, device_map="auto" | |
| ) | |
| model = PeftModel.from_pretrained(model, adapter) | |
| messages = [ | |
| {"role": "system", "content": [{"type": "text", "text": "You are an expert in Kubernetes security. You provide deep answers on RBAC, Pod Security, network policies, admission controllers, secrets management, and cluster hardening."}]}, | |
| {"role": "user", "content": [{"type": "text", "text": "Your question here"}]}, | |
| ] | |
| inputs = tokenizer.apply_chat_template( | |
| messages, tokenize=True, add_generation_prompt=True, return_tensors="pt" | |
| ).to(model.device) | |
| output = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9) | |
| print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True)) | |
| ``` | |
| --- | |
| ## System Prompt | |
| ``` | |
| You are an expert in Kubernetes security. You provide deep answers on RBAC, Pod Security, network policies, admission controllers, secrets management, and cluster hardening. | |
| ``` | |
| --- | |
| ## See Also | |
| - [General cybersecurity model](https://huggingface.co/rezaduty/gemma4-e2b-cybersecurity-interview) — full 646-example dataset | |
| - [Docker & Container Security](https://huggingface.co/rezaduty/gemma4-e2b-docker-container-security) | |
| - [All rezaduty models](https://huggingface.co/rezaduty) | |