Configuration Parsing Warning:In adapter_config.json: "peft.task_type" must be a string

Inkling-2-Mini-Cyber-LoRA

The PEFT LoRA adapter behind sergiogmn/Inkling-2-Mini-Cyber-GGUF. It touches only self_attn.o_proj on layers 4–23 of thinkingmachines/Inkling-2-Mini. Use it to merge the Cyber edit into the full-precision base, for example before a QLoRA fine-tune of your own.

The same files are in the adapter/ folder of the GGUF repo. This repo adds the splice metadata.

Provenance

Base model thinkingmachines/Inkling-2-Mini @ c9d028302cd0f035fdf8e7e91f089a4ce94d2195
Base weights SHA-256 65e60f51aa1284d4fb022584908c315270334d991828bb774af60584523539d1 (unchanged since the first upload)
adapter_model.safetensors SHA-256 537fa0d986d132544fbe3444d5a97b7f93ae29d60204872b1d73669b0122bce7
Checkpoint epoch 2 of 2, 140 steps (train_manifest.json)
LoRA r=16, lora_alpha=32, no rsLoRA, no DoRA, 40 F32 tensors, 1,720,320 params
Targets model.language_model.layers.{4..23}.self_attn.o_proj.linear

Tensor keys follow the transformers inkling2_loop module names:

base_model.model.model.language_model.layers.{4..23}.self_attn.o_proj.linear.lora_A.weight  [16, 3072]
base_model.model.model.language_model.layers.{4..23}.self_attn.o_proj.linear.lora_B.weight  [2304, 16]

In the raw checkpoint these modules are model.llm.layers.N.attn.wo_ud.weight (BF16, [2304, 3072]). In GGUF they are blk.N.attn_output.weight.

Scale: the GGUF is not a plain PEFT merge

The GGUF was spliced with apply_lora_gguf.py --scale 1.55, which computes

W' = W + 1.55 * (lora_alpha / r) * (B @ A) = W + 3.1 * (B @ A)

Standard PEFT scaling is lora_alpha / r = 2.0. A plain merge_and_unload() therefore gives the weaker scale-1.0 model from the sweep in the GGUF card (79/104 AdvBench compliance instead of 99/104). To match the released GGUF, set the scale to 1.55 before merging:

import torch
from transformers import AutoModelForMultimodalLM
from peft import PeftModel
from peft.tuners.lora import LoraLayer

base = AutoModelForMultimodalLM.from_pretrained(
    "thinkingmachines/Inkling-2-Mini",
    revision="c9d028302cd0f035fdf8e7e91f089a4ce94d2195",
    dtype=torch.bfloat16,
)
model = PeftModel.from_pretrained(base, "sergiogmn/Inkling-2-Mini-Cyber-LoRA")
for m in model.modules():
    if isinstance(m, LoraLayer):
        m.set_scale("default", 1.55)  # scaling = 1.55 * 32/16 = 3.1
merged = model.merge_and_unload()
merged.save_pretrained("Inkling-2-Mini-Cyber-merged")

Loading needs a transformers release with inkling2_loop support. The adapter was trained with transformers 5.24 and PEFT 0.22.

Verification

  • Injecting the adapter into the base model with PEFT 0.22 (transformers 5.24) gives 40 LoRA parameters, all with weights, 0 unexpected keys and matching shapes.
  • Splice check: dequantizing stock ggml-org/Inkling-2-Mini-GGUF IQ4_NL blk.{4,10,23}.attn_output.weight, applying this adapter at scale 1.55 and re-quantizing to Q8_0 gives tensors byte-identical to Inkling-2-Mini-Cyber-IQ4_NL.gguf (GGUF repo revision 7e46c354). Scales 1.0 and 1.65, and the epoch-1 checkpoint, do not match.

splice_metadata.json has the same facts in machine-readable form.

License

Apache-2.0, same as the base model. The model has reduced refusals on offensive-security prompts. See the GGUF card for its intended use and benchmarks.

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

Model tree for sergiogmn/Inkling-2-Mini-Cyber-LoRA

Adapter
(43)
this model