Skip to content

Back to the catalog

ThorOdinson246/whatisit-nl2sh
github.comrepo

ThorOdinson246/whatisit-nl2sh

whatisit is a CLI that turns plain-English requests into shell commands using a 941 MB Q4_K_M GGUF model (LoRA fine-tune of Qwen2.5-Coder-1.5B-Instruct) served locally via llama.cpp on CPU. It can optionally use any OpenAI-compatible endpoint. It includes a denylist safety checker (DANGER/CAUTION) with 477 regression cases. On the 300-task InterCode-ALFA benchmark (NL2SH, NAACL 2025) the fine-tune scores 0.620 vs 0.540 for the base (McNemar p=0.004), roughly equal to the untuned 7B and about 11 points behind GPT-4o. A 3B variant is also available, and the author documents the training recipe, data mix and limits.

TL;DR Offline CPU-only NL-to-shell CLI backed by a LoRA-tuned Qwen2.5-Coder-1.5B GGUF via llama.cpp, with a safety checker and InterCode-ALFA results.
Document

What it claims

A CLI that turns a plain-English request into a single shell command. It runs locally on CPU with no GPU, answers in about a second, and by default sends nothing off the machine, so it works offline. The fine-tuned 1.5B model scores 0.620 on InterCode-ALFA. The author's own reading of that number is "roughly a 7B", not "beats a 7B".

How it works

The model was built in four steps:

  1. LoRA fine-tune of Qwen2.5-Coder-1.5B-Instruct.
  2. Merge into the base weights in bf16.
  3. Convert to f16 GGUF.
  4. Quantize to Q4_K_M.

The training pool has 125,770 rows. The full dataset is "releasing soon", so you cannot reproduce the training yet.

The first call starts a resident llama-server, so later calls skip model loading. Decoding is greedy at temperature 0, which makes output deterministic: the same request always gives the same command. Every generated command goes through a safety checker before it is printed.

flowchart LR
  R[English request] --> M{Mode}
  M -->|default| L[Local llama-server]
  M -->|opt-in, stderr warning| O[OpenAI-compatible endpoint]
  L --> S{Denylist checker}
  O --> S
  S -->|DANGER| X[Refused, not placed anywhere]
  S -->|CAUTION| W[Printed with warning]
  S -->|clean| P[Printed / prefilled]

Evidence

The benchmark is InterCode-ALFA, 300 tasks, pass or fail per task. It runs each command in a container and diffs the filesystem and stdout against a reference command.

ComparisonResultStatistics
Fine-tune vs. same base0.540 → 0.620+0.080 paired, exact McNemar p = 0.004
Fine-tune vs. untuned 7BΔ = 0.00795% CI −0.050 to +0.063 (not resolvable)
Fine-tune vs. GPT-4oGPT-4o about 11 points ahead—

The GPT-4o figure comes from the benchmark authors. The author measured every other row with the unmodified upstream scorer using these settings: temperature 0, max_tokens=64, embedding heuristic threshold 0.75, icalfa 0.3.6.

A 3B variant uses the same recipe and data. The page offers it for accuracy over speed but gives no score for it in the text.

How to use it

Requirements are Python 3.9+ on Linux or macOS. The CLI has no dependencies of its own.

pipx install whatisit
whatisit setup

setup shows download sizes and asks before fetching anything. On glibc older than 2.34 it picks a compatibility llama.cpp build.

Manual install:

hf download ThorOdinson246/nl2sh-1.5b-Q4_K_M nl2sh-1.5b-Q4_K_M.gguf --local-dir .
whatisit setup --model ./nl2sh-1.5b-Q4_K_M.gguf --bin-dir /path/to/llama.cpp/bin
whatisit doctor

Nix install:

nix run github:ThorOdinson246/whatisit-nl2sh -- setup

Usage modes:

cd "$(whatisit -q the directory holding the largest log file)"
whatisit -e remove every .pyc file under this tree   # review, then run
whatisit -p remove every .pyc file under this tree   # edit before running
eval "$(whatisit shell-init)"                         # prefill next prompt (zsh); bash puts it in history

Other useful commands and settings:

  • Switch model size: whatisit setup --size 3b then whatisit stop.
  • Free RAM when idle: whatisit config --set idle_timeout=300. The default is 0, meaning the server never unloads.
  • Use a remote endpoint: whatisit config --set openai_base_url=... openai_model=... (openai_model is required). Put the key in WHATISIT_OPENAI_API_KEY.
  • Daily network call: the tool contacts pypi.org once a day for update checks. Your requests are not sent. Disable with update_check=false.

Licensing: the code is Apache-2.0, and the base model is also Apache-2.0. The training data includes tldr-pages content under CC-BY-4.0, which needs attribution.

Limits

  • Single command only. It is single-turn with no shell state, and output is capped at 64 tokens, so it cannot write scripts.
  • Narrow evaluation. English only, measured on one 300-task benchmark.
  • The safety checker is a denylist, not a sandbox. Its rules come only from bad commands this model produced during testing. It has 477 regression cases running in CI on Python 3.9–3.13 across Linux, macOS and Windows. The author says to read every command before running it.
  • Platform gaps. -p does not work on Windows. Upstream llama.cpp binaries need glibc 2.34 or newer.
  • Still in development. The author says it will get things wrong and assumes you can spot a bad command.

Organisations named here

  • Qwen
  • OpenAI
  • tldr-pages
  • Hugging Face
  • InterCode-ALFA
  • lydorianP
  • NL2SH
  • Ollama
  • ThorOdinson246

Technologies named here

  • nl2sh-1.5b-Q4_K_M
  • whatisit
  • nl2sh-3b-Q4_K_M
  • llama.cpp
  • Qwen2.5-Coder-1.5B-Instruct
  • huggingface_hub
  • pipx
  • Qwen2.5-Coder 7B
  • Nix flake
  • GPT-4o
  • Ollama
  • InterCode-ALFA 0.3.6
  • pytest
  • tldr-pages
  • GGUF
  • LoRA
  • Qwen
  • Hugging Face
  • OpenAI API
  • Linux
  • macOS
  • Nix
  • Python

Techniques named here

  • LoRA fine-tuning with merge and GGUF quantization
  • Greedy decoding at temperature 0
  • Denylist safety checker
  • Resident server with idle timeout
  • Exact McNemar test