Downloads · 30 days
251
6% of all-time downloads
albinab/Qwen-0.5B-Coder-El-Terminalo
Qwen-0.5B-Coder-El-Terminalo is a text generation model from albinab. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A 0.5B parameter shell command generator fine-tuned from Qwen2.5-Coder-0.5B-Instruct using LoRA. It converts natural language queries into accurate shell commands for Linux and macOS.
Downloads · 30 days
251
6% of all-time downloads
All-time downloads
4K
Public
Repo size
929 MB
Likes
1
Public
Click a slice to open those files.
.gguf531 MB · 100%
From the Hugging Face model README
A 0.5B parameter shell command generator fine-tuned from Qwen2.5-Coder-0.5B-Instruct using LoRA. It converts natural language queries into accurate shell commands for Linux and macOS.
Built for El Terminalo — a GPU-accelerated terminal emulator for macOS.
You type English → it outputs a shell command. Nothing else. No explanations, no alternatives, no markdown.
Input: "list files ordered by size"
Output: ls -lhS
Input: "find all .log files modified in last 24 hours"
Output: find . -name '*.log' -mtime -1
Input: "kill process on port 8080"
Output: fuser -k 8080/tcp
Input: "get cluster events ordered by timestamp"
Output: kubectl get events --sort-by='.metadata.creationTimestamp'
| Base Model | Qwen2.5-Coder-0.5B-Instruct |
| Method | LoRA (rank 32, alpha 64) |
| Training Data | 5,536 curated NL→command pairs |
| Target Modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Epochs | 4 |
| Learning Rate | 2e-4 (cosine scheduler) |
| Quantization | Q8_0 GGUF |
| File Size | ~500MB |
| RAM Usage | ~800MB–1GB during inference |
| License | Apache 2.0 |
Trained on 209 unique base commands across these categories:
| Category | Examples | Count |
|---|---|---|
| Git | git log, git stash, git rebase | 620 |
| Docker | docker ps, docker-compose up | 500 |
| Kubernetes | kubectl get, kubectl port-forward | 375 |
| File Operations | find, ls, tar, chmod | 551 |
| System Admin | systemctl, journalctl, ps, kill | 453 |
| Networking | curl, ssh, rsync, scp | 304 |
| Databases | psql, mysql, redis-cli | 256 |
| Package Management | apt, brew, npm, pip | 193 |
Supports both Linux (bash) and macOS (zsh) via context-aware system prompts.
ModelfileFROM ./shell-cmd-qwen-0.5b-q8.gguf
TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
PARAMETER temperature 0.1
PARAMETER top_p 0.9
SYSTEM """You are a shell command generator. OS: linux, Shell: bash, CWD: /home/user. Output ONLY the command."""
macOS users: Change the SYSTEM line to:
SYSTEM """You are a shell command generator. OS: macos, Shell: zsh, CWD: ~/. Output ONLY the command."""
ollama create shell-cmd -f Modelfile
ollama run shell-cmd "compress the logs directory into a tar.gz"
# → tar -czf logs.tar.gz logs/
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"albinab/Qwen-0.5B-Coder-El-Terminalo",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("albinab/Qwen-0.5B-Coder-El-Terminalo")
messages = [
{"role": "system", "content": "You are a shell command generator. OS: linux, Shell: bash, CWD: /home/user. Output ONLY the command."},
{"role": "user", "content": "show running docker containers"}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
output = model.generate(**inputs, max_new_tokens=128, temperature=0.1, do_sample=True)
print(tokenizer.decode(output[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True))
# → docker ps
Fine-tuned using LLaMA Factory with LoRA on a Google Colab T4 GPU (~20 min training time).
The training dataset went through extensive cleaning:
ls -lhS for sort-by-size)Full parameter fine-tuning on a 0.5B model causes catastrophic forgetting — the model loses its pretrained understanding of what CLI flags mean and memorizes surface patterns instead. LoRA keeps the base model frozen and trains small adapter layers on top, preserving the original knowledge while adding the new skill.
REFUSE mechanism (for dangerous commands like rm -rf /) was trained on limited examples and should not be relied on as a safety layer.This model powers the AI translation feature in El Terminalo, a modern GPU-accelerated terminal emulator for macOS built with Go + Wails + xterm.js. The model runs locally via Ollama — no API keys, no cloud, no data leaving your machine.
@misc{qwen-0.5b-coder-el-terminalo,
author = {Albin},
title = {Qwen-0.5B-Coder-El-Terminalo: A Fine-Tuned Shell Command Generator},
year = {2026},
url = {https://huggingface.co/albinab/Qwen-0.5B-Coder-El-Terminalo},
note = {Fine-tuned from Qwen2.5-Coder-0.5B-Instruct using LoRA}
}