Translating human instructions into shell commands.
ShellSLM is a fine-tuned version of the Small Language Model Qwen3.5-4B, for translating human instructions into corresponding Linux shell commands.
The fine-tuning pipeline consists in a series of steps:
-
Download the dataset containing human instructions and corresponding commands.
-
Pre-process the dataset to filter out non-Linux commands and add a column defining the system role.
-
Apply the chat template required by the model (ChatML)
-
Fine-tune the pretrained model on the preprocessed dataset.
-
The specific dataset used is NL2SH-ALPACA from HuggingFace, which is a variant of the NL2SH-ALFA dataset, already converted in the ALPACA format (instruction, input, output).
-
To load and train the Qwen3.5-4B model, the Unsloth framework is used, which allows to perform a training ~2x faster with ~70% less VRAM, without accuracy loss.
-
To avoid saturating the VRAM and make the training process even faster, the model is loaded with a 4bit quantization.
-
The type of fine-tuning performed is Parameter-efficient fine-tuning (PEFT) using LoRA algorithm.
-
The model has been fine-tuned on a NVIDIA A100 GPU with 80 GB of VRAM.
IMPORTANT: The model is still under evaluation, so be careful when using it and always verify its output! Evaluation results will be published here when ready.
You can test the model on the HuggingFace space at the link: https://huggingface.co/spaces/andreagalasso99/shell-SLM.
If you want to use the model in your experiments, you can follow the instructions provided on the model card of the HuggingFace model repository: https://huggingface.co/andreagalasso99/Qwen3.5-4B-NL2SH