mahsery commited on
Commit
c47de4d
·
verified ·
1 Parent(s): 9188d6f

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. Modelfile +13 -0
  3. README.md +76 -0
  4. howdo-4b-v4-Q4_K_M.gguf +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ howdo-4b-v4-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
Modelfile ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ./howdo-4b-v4-Q4_K_M.gguf
2
+
3
+ PARAMETER temperature 0.0
4
+ PARAMETER stop "<|im_end|>"
5
+ PARAMETER stop "<|endoftext|>"
6
+ PARAMETER stop "<|im_start|>"
7
+
8
+ TEMPLATE """<|im_start|>system
9
+ You are a shell command generator. Output exactly one line: a single POSIX/bash command that accomplishes the user's request. No prose, no markdown fences, no explanation.<|im_end|>
10
+ <|im_start|>user
11
+ {{ .Prompt }}<|im_end|>
12
+ <|im_start|>assistant
13
+ """
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - bash
5
+ - shell
6
+ - posix
7
+ - qwen2.5-coder
8
+ - text-to-command
9
+ - gguf
10
+ - llama.cpp
11
+ language:
12
+ - en
13
+ ---
14
+
15
+ # howdo-4b-v4
16
+
17
+ `howdo-4b-v4` is a 4.0B parameter language model fine-tuned for single-line natural-language-to-shell-command translation (POSIX and Bash).
18
+
19
+ The model is designed for fast, local inference with `llama.cpp` and powers the [`howdo`](https://github.com/Mahsery/howdo) CLI tool.
20
+
21
+ ## Model Description
22
+
23
+ - **Base Architecture**: Qwen2.5-Coder (4.0B parameters, vision weights pruned to minimize memory footprint and inference latency).
24
+ - **Target Task**: Converting natural language terminal requests into precise, single-line POSIX and Bash commands.
25
+ - **Quantization**: Q4_K_M GGUF (2.57 GB).
26
+ - **Context Length**: 512 tokens (optimized for fast single-turn terminal execution).
27
+ - **License**: Apache-2.0.
28
+
29
+ ## Training Details
30
+
31
+ The model was fine-tuned using LoRA (rank 32, alpha 64) on 69,000 verified command generation examples, with particular focus on:
32
+ - Scope boundary enforcement (e.g. non-recursive `-maxdepth 1` constraints).
33
+ - Option terminators for leading dashes (e.g. `--` for filenames beginning with `-`).
34
+ - Safe pipeline patterns (e.g. `find -print0 | xargs -0`).
35
+ - Flag arity and modern CLI replacements (`rg`, `fd`, `jq`, `sed`, `awk`, `tar`).
36
+
37
+ ## Usage
38
+
39
+ ### With howdo CLI
40
+
41
+ Install the `howdo` tool:
42
+
43
+ ```bash
44
+ git clone https://github.com/Mahsery/howdo.git
45
+ cd howdo
46
+ cargo install --path .
47
+ howdo setup
48
+ ```
49
+
50
+ Generate commands:
51
+
52
+ ```bash
53
+ howdo find all empty directories in the current folder only
54
+ ```
55
+
56
+ ### With llama.cpp
57
+
58
+ Run the GGUF model directly using `llama-cli`:
59
+
60
+ ```bash
61
+ llama-cli -m howdo-4b-v4-Q4_K_M.gguf \
62
+ -p "<|im_start|>system\nYou are a shell command generator. Output exactly one line: a single POSIX/bash command that accomplishes the user's request. No prose, no markdown fences, no explanation.<|im_end|>\n<|im_start|>user\nfind all empty directories in the current folder only<|im_end|>\n<|im_start|>assistant\n" \
63
+ -n 64 --temp 0.0
64
+ ```
65
+
66
+ ### Prompt Format
67
+
68
+ The model expects the ChatML format with a strict single-line instruction system prompt:
69
+
70
+ ```text
71
+ <|im_start|>system
72
+ You are a shell command generator. Output exactly one line: a single POSIX/bash command that accomplishes the user's request. No prose, no markdown fences, no explanation.<|im_end|>
73
+ <|im_start|>user
74
+ [Your request in plain English]<|im_end|>
75
+ <|im_start|>assistant
76
+ ```
howdo-4b-v4-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22e98ff445ce032a16977080d5877a2db33e3487cf03d8df27d26f6b31a4b134
3
+ size 2708803968