Transformers
Safetensors
PEFT
English
text-generation-inference
gemma4
lora
cybersecurity
cloud-security
aws
iam
terraform
devsecops
Instructions to use rezaduty/gemma4-e2b-cloud-iam-terraform with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rezaduty/gemma4-e2b-cloud-iam-terraform with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("rezaduty/gemma4-e2b-cloud-iam-terraform", dtype="auto") - PEFT
How to use rezaduty/gemma4-e2b-cloud-iam-terraform with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Add specialized README for Cloud IAM & Terraform Security
Browse files
README.md
CHANGED
|
@@ -1,22 +1,95 @@
|
|
| 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 |
+
- cloud-security
|
| 11 |
+
- aws
|
| 12 |
+
- iam
|
| 13 |
+
- terraform
|
| 14 |
+
- devsecops
|
| 15 |
+
- cybersecurity
|
| 16 |
license: apache-2.0
|
| 17 |
language:
|
| 18 |
- en
|
| 19 |
---
|
| 20 |
|
| 21 |
+
# Gemma 4 E2B — Cloud IAM & Terraform Security Expert
|
| 22 |
|
| 23 |
+
A QLoRA fine-tuned version of [Gemma 4 E2B Instruct](https://huggingface.co/google/gemma-4-e2b-it) specialized in **cloud iam & terraform security**.
|
| 24 |
+
Specialized in **cloud IAM and Terraform security**: least-privilege IAM policy design, ECR image scanning, Terraform state security, and cloud privilege escalation paths.
|
|
|
|
| 25 |
|
| 26 |
+
Part of the [rezaduty cybersecurity model family](https://huggingface.co/rezaduty).
|
| 27 |
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Expertise
|
| 31 |
+
|
| 32 |
+
- AWS IAM least-privilege design and permission boundaries
|
| 33 |
+
- IAM role assumption, OIDC federation, and cross-account access
|
| 34 |
+
- ECR image scanning, lifecycle policies, and pull-through cache security
|
| 35 |
+
- Terraform state file security, remote backends, and drift detection
|
| 36 |
+
- Cloud privilege escalation paths and detection
|
| 37 |
+
- IaC security scanning: Checkov, tfsec, Terrascan
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## Model Details
|
| 42 |
+
|
| 43 |
+
| Property | Value |
|
| 44 |
+
|---|---|
|
| 45 |
+
| **Base model** | google/gemma-4-e2b-it (2B parameters) |
|
| 46 |
+
| **Fine-tuning method** | QLoRA (rank 16, α 16) |
|
| 47 |
+
| **Domain** | Cloud IAM & Terraform Security |
|
| 48 |
+
| **License** | Apache 2.0 |
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## Usage
|
| 53 |
+
|
| 54 |
+
```python
|
| 55 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 56 |
+
from peft import PeftModel
|
| 57 |
+
import torch
|
| 58 |
+
|
| 59 |
+
base_model = "google/gemma-4-e2b-it"
|
| 60 |
+
adapter = "rezaduty/gemma4-e2b-cloud-iam-terraform"
|
| 61 |
+
|
| 62 |
+
tokenizer = AutoTokenizer.from_pretrained(adapter)
|
| 63 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 64 |
+
base_model, torch_dtype=torch.bfloat16, device_map="auto"
|
| 65 |
+
)
|
| 66 |
+
model = PeftModel.from_pretrained(model, adapter)
|
| 67 |
+
|
| 68 |
+
messages = [
|
| 69 |
+
{"role": "system", "content": [{"type": "text", "text": "You are an expert in cloud IAM and infrastructure-as-code security. You provide deep answers on AWS IAM, ECR hardening, Terraform security, and cloud privilege escalation paths."}]},
|
| 70 |
+
{"role": "user", "content": [{"type": "text", "text": "Your question here"}]},
|
| 71 |
+
]
|
| 72 |
+
inputs = tokenizer.apply_chat_template(
|
| 73 |
+
messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
|
| 74 |
+
).to(model.device)
|
| 75 |
+
output = model.generate(inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
|
| 76 |
+
print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True))
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## System Prompt
|
| 82 |
+
|
| 83 |
+
```
|
| 84 |
+
You are an expert in cloud IAM and infrastructure-as-code security. You provide deep answers on AWS IAM, ECR hardening, Terraform security, and cloud privilege escalation paths.
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
---
|
| 88 |
+
|
| 89 |
+
## See Also
|
| 90 |
+
|
| 91 |
+
- [General cybersecurity model](https://huggingface.co/rezaduty/gemma4-e2b-cybersecurity-interview) — full 646-example dataset
|
| 92 |
+
- [Docker & Container Security](https://huggingface.co/rezaduty/gemma4-e2b-docker-container-security)
|
| 93 |
+
- [Kubernetes Security](https://huggingface.co/rezaduty/gemma4-e2b-kubernetes-security)
|
| 94 |
+
- [AI & LLM Security](https://huggingface.co/rezaduty/gemma4-e2b-ai-llm-security)
|
| 95 |
+
- [All rezaduty models](https://huggingface.co/rezaduty)
|