Instructions to use NickIBrody/qwen-linux-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use NickIBrody/qwen-linux-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="NickIBrody/qwen-linux-gguf", filename="Qwen2.5-3B-Instruct.Q4_K_M.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 NickIBrody/qwen-linux-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf NickIBrody/qwen-linux-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf NickIBrody/qwen-linux-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf NickIBrody/qwen-linux-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf NickIBrody/qwen-linux-gguf:Q4_K_M
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 NickIBrody/qwen-linux-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf NickIBrody/qwen-linux-gguf:Q4_K_M
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 NickIBrody/qwen-linux-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf NickIBrody/qwen-linux-gguf:Q4_K_M
Use Docker
docker model run hf.co/NickIBrody/qwen-linux-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use NickIBrody/qwen-linux-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NickIBrody/qwen-linux-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NickIBrody/qwen-linux-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NickIBrody/qwen-linux-gguf:Q4_K_M
- Ollama
How to use NickIBrody/qwen-linux-gguf with Ollama:
ollama run hf.co/NickIBrody/qwen-linux-gguf:Q4_K_M
- Unsloth Studio new
How to use NickIBrody/qwen-linux-gguf 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 NickIBrody/qwen-linux-gguf 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 NickIBrody/qwen-linux-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for NickIBrody/qwen-linux-gguf to start chatting
- Pi new
How to use NickIBrody/qwen-linux-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf NickIBrody/qwen-linux-gguf:Q4_K_M
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": "NickIBrody/qwen-linux-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use NickIBrody/qwen-linux-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf NickIBrody/qwen-linux-gguf:Q4_K_M
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 NickIBrody/qwen-linux-gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use NickIBrody/qwen-linux-gguf with Docker Model Runner:
docker model run hf.co/NickIBrody/qwen-linux-gguf:Q4_K_M
- Lemonade
How to use NickIBrody/qwen-linux-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull NickIBrody/qwen-linux-gguf:Q4_K_M
Run and chat with the model
lemonade run user.qwen-linux-gguf-Q4_K_M
List all available models
lemonade list
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,23 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
---
|
| 8 |
|
| 9 |
-
#
|
| 10 |
|
| 11 |
-
|
| 12 |
|
| 13 |
-
|
| 14 |
-
-
|
| 15 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
##
|
| 18 |
-
- `Qwen2.5-3B-Instruct.Q4_K_M.gguf`
|
| 19 |
|
| 20 |
-
|
| 21 |
-
An Ollama Modelfile is included for easy deployment.
|
| 22 |
-
This was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth)
|
| 23 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
| 1 |
+
# Qwen2.5-3B Linux Assistant
|
| 2 |
+
|
| 3 |
+
A fine-tuned version of [Qwen2.5-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-3B-Instruct) trained to act as a Linux/Shell command assistant. Given a natural language description, the model outputs the correct shell command.
|
| 4 |
+
|
| 5 |
+
Supports both **Russian** and **English** input.
|
| 6 |
+
|
| 7 |
---
|
| 8 |
+
|
| 9 |
+
## Model Details
|
| 10 |
+
|
| 11 |
+
| Property | Value |
|
| 12 |
+
|---|---|
|
| 13 |
+
| Base model | Qwen2.5-3B-Instruct |
|
| 14 |
+
| Fine-tuning method | QLoRA (LoRA r=16, alpha=16) |
|
| 15 |
+
| Training steps | ~1700 |
|
| 16 |
+
| Epochs | 3 |
|
| 17 |
+
| Final loss | ~0.28 |
|
| 18 |
+
| Dataset size | ~4500 examples |
|
| 19 |
+
| Languages | Russian, English |
|
| 20 |
+
| Framework | Unsloth + TRL |
|
| 21 |
+
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
## Usage
|
| 25 |
+
|
| 26 |
+
### Ollama (recommended)
|
| 27 |
+
```bash
|
| 28 |
+
ollama run hf.co/NickIBrody/qwen-linux-gguf
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
### llama.cpp
|
| 32 |
+
```bash
|
| 33 |
+
llama-cli -hf NickIBrody/qwen-linux-gguf --jinja
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
### Python (transformers)
|
| 37 |
+
```python
|
| 38 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 39 |
+
import torch
|
| 40 |
+
|
| 41 |
+
model_id = "NickIBrody/qwen-linux"
|
| 42 |
+
tok = AutoTokenizer.from_pretrained(model_id)
|
| 43 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
| 44 |
+
|
| 45 |
+
messages = [
|
| 46 |
+
{"role": "system", "content": "You are a Linux assistant. Reply only with the shell command, no explanations."},
|
| 47 |
+
{"role": "user", "content": "show top 5 processes by memory usage"},
|
| 48 |
+
]
|
| 49 |
+
inp = tok.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
|
| 50 |
+
out = model.generate(inp, max_new_tokens=128, temperature=0.3)
|
| 51 |
+
print(tok.decode(out[0][inp.shape[1]:], skip_special_tokens=True))
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## Examples
|
| 57 |
+
|
| 58 |
+
| Input | Output |
|
| 59 |
+
|---|---|
|
| 60 |
+
| показажи топ 5 процессов по памяти | `ps aux --sort=-%mem \| head -n 5` |
|
| 61 |
+
| где я нахожусь в терминале | `pwd` |
|
| 62 |
+
| compress file data.txt with bzip2 | `bzip2 data.txt` |
|
| 63 |
+
| show disk usage in human readable format | `df -h` |
|
| 64 |
+
| find all .log files modified in last 7 days | `find / -name "*.log" -mtime -7` |
|
| 65 |
+
| kill process by name nginx | `pkill nginx` |
|
| 66 |
+
| show open ports | `ss -tulnp` |
|
| 67 |
|
| 68 |
---
|
| 69 |
|
| 70 |
+
## Dataset
|
| 71 |
|
| 72 |
+
Training data: [NickIBrody/linux-commands-ru-en](https://huggingface.co/datasets/NickIBrody/linux-commands-ru-en)
|
| 73 |
|
| 74 |
+
~4500 shell command examples in Russian and English, covering:
|
| 75 |
+
- File system navigation and management
|
| 76 |
+
- Process management
|
| 77 |
+
- Networking
|
| 78 |
+
- Archive and compression
|
| 79 |
+
- System monitoring
|
| 80 |
+
- Package management
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
+
|
| 84 |
+
## Training Code
|
| 85 |
+
|
| 86 |
+
```python
|
| 87 |
+
from unsloth import FastLanguageModel
|
| 88 |
+
from unsloth.chat_templates import get_chat_template
|
| 89 |
+
from datasets import load_dataset
|
| 90 |
+
from trl import SFTTrainer
|
| 91 |
+
from transformers import TrainingArguments
|
| 92 |
+
|
| 93 |
+
model, tok = FastLanguageModel.from_pretrained(
|
| 94 |
+
"unsloth/Qwen2.5-3B-Instruct-bnb-4bit",
|
| 95 |
+
max_seq_length=2048,
|
| 96 |
+
load_in_4bit=True
|
| 97 |
+
)
|
| 98 |
+
|
| 99 |
+
model = FastLanguageModel.get_peft_model(
|
| 100 |
+
model, r=16, lora_alpha=16,
|
| 101 |
+
target_modules=["q_proj","k_proj","v_proj","o_proj","gate_proj","up_proj","down_proj"]
|
| 102 |
+
)
|
| 103 |
+
|
| 104 |
+
tok = get_chat_template(tok, chat_template="qwen-2.5")
|
| 105 |
+
|
| 106 |
+
ds = load_dataset("NickIBrody/linux-commands-ru-en", split="train")
|
| 107 |
+
ds = ds.map(lambda x: {"text": tok.apply_chat_template(x["messages"], tokenize=False)})
|
| 108 |
+
|
| 109 |
+
SFTTrainer(
|
| 110 |
+
model=model,
|
| 111 |
+
tokenizer=tok,
|
| 112 |
+
train_dataset=ds,
|
| 113 |
+
dataset_text_field="text",
|
| 114 |
+
max_seq_length=2048,
|
| 115 |
+
args=TrainingArguments(
|
| 116 |
+
per_device_train_batch_size=2,
|
| 117 |
+
gradient_accumulation_steps=4,
|
| 118 |
+
num_train_epochs=3,
|
| 119 |
+
learning_rate=2e-4,
|
| 120 |
+
fp16=True,
|
| 121 |
+
logging_steps=10,
|
| 122 |
+
output_dir="out",
|
| 123 |
+
optim="adamw_8bit"
|
| 124 |
+
)
|
| 125 |
+
).train()
|
| 126 |
+
|
| 127 |
+
model.save_pretrained_gguf("qwen-linux", tok, quantization_method="q4_k_m")
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## Limitations
|
| 133 |
+
|
| 134 |
+
- Designed for shell commands only, not general conversation
|
| 135 |
+
- May struggle with highly complex multi-step scripts
|
| 136 |
+
- Best results with clear, specific prompts
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
|
| 140 |
+
## License
|
|
|
|
| 141 |
|
| 142 |
+
Apache 2.0
|
|
|
|
|
|
|
|
|