Team Ai
Datasetpublic

rajivmehtapy/shell-script-specialist-dataset

Full-Spectrum Shell Script Specialist Dataset This dataset contains 1,000 curated, unique ChatML conversation records engineered to fine-tune a specialist language model for Production-Grade Shell Scripting (Bash 5+, POSIX /bin/sh, jq, awk, sed). It was used to train the rajivmehtapy/gemma-4-e4b-shell-specialist model using Unsloth. Dataset Splits Split File Records Description train train.jsonl 900 Core training set across all 4 production modules… See the full description on the dataset page: https://huggingface.co/datasets/rajivmehtapy/shell-script-specialist-dataset.

sourceHugging Faceapache-2.0updated 16d agoView on Hugging Face
0likes54downloads
Dataset Card

Full-Spectrum Shell Script Specialist Dataset

This dataset contains 1,000 curated, unique ChatML conversation records engineered to fine-tune a specialist language model for Production-Grade Shell Scripting (Bash 5+, POSIX `/bin/sh`, `jq`, `awk`, `sed`).

It was used to train the rajivmehtapy/gemma-4-e4b-shell-specialist model using Unsloth.


Dataset Splits

SplitFileRecordsDescription
traintrain.jsonl900Core training set across all 4 production modules
validationeval.jsonl100Held-out validation split for checkpoint evaluation

Modules Covered

  1. 1.Production Bash 5+ Automation (35%): Archival rotations, health probes with exponential backoff, systemd service watchdogs, disk/memory threshold monitors.
  2. 2.Minimal POSIX `/bin/sh` Portability (20%): Alpine Linux / Docker entrypoints, socket polling (nc -z), POSIX parameter expansions, zero Bashisms.
  3. 3.Advanced CLI Stream Wrangling (25%): Complex jq queries with atomic file replacements, awk columnar parsing, sed stream updates, null-delimited find / xargs pipelines.
  4. 4.Defensive Hardening & Bug Refactoring (20%): Auditing fragile bash snippets, eliminating unquoted variable risks, adding set -euo pipefail and trap handlers.

Data Schema (ChatML JSONL)

json
{
  "messages": [
    {
      "role": "user",
      "content": "Write a bash script to archive and remove .log files older than 14 days in /var/log with dry-run support."
    },
    {
      "role": "assistant",
      "content": "#!/usr/bin/env bash\nset -euo pipefail\n\nDRY_RUN=false\n[[ \"${1:-}\" == \"--dry-run\" ]] && DRY_RUN=true\n..."
    }
  ]
}

Usage with Hugging Face Datasets

python
from datasets import load_dataset

dataset = load_dataset("rajivmehtapy/shell-script-specialist-dataset")
print(dataset)
print(dataset["train"][0])

Next Steps: DPO & GRPO Alignment

When you spin up your next machine for DPO and GRPO, you can immediately resume using the following one-liners:

1. Pulling the Policy Model on the New Machine

python
from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name="rajivmehtapy/gemma-4-e4b-shell-specialist",
    max_seq_length=1024,
    load_in_4bit=True,
)

2. Pulling the Dataset on the New Machine

python
from datasets import load_dataset

dataset = load_dataset("rajivmehtapy/shell-script-specialist-dataset")

3. Ready for DPO

  • —Use the SFT model as the reference policy.
  • —Provide (prompt, chosen, rejected) triplets (where chosen contains defensive standards like set -euo pipefail and rejected contains common bash antipatterns).
  • —Train with trl.DPOTrainer.

4. Ready for GRPO

  • —Use the SFT model as the actor model.
  • —Set up automated rule-based reward functions (shellcheck returncode, exit code in Docker sandbox, security parameter validation).
  • —Train with trl.GRPOTrainer.

Everything is backed up and ready for your next phase!