Lime-T5-Large (Linux SysAdmin Expert)

This model is a fine-tuned version of google/flan-t5-large, specialized in translating natural language instructions into Linux Bash commands.

Unlike generic code generation models, this model has been trained with a Strict Logic Context-Aware Architecture. It analyzes the files present in the working directory before suggesting a command, ensuring high reliability and reducing hallucinations.

The training was conducted for 10 hours on an NVIDIA L4 GPU, processing thousands of manually curated examples to ensure robustness.

Key Features

This model is designed to act as an automated DevOps Engineer or System Administrator. Its capabilities include:

  1. Context Awareness: The model does not guess. If asked to "install dependencies," it checks for the existence of package.json (npm), requirements.txt (pip), or go.mod (go) before generating the command.
  2. Silent Mode (Anti-Hallucination): If the user greets or makes trivial comments, the model returns a neutral command (echo or :) instead of attempting to execute dangerous code.
  3. Service Distinction: Correctly differentiates between system services (systemd) and network services/ports.
  4. Advanced Pipes: Capable of chaining tools like grep, awk, sed, sort, and uniq for forensic log analysis and data processing.
  5. Self-Correction: Trained to receive an error message (stderr) and generate a corrected command (e.g., adding sudo, creating missing directories, or resolving git conflicts).

Training Data

The dataset (v5) was synthetically constructed and curated using strict validation scripts. It includes the following categories:

  • Logic Strict: Commands that strictly require specific files to be present.
  • Null Chat: Human conversation pairs resulting in safe inaction.
  • Visual vs System: Semantic distinction between "images" (graphic files) and "images" (Docker containers).
  • Self Correction: Pairs of [Failed Command + Error] -> [Solution].
  • Expert Pipes: Complex one-liners for system analysis.

Usage

The model expects a specific input format to function correctly. Since it was trained on Spanish prompts, the structure keywords must remain in Spanish:

Contexto: [file_list] | Instrucción

Python Example

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

model_name = "jrodriiguezg/lime-t5-large-770m"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)

def generate_command(files, instruction):
    # Strictly format the prompt using the training keywords
    input_text = f"Contexto: {files} | {instruction}"
    
    inputs = tokenizer(input_text, return_tensors="pt", max_length=128, truncation=True)
    outputs = model.generate(**inputs, max_length=128, num_beams=5, early_stopping=True)
    
    return tokenizer.decode(outputs[0], skip_special_tokens=True)

# Case 1: Context Usage
files = '["main.py", "requirements.txt", ".env"]'
instruction = "Inicia el servidor"
print(generate_command(files, instruction))
# Expected output: python3 main.py (or context-specific command)

# Case 2: Self-Correction
files = '[]'
instruction = "El comando 'apt install nginx' falló con error: 'Permission denied'. Corrígelo."
print(generate_command(files, instruction))
# Expected output: sudo apt install nginx
Downloads last month
26
Safetensors
Model size
0.8B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for jrodriiguezg/lime-t5-large-770m

Finetuned
(200)
this model