Downloads · 30 days
9
13% of all-time downloads
homerquan/mn-context-engine-lora-v2
mn-context-engine-lora-v2 is a text generation model from homerquan. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
mn-context-engine-lora-v2 is a PEFT LoRA adapter for HuggingFaceTB/SmolLM3-3B trained for operational context compression in Membrane-style multi-agent working memory.
Downloads · 30 days
9
13% of all-time downloads
All-time downloads
67
Public
Repo size
259 MB
Likes
0
Public
Click a slice to open those files.
.safetensors242 MB · 92%
From the Hugging Face model README
mn-context-engine-lora-v2 is a PEFT LoRA adapter for HuggingFaceTB/SmolLM3-3B trained for operational context compression in Membrane-style multi-agent working memory.
The adapter is optimized for preserving executable agent state under a token budget: current task, hard constraints, latest user instructions, source references, file paths, tool errors, ACL/private boundaries, contradictions, recovery state, and next actions. It is not a merged full model; load it together with the SmolLM3 base model.
Use this adapter as a generative context compressor for agent working memory. For production use, pair the model output with deterministic cleanup, restoration, redaction, and graph repair gates. The standalone adapter is evaluated below against LLMLingua on the same packet-parity benchmark, and the hybrid path shows the expected runtime contract: model compression followed by deterministic graph repair.
Evaluation used Membrane's 100-case mock context compression suite. Mean ratio is compressed_tokens / original_tokens, so lower is more compressed.
| Method | Quality | Critical / Fact Recall | Hard Constraints | Pinned Terms | Source Refs | Mean Ratio | Private Leaks |
|---|---|---|---|---|---|---|---|
| LLMLingua | 0.000 | 0.895 | 1.000 | 0.580 | 0.420 | 0.485 | 100 |
| SmolLM3 standalone adapter | 0.882 | 0.942 | 1.000 | 0.750 | 0.698 | 0.496 | 0 |
| SmolLM3 + graph repair hybrid | 0.985 | 1.000 | 1.000 | 0.996 | 1.000 | 0.700 | 0 |
See eval_metrics.json for the compact machine-readable metric summary and benchmark/ for full benchmark reports.
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
model_id = "homerquan/mn-context-engine-lora-v2"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoPeftModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
The adapter was trained for structured compression targets with compact operational sections such as current task, hard constraints, latest instructions, evidence/source refs, errors/recovery state, next action, and compression warnings. Keep prompts focused on the working-memory packet to compress, not broad instruction following.
HuggingFaceTB/SmolLM3-3B