--- library_name: mlx license: apache-2.0 license_link: https://ai.google.dev/gemma/docs/gemma_4_license base_model: google/gemma-4-E2B-it datasets: - htunn/aiops-gemma language: - en tags: - mlx - gemma4 - lora - aiops - kubernetes - nutanix - vmware - active-directory - pki - infrastructure-automation - conversational pipeline_tag: text-generation --- # Gemma 4 E2B — AIOps Orchestrator (Safetensors / HF format) Fine-tuned from **[google/gemma-4-E2B-it](https://huggingface.co/google/gemma-4-E2B-it)** using Apple MLX LoRA on an M3 Pro (18 GB). The model is specialised as an **autonomous AIOps orchestrator agent** that maps infrastructure incident telemetry to structured, execution-ready JSON control schemas. > Looking for the quantised GGUF variant? > → **[htunn/gemma-4-e2b-aiops-gguf](https://huggingface.co/htunn/gemma-4-e2b-aiops-gguf)** --- ## Model Details | Field | Value | |---|---| | **Base model** | `google/gemma-4-E2B-it` | | **Architecture** | `Gemma4ForConditionalGeneration` | | **Precision** | BF16 | | **Parameters** | ~5B | | **Fine-tune method** | LoRA (MLX) | | **LoRA rank / scale** | 8 / 20.0 | | **Layers tuned** | 16 | | **Training iterations** | 600 | | **Batch size** | 1 | | **Learning rate** | 1e-4 | | **Max sequence length** | 2048 | | **Training hardware** | Apple M3 Pro, 18 GB Unified Memory | | **Framework** | `mlx-lm` | | **Dataset** | [htunn/aiops-gemma](https://huggingface.co/datasets/htunn/aiops-gemma) | | **License** | Apache 2.0 | --- ## Intended Use The model receives an `[AIOps-Agent]` incident description spanning one or more infrastructure domains and returns a **single JSON object** containing: - `action` — the remediation action to take - `target_*` — specific resource identifiers - `steps` — ordered list of discrete remediation steps - `api_calls` — REST API calls to execute - `priority` / `risk` — severity classification ### Covered Domains - **Kubernetes** — pod failures, etcd quorum loss, network partitions, cert-manager, autoscaling, storage - **Nutanix** — CVM network partitions, multi-cluster Prism Central, NearSync/async replication, Calm blueprints, Karbon, Era, stretched clusters, Flow microsegmentation - **VMware** — ESXi, vSAN, NSX-T, DRS, HA failover, vMotion, vCenter SSO - **Active Directory** — replication, FSMO, SYSVOL, cross-site failures, forest trusts - **ADFS / PKI** — certificate chain validation, OCSP, CRL, intermediate CA renewal, MFA providers - **Windows Server** — domain controllers, IIS, WSUS, Hyper-V, DFS, file services --- ## Usage ### Transformers ```python from transformers import AutoTokenizer, AutoModelForCausalLM import torch model_id = "htunn/gemma-4-e2b-aiops-hf" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto", ) prompt = "[AIOps-Agent] Kubernetes etcd leader election failed due to network partition isolating etcd-01. API server returning 503. etcd cluster lost quorum." messages = [{"role": "user", "content": prompt}] inputs = tokenizer.apply_chat_template( messages, return_tensors="pt", add_generation_prompt=True, ).to(model.device) outputs = model.generate(inputs, max_new_tokens=256, do_sample=False) print(tokenizer.decode(outputs[0][inputs.shape[-1]:], skip_special_tokens=True)) ``` ### MLX (Apple Silicon) ```bash pip install mlx-lm mlx_lm.generate \ --model htunn/gemma-4-e2b-aiops-hf \ --prompt "[AIOps-Agent] Nutanix stretched cluster witness unreachable. RF1 degraded mode active." \ --max-tokens 256 ``` --- ## Example Output **Input:** ``` [AIOps-Agent] Kubernetes ingress controller presenting incomplete TLS certificate chain. Intermediate CA missing from secret bundle. External clients receiving SSL handshake errors. ``` **Output:** ```json { "action": "fix_incomplete_cert_chain", "target_service": "ingress-nginx", "missing_element": "intermediate_ca_certificate", "steps": [ "retrieve_full_certificate_chain_from_pki", "bundle_leaf_cert_with_intermediate_ca_cert", "update_kubernetes_tls_secret_with_complete_chain", "rolling_restart_ingress_controller_pods", "validate_chain_with_openssl_s_client" ], "commands": [ "openssl s_client -connect ingress.example.com:443 -showcerts", "openssl verify -CAfile chain.pem cert.pem" ], "api_calls": [ "PATCH /api/v1/namespaces/ingress-nginx/secrets/tls-wildcard-cert" ], "priority": "high" } ``` --- ## Training Data Trained on **[htunn/aiops-gemma](https://huggingface.co/datasets/htunn/aiops-gemma)** — 90 hand-crafted incident scenarios (73 train / 17 validation) in Gemma chat format, covering: - Network partition events across K8s, Nutanix, AD, and NSX-T - Certificate chain validation failures (incomplete chains, expired intermediates, OCSP, path-length constraints) - Multi-cluster Nutanix operations (Prism Central, NearSync, Calm, Era, Karbon, stretched clusters) - Cross-domain cascading failures involving 3–4 infrastructure layers simultaneously --- ## Limitations - Output format is tailored to the training schema; prompts not prefixed with `[AIOps-Agent]` may produce inconsistent results. - The model does not execute actions — it produces decision schemas for an orchestration layer to consume. - Coverage is limited to the incident types represented in the training set. --- ## Related Repos | Repo | Description | |---|---| | [htunn/gemma-4-e2b-aiops-gguf](https://huggingface.co/htunn/gemma-4-e2b-aiops-gguf) | Q4_K_M GGUF — run with Ollama or llama.cpp | | [htunn/aiops-gemma](https://huggingface.co/datasets/htunn/aiops-gemma) | Training dataset (JSONL) | | [GitHub: htunn/aiops-gemma4](https://github.com/htunn/aiops-gemma4) | Full fine-tuning pipeline source |