LoRA adapters for npcsh agentic command execution — tool calling, shell command generation, and file-operation reasoning.
Trained on judge-rated npcsh benchmark traces
(npc-worldwide/npcsh-traces,
npc-worldwide/enpisi-coder-data).
Weights are grouped by target format first, then base model, then run. Format is in
every path on purpose: the MLX adapters are Apple-Silicon-only and cannot be loaded by
transformers/peft, and GGUF is not a training format in either case.
mlx/ # Apple Silicon (MLX). Requires macOS/arm64 + mlx_lm.
qwen3.5-0.8b/
sft-recent/ # best-scoring MLX adapter
smoke/
legacy-unnamed/
qwen3.5-2b/
v1/
v2/
hf/ # PyTorch / transformers + peft (CUDA or CPU). Cross-platform.
qwen3.5-0.8b/
qwen3.5-2b/
gguf/ # llama.cpp. Inference only, quantized.
qwen3.5-0.8b/
qwen3.5-2b/
| Format | Status | Consumed by | Notes |
|---|---|---|---|
mlx/* |
Available (3 runs) | mlx_lm on macOS/arm64 |
QLoRA onto a 4-bit base. Not loadable on Linux/CUDA. |
hf/* |
Ready to train | transformers + peft |
No weights yet. train_hf_lora.py is in place; needs a CUDA GPU. |
gguf/* |
Blocked | llama.cpp |
Requires a trained hf/ adapter first. |
| GGUF (full model) | Available upstream | llama.cpp |
Use unsloth/Qwen3.5-0.8B-GGUF until our own conversion lands. |
hf/ is emptyThe existing adapters were trained with MLX on a 4-bit quantized base
(mlx-community/Qwen3.5-0.8B-4bit). That blocks a straightforward port:
linear_attn conv1d.weight, A_log, dt_bias and
norm.weight -- the gated-DeltaNet recurrent state, stored dequantized by MLX. They are
a quantization artifact, not trained weights.lora_b-only / merged weight equivalents usable by peft without the
exact 4-bit base restored.mlx_lm.fuse -- the normal MLX to HF path -- requires macOS on Apple Silicon.So hf/ is a retrain in PyTorch, not a conversion.
hf/hf/qwen3.5-0.8b/train_hf_lora.py performs the retrain. It reuses npcpy.ft.run_sft,
which has both MLX and PyTorch backends, so it is the same pipeline that produced the
existing adapters.
The data is already prepared: npc-worldwide/enpisi-coder-data/sft.csv is 282 rows of
(prompt, response) -- the same high-composite traces (judge composite >= 0.7) used for
mlx/qwen3.5-0.8b/sft-recent, so the two runs are directly comparable.
pip install -U "transformers>=5.0" peft accelerate trl datasets
python hf/qwen3.5-0.8b/train_hf_lora.py --device cuda
transformers >= 5 is required -- 4.x cannot parse model_type: qwen3_5 at all.
A CUDA GPU is required for a practical run. The script defaults to 846 steps
(282 examples x 3 epochs at batch size 1); a CPU-only run of that is measured in days.
To verify plumbing without training, use --device cpu --max-steps 2.
Base Qwen/Qwen3.5-0.8B is multimodal (Qwen3_5ForConditionalGeneration); for text-only
training, load the text class (Qwen3_5ForCausalLM) so vision weights are not pulled into
memory.
gguf/ is blockedTwo independent gaps, both real:
hf/ adapter to convert. llama.cpp ships convert_lora_to_gguf.py, which
consumes a peft-format LoRA directory. We do not have one yet.config.json alone. That base GGUF exists
upstream (unsloth/Qwen3.5-0.8B-GGUF), so this gap is solvable.Once hf/ exists, the pipeline is:
python convert_lora_to_gguf.py <hf-adapter-dir> \
--base <path-or-repo>/Qwen3.5-0.8B-Q8_0.gguf \
--outfile enpisi-coder-0.8b-lora.gguf --outtype f16
llama.cpp must be recent enough to include LLM_ARCH_QWEN35 support (qwen35 /
qwen35moe in src/llama-arch.cpp, Qwen3_5ForConditionalGeneration in
conversion/qwen.py). Older revisions cannot handle Qwen3.5 at all, so pull before
converting.
| Path | Base | LoRA | Tensors | Notes |
|---|---|---|---|---|
mlx/qwen3.5-0.8b/sft-recent |
mlx-community/Qwen3.5-0.8B-4bit |
r8 / alpha16, 16 layers, dropout .15 | 381 (248 LoRA + 133 state) | Best result. Stopped at end of epoch 2. |
mlx/qwen3.5-0.8b/smoke |
mlx-community/Qwen3.5-0.8B-4bit |
r16 / alpha16, 24 layers, dropout .10 | 505 | 60-iteration smoke run. |
mlx/qwen3.5-2b/v1 |
mlx-community/Qwen3.5-2B-4bit |
r8 / alpha16, 16 layers | 248 | Weights only, no card. |
mlx/qwen3.5-2b/v2 |
mlx-community/Qwen3.5-2B-4bit |
r8 / alpha16, 16 layers | 248 | Weights only, no card. |
mlx/qwen3.5-0.8b/legacy-unnamed |
mlx-community/Qwen3.5-0.8B-4bit |
r8 / alpha16, 16 layers | 248 | Bare mlx/adapters.safetensors from the original upload. Unnamed run; kept for provenance. |
sft-recent numberscomposite >= 0.7 from a 5-judge ensemble.npcpy.ft.run_sft.Caveats carried over from the original card: every task id was seen in training (no held-out split for the single-turn eval), and the agent-loop eval is n=10.
from npcpy.llm_funcs import get_llm_response
r = get_llm_response(
"Use list_files to list /tmp.",
model="/path/to/enpisi-coder/mlx/qwen3.5-0.8b/sft-recent", # local path
provider="mlx",
tools=tools, tool_map=tool_map,
auto_process_tool_calls=True,
)
Pass a local path, not the Hub repo id.
npcpy.ft.sft.load_sft_modelresolves an HF repo id by requiring anadapters/<name>/prefix and raisesNo adapters/ subfolder foundotherwise. Neither this repo's layout nor the original pre-restructure one satisfies that. A local path skips the prefix logic. Seehf/qwen3.5-0.8b/README.mdfor the full explanation.
The subdirectory must point at a specific run — the repo root holds several adapters and is not itself loadable.
hf/ is populated)from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen3.5-0.8B"
tok = AutoTokenizer.from_pretrained(base)
model = PeftModel.from_pretrained(
AutoModelForCausalLM.from_pretrained(base),
"npc-worldwide/enpisi-coder",
subfolder="hf/qwen3.5-0.8b",
)
Requires transformers >= 5 — version 4.54.1 cannot parse model_type: qwen3_5.
apache-2.0 at the root but mit in the adapter subfolder.
Base models are Apache-2.0, so this repo is Apache-2.0 throughout. The mit line
was wrong.load_sft_model("npc-worldwide/enpisi-coder") pointing at the repo root, which is not
a loadable adapter. Corrected to require a format+run subfolder.adapters/qwen3.5/{mlx,hf,gguf} with
everything marked "Planned", but weights actually sat in flat top-level dirs with no
format marker. Restructured as above.base_model, so the Hub could
not link the adapter to Qwen/Qwen3.5-0.8B.mlx/qwen3.5-0.8b/smoke/0000020_adapters.safetensors 44 MBmlx/qwen3.5-0.8b/smoke/0000040_adapters.safetensors 44 MBmlx/qwen3.5-0.8b/smoke/0000060_adapters.safetensors 44 MBmlx/qwen3.5-0.8b/smoke/adapters.safetensors 44 MBmlx/qwen3.5-2b/v1/adapters.safetensors 22 MBmlx/qwen3.5-2b/v2/adapters.safetensors 22 MBmlx/qwen3.5-0.8b/sft-recent/0000056_adapters.safetensors 15 MBmlx/qwen3.5-0.8b/sft-recent/0000112_adapters.safetensors 15 MBmlx/qwen3.5-0.8b/sft-recent/0000168_adapters.safetensors 15 MBmlx/qwen3.5-0.8b/sft-recent/0000224_adapters.safetensors 15 MBmlx/qwen3.5-0.8b/sft-recent/0000280_adapters.safetensors 15 MBmlx/qwen3.5-0.8b/sft-recent/adapters.safetensors 15 MBmlx/qwen3.5-0.8b/legacy-unnamed/adapters.safetensors 14 MBmlx-community/Qwen3.5-0.8B-4bit