Instructions to use mahsery/howdo-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use mahsery/howdo-4b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf mahsery/howdo-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf mahsery/howdo-4b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf mahsery/howdo-4b:Q4_K_M # Run inference directly in the terminal: llama cli -hf mahsery/howdo-4b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf mahsery/howdo-4b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf mahsery/howdo-4b:Q4_K_M
Use Docker
docker model run hf.co/mahsery/howdo-4b:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use mahsery/howdo-4b with Ollama:
ollama run hf.co/mahsery/howdo-4b:Q4_K_M
- Unsloth Desktop
- Pi
How to use mahsery/howdo-4b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mahsery/howdo-4b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mahsery/howdo-4b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use mahsery/howdo-4b with Docker Model Runner:
docker model run hf.co/mahsery/howdo-4b:Q4_K_M
- Lemonade
How to use mahsery/howdo-4b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull mahsery/howdo-4b:Q4_K_M
Run and chat with the model
lemonade run user.howdo-4b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use mahsery/howdo-4b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mahsery/howdo-4b: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:9931/v1 hermes config set model.default mahsery/howdo-4b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mahsery/howdo-4b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf mahsery/howdo-4b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "mahsery/howdo-4b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- Modelfile +13 -0
- README.md +76 -0
- 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
|