Downloads · 30 days
33
7% of all-time downloads
DiyRex/Llama-3.2-1B-nl2bash
Llama-3.2-1B-nl2bash is a text generation model from DiyRex. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as llama3.2.
A fine-tuned version of mlx-community/Llama-3.2-1B-Instruct-4bit for converting natural language descriptions into bash commands.
Downloads · 30 days
33
7% of all-time downloads
All-time downloads
454
Public
Parameters
1.2B
712 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors695 MB · 98%
How the weights are stored.
U321.2B · 100%
From the Hugging Face model README
A fine-tuned version of mlx-community/Llama-3.2-1B-Instruct-4bit for converting natural language descriptions into bash commands.
Fine-tuned using LoRA via mlx-lm on Apple Silicon.
| Property | Value |
|---|---|
| Base model | Llama-3.2-1B-Instruct (4-bit) |
| Method | LoRA (rank 8, 16 layers) |
| Dataset | devinxx/nl2bash-combined |
| Training examples | 27,748 |
| Iterations | 2,000 |
| Learning rate | 1e-4 (cosine decay) |
| Hardware | Apple Silicon (MLX) |
| Peak memory | ~2.9 GB |
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("devinxx/Llama-3.2-1B-nl2bash")
messages = [
{"role": "system", "content": "You are a bash expert. Convert the user's natural language description into a single bash command. Output only the bash command, no explanation."},
{"role": "user", "content": "find all python files modified in the last 7 days"},
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=128, verbose=False)
print(response)
# find . -name "*.py" -mtime -7
mlx_lm.generate \
--model devinxx/Llama-3.2-1B-nl2bash \
--prompt "find all log files larger than 100MB"
| Natural Language | Command |
|---|---|
| find all python files modified in the last week | find . -name "*.py" -mtime -7 |
| list all running processes sorted by memory | ps aux --sort=-%mem |
| count lines in all csv files recursively | find . -name "*.csv" | xargs wc -l |
| show disk usage of current directory sorted by size | du -sh * | sort -rh |
| compress a folder to tar.gz | tar -czf archive.tar.gz folder/ |
Training data: devinxx/nl2bash-combined
Combined from:
Llama 3.2 Community License — see Meta's license terms.