Instructions to use mecha-org/linux-command-generator-llama3.2-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mecha-org/linux-command-generator-llama3.2-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mecha-org/linux-command-generator-llama3.2-1b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mecha-org/linux-command-generator-llama3.2-1b", dtype="auto") - llama-cpp-python
How to use mecha-org/linux-command-generator-llama3.2-1b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="mecha-org/linux-command-generator-llama3.2-1b", filename="unsloth.F16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use mecha-org/linux-command-generator-llama3.2-1b with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mecha-org/linux-command-generator-llama3.2-1b:F16 # Run inference directly in the terminal: llama-cli -hf mecha-org/linux-command-generator-llama3.2-1b:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf mecha-org/linux-command-generator-llama3.2-1b:F16 # Run inference directly in the terminal: llama-cli -hf mecha-org/linux-command-generator-llama3.2-1b:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf mecha-org/linux-command-generator-llama3.2-1b:F16 # Run inference directly in the terminal: ./llama-cli -hf mecha-org/linux-command-generator-llama3.2-1b:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf mecha-org/linux-command-generator-llama3.2-1b:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf mecha-org/linux-command-generator-llama3.2-1b:F16
Use Docker
docker model run hf.co/mecha-org/linux-command-generator-llama3.2-1b:F16
- LM Studio
- Jan
- vLLM
How to use mecha-org/linux-command-generator-llama3.2-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mecha-org/linux-command-generator-llama3.2-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mecha-org/linux-command-generator-llama3.2-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mecha-org/linux-command-generator-llama3.2-1b:F16
- SGLang
How to use mecha-org/linux-command-generator-llama3.2-1b 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 "mecha-org/linux-command-generator-llama3.2-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mecha-org/linux-command-generator-llama3.2-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mecha-org/linux-command-generator-llama3.2-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mecha-org/linux-command-generator-llama3.2-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use mecha-org/linux-command-generator-llama3.2-1b with Ollama:
ollama run hf.co/mecha-org/linux-command-generator-llama3.2-1b:F16
- Unsloth Studio new
How to use mecha-org/linux-command-generator-llama3.2-1b 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 mecha-org/linux-command-generator-llama3.2-1b 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 mecha-org/linux-command-generator-llama3.2-1b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for mecha-org/linux-command-generator-llama3.2-1b to start chatting
- Pi new
How to use mecha-org/linux-command-generator-llama3.2-1b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mecha-org/linux-command-generator-llama3.2-1b:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mecha-org/linux-command-generator-llama3.2-1b:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mecha-org/linux-command-generator-llama3.2-1b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf mecha-org/linux-command-generator-llama3.2-1b:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mecha-org/linux-command-generator-llama3.2-1b:F16
Run Hermes
hermes
- Docker Model Runner
How to use mecha-org/linux-command-generator-llama3.2-1b with Docker Model Runner:
docker model run hf.co/mecha-org/linux-command-generator-llama3.2-1b:F16
- Lemonade
How to use mecha-org/linux-command-generator-llama3.2-1b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mecha-org/linux-command-generator-llama3.2-1b:F16
Run and chat with the model
lemonade run user.linux-command-generator-llama3.2-1b-F16
List all available models
lemonade list
mecha-org/linux-command-generator-llama3.2-1b
Natural language → Linux command. A compact Llama 3.2 1B Instruct model fine‑tuned (LoRA) to turn plain‑English requests into correct shell commands.
Video Demonstration of the model running on the Mecha Comet
For more information of the Mecha Comet, our pocket little handheld computer - click hereTL;DR
- Base:
unsloth/Llama-3.2-1B-Instruct - Method: LoRA (r=16, alpha=16, dropout=0)
- Context: 2048 tokens
- Data: 8,669 pairs across 11 categories
- Use cases: quick command lookup, learning CLI, automation
Run with Ollama (baby steps)
Install Ollama: see
https://ollama.com/download.Verify install:
ollama --version
- Run the model interactively:
ollama run mecha-org/linux-command-generator-llama3.2-1b
Then type a request, e.g.:
- "List all files in the current directory with detailed information"
- "Compress the file data.txt using bzip2"
- "Find all .py files in the current directory and subdirectories"
Press Ctrl+C to exit.
- One‑off (non‑interactive):
ollama run mecha-org/linux-command-generator-llama3.2-1b -p "Display the first 5 lines of access.log"
# Expected: head -n 5 access.log
- Get command‑only answers (when needed):
ollama run mecha-org/linux-command-generator-llama3.2-1b -p "Output only the command with no explanation. Show system information including kernel version"
# Expected: uname -a
Use a local GGUF with Ollama (fallback)
If you have model.gguf, put it next to a Modelfile:
FROM ./model.gguf
PARAMETER temperature 0.2
PARAMETER top_p 0.9
PARAMETER num_ctx 2048
SYSTEM You are a Linux command generator. Output only the command with no explanation.
TEMPLATE {{ .Prompt }}
Create and run:
ollama create linux-cmd-gen -f Modelfile
ollama run linux-cmd-gen -p "Find all .py files recursively"
# Expected: find . -name "*.py"
Other ways to use (optional)
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "mecha-org/linux-command-generator-llama3.2-1b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16 if torch.cuda.is_available() else None)
def generate_command(description: str) -> str:
messages = [{"role": "user", "content": description}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
if torch.cuda.is_available():
inputs = inputs.to(model.device)
model = model.to("cuda")
outputs = model.generate(input_ids=inputs, max_new_tokens=64)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generate_command("List all files in the current directory with detailed information"))
# -> ls -la
Unsloth
from unsloth import FastLanguageModel
model_id = "mecha-org/linux-command-generator-llama3.2-1b"
model, tokenizer = FastLanguageModel.from_pretrained(model_name=model_id, max_seq_length=2048)
FastLanguageModel.for_inference(model)
msgs = [{"role": "user", "content": "Compress the file data.txt using bzip2"}]
inputs = tokenizer.apply_chat_template(msgs, tokenize=True, add_generation_prompt=True, return_tensors="pt")
output = model.generate(input_ids=inputs, max_new_tokens=32)
print(tokenizer.decode(output[0], skip_special_tokens=True))
# -> bzip2 data.txt
Example prompts → commands
- "Show system information including kernel version" →
uname -a - "Find all .py files in the current directory and subdirectories" →
find . -name "*.py" - "Display the first 5 lines of access.log" →
head -n 5 access.log - "Change permissions of script.sh to make it executable for owner" →
chmod +x script.sh - "Create a tar archive backup.tar containing all files in the documents folder" →
tar -cf backup.tar documents/
Dataset (overview)
8,669 input→command pairs across:
- Compression & Archiving: bzip2, gzip, tar, zip
- File & Directory: cd, cp, find, ls, mkdir, mv, pwd, rm, rmdir, touch
- Permissions & Ownership: chgrp, chmod, chown
- Viewing & Editing: cat, echo, head, less, tail, vim
- Networking: curl, dig, host, ifconfig, ip, netstat, ping, ssh, wget
- Package mgmt: apt, dpkg
- Process mgmt: kill, killall, nice, pkill, renice
- Search & Filter: awk, grep, locate, sed
- System info/monitoring: df, du, free, top, uname
- User/group: useradd, usermod, groupadd, passwd, sudo
- Misc/system control: cron, systemctl, tmux, screen, service
Format:
{"input": "Describe what you want to do", "output": "linux_command_here"}
Training details
- Base:
unsloth/Llama-3.2-1B-Instruct - LoRA on attention + MLP projections:
- r=16, lora_alpha=16, lora_dropout=0
- target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
- Max sequence length: 2048
- SFT on responses only (TRL SFTTrainer), Unsloth-optimized
- Example hparams: per‑device batch 2, grad accum 4, epochs 3, lr 2e‑4
- Reference: Tesla P100 16GB (~45 minutes), ~2.8GB VRAM (adapters)
Safety and responsible use
- Always inspect commands before executing.
- Avoid destructive operations unless you fully understand consequences.
- For apps, add denylists and validations (e.g., block
rm -rf /,mkfs,dd).
Notes on GGUF
- Works with
llama.cppand Ollama. - Typical memory (approx.): q4_k_s ~600MB, q4_k_m ~700MB, q8_0 ~1.1GB, f16 ~2.2GB.
License
Derived from Meta Llama 3.2. Use must comply with the base model license. Check your deployment context for any additional constraints.
Citation
@software{hrsvrn_linux_command_generator_llama32_1b,
author = {Harshvardhan Vatsa},
title = {Linux Command Generator (Llama 3.2 1B)},
year = {2025},
url = {https://huggingface.co/mecha-org/linux-command-generator-llama3.2-1b}
}
Acknowledgements
- Base:
unsloth/Llama-3.2-1B-Instruct - Libraries:
unsloth,transformers,trl,accelerate,bitsandbytes
- Downloads last month
- 127
Model tree for mecha-org/linux-command-generator-llama3.2-1b
Base model
meta-llama/Llama-3.2-1B-Instruct