enpisi-coder

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).

Layout

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 support matrix

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.

Why hf/ is empty

The existing adapters were trained with MLX on a 4-bit quantized base (mlx-community/Qwen3.5-0.8B-4bit). That blocks a straightforward port:

  • The 0.8B SFT checkpoint contains 133 non-LoRA tensors alongside its 248 LoRA tensors. Those extra tensors are 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.
  • There are no 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.

Training 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.

Why gguf/ is blocked

Two independent gaps, both real:

  1. No 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.
  2. The converter requires a base-model GGUF. It needs the architecture metadata to map tensor names β€” it does not read an HF 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.

Available MLX adapters

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 numbers

  • Data: 282 traces with composite >= 0.7 from a 5-judge ensemble.
  • Training: 3 epochs planned, batch 1, max length 256, lr 2e-5, via npcpy.ft.run_sft.
  • Stopped early: Metal OOM at the start of epoch 3; shipped weights are the end-of-epoch-2 checkpoint (iteration 282).
  • Eval (single-turn, n=30): base 0.123 β†’ adapter 0.309 composite (+0.186; 28 up / 1 down / 1 tie).
  • Eval (agent-loop, n=10): base 4/10 pass β†’ adapter 5/10 pass, fewer turns on shell / system / git / text tasks.

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.

Usage

MLX (macOS / Apple Silicon)

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_model resolves an HF repo id by requiring an adapters/<name>/ prefix and raises No adapters/ subfolder found otherwise. Neither this repo's layout nor the original pre-restructure one satisfies that. A local path skips the prefix logic. See hf/qwen3.5-0.8b/README.md for the full explanation.

The subdirectory must point at a specific run β€” the repo root holds several adapters and is not itself loadable.

HF / peft (once 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.

Corrected from the previous card

  • License: previously 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.
  • Usage snippet: the old root card showed 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.
  • Structure diagram: the old one described 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 metadata: the old root card declared no base_model, so the Hub could not link the adapter to Qwen/Qwen3.5-0.8B.

Ecosystem

  • npcpy β€” training toolkit
  • npcsh β€” NPC shell
Downloads last month
-
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for npc-worldwide/enpisi-coder

Adapter
(3)
this model