Instructions to use petyussz/shell-assistant-0.5b-v8-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use petyussz/shell-assistant-0.5b-v8-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="petyussz/shell-assistant-0.5b-v8-it")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("petyussz/shell-assistant-0.5b-v8-it", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use petyussz/shell-assistant-0.5b-v8-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "petyussz/shell-assistant-0.5b-v8-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "petyussz/shell-assistant-0.5b-v8-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/petyussz/shell-assistant-0.5b-v8-it
- SGLang
How to use petyussz/shell-assistant-0.5b-v8-it with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "petyussz/shell-assistant-0.5b-v8-it" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "petyussz/shell-assistant-0.5b-v8-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "petyussz/shell-assistant-0.5b-v8-it" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "petyussz/shell-assistant-0.5b-v8-it", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use petyussz/shell-assistant-0.5b-v8-it with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for petyussz/shell-assistant-0.5b-v8-it to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for petyussz/shell-assistant-0.5b-v8-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for petyussz/shell-assistant-0.5b-v8-it to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="petyussz/shell-assistant-0.5b-v8-it", max_seq_length=2048, ) - Docker Model Runner
How to use petyussz/shell-assistant-0.5b-v8-it with Docker Model Runner:
docker model run hf.co/petyussz/shell-assistant-0.5b-v8-it
from transformers import AutoModelForCausalLM, AutoTokenizer
import json
model_name = "petyussz/shell-assistant-0.5b-v8-it"
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "install git"
messages = [
{"role": "system", "content": "You are a helpful Linux assistant. Answer in JSON."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=128
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
π§ Qwen2.5-0.5B-Instruct - Linux Command Assistant
Qwen2.5-0.5B-Linux-Assistant is a lightweight, fine-tuned model designed to act as a safe interface between natural language and the Linux terminal.
Unlike standard coding models that output markdown blocks or explanations, this model is fine-tuned to output strict, parsable JSON. It is optimized for use with wrapper scripts (Bash/Python) to create intelligent CLI assistants.
π Model Capabilities
- Natural Language to Shell: Converts "update my system" to
sudo apt update && sudo apt upgrade -y. - Risk Assessment: Classifies commands by risk level (
low,medium,high,critical). - Sudo Detection: Intelligently detects if a command requires root privileges.
- Safety Guardrails: Refuses to generate destructive commands (e.g., wiping disks) by setting the intent to
refuse.
π Output Schema
The model always outputs a single JSON object with the following fields:
{
"intent": "string", // E.g., "package_install", "file_move", "refuse"
"cmd": "string", // The executable Linux command (empty if refused)
"sudo": boolean, // true if 'sudo' is required
"risk": "string" // "low", "medium", "high", or "critical"
}
Examples
| User Input | Model Output (JSON) |
|---|---|
| "Make the file script.sh executable" | {"intent":"CMD_EXEC","cmd":"chmod +x script.sh","sudo":false,"risk":"low"} |
| "Restart the mysql service" | {"intent":"service_restart","cmd":"systemctl restart mysql","sudo":true,"risk":"medium"} |
| "Format my full disk" | {"intent":"refuse","cmd":"","sudo":false,"risk":"critical"} |
| "Check current date" | {"intent":"system_info","cmd":"date","sudo":false,"risk":"low"} |