Shell Command Classifier

A fast binary classifier that distinguishes shell commands from natural language queries.

Performance

Metric Value
Accuracy 100%
F1 Score 1.0
Latency ~3ms
Model Size 0.8MB (ONNX)

Usage

Python (ONNX)

import onnxruntime as ort
from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("elleryfamilia/broshky")
session = ort.InferenceSession("onnx/model.onnx")

text = "ls -la"
inputs = tokenizer(text, return_tensors="np", padding=True, truncation=True, max_length=128)
outputs = session.run(None, {
    "input_ids": inputs["input_ids"],
    "attention_mask": inputs["attention_mask"]
})
# outputs[0] contains logits: [natural_language_score, command_score]

Python (Transformers)

from transformers import pipeline

classifier = pipeline("text-classification", model="elleryfamilia/broshky")
result = classifier("git commit -m 'fix bug'")
# [{'label': 'command', 'score': 0.99}]

Labels

  • 0 / natural_language: Natural language queries (e.g., "how do I list files?")
  • 1 / command: Shell commands (e.g., "ls -la", "git status")

Training

  • Base model: sentence-transformers/all-MiniLM-L6-v2
  • Training data: ~10K synthetic examples generated with Kimi K2.5
  • Fine-tuned for 3 epochs on Modal (T4 GPU)

License

MIT

Downloads last month
34
Safetensors
Model size
22.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support