What it does
Trained on 56,253 instruction samples: 70% ECInstruct (generic e-commerce) + 30% synthetic Magento-schema data generated from the Magento Luma sample catalog (products fully disjoint between train and eval). Four task shapes:
Attribute extraction — product text (or a raw Magento custom_attributes payload) → JSON:
target attribute: size
product title: Puma Suede green sneakers size 43
→ [{"attribute": "size", "value": "43"}]
Absent attributes are reported as "None" rather than hallucinated.
Product QA — a question answered strictly from given product data.
Relevance classification — query + product → graded relevance option (ESCI-style A–D).
Relevance ranking — query + lettered product list → ranked letters (B,A,C).
Usage — adapter (unsloth / peft)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
"gabrielgts/ministral3-3b-ec-magento", max_seq_length=2048, load_in_4bit=True)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": ""},
{"role": "user", "content":
"Extract the value of the target attribute from the given product information "
"and output it as JSON. If the attribute is not present, output None as the value.\n\n"
"target attribute: size\nproduct title: Puma Suede green sneakers size 43"},
]
text = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer(text=text, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Plain peft also works: PeftModel.from_pretrained(base_model, "gabrielgts/ministral3-3b-ec-magento").
Usage — GGUF / Ollama
hf download gabrielgts/ministral3-3b-ec-magento --include 'gguf/*' --local-dir .
cd gguf && ollama create ministral3-3b-ec-magento -f Modelfile
ollama run ministral3-3b-ec-magento "target attribute: color ..."
The bundled Modelfile renders the trained prompt format ([SYSTEM_PROMPT][/SYSTEM_PROMPT][INST]…[/INST]) with temperature 0. If your Ollama version ships a built-in Ministral 3 renderer, pass an explicit empty system prompt per request so Mistral's default one is not injected.
Training recipe
Table with columns: Parameter, Value| Parameter | Value |
|---|
| Method | QLoRA (4-bit NF4 base, bf16 compute) via Unsloth |
| LoRA | r=8, alpha=16, targets q/k/v/o/gate/up/down_proj (language model only; vision tower frozen) |
| Trainable params | 12.4M of 3,861M (0.32%) |
| Batch | 1 × grad_accum 16 (effective 16), max_seq_length 2048 |
| Optimizer / LR | paged_adamw_8bit, 2e-4 cosine, 1 epoch, seed 42 |
| Data | 56,253 samples: 39,377 ECInstruct + 16,876 Magento-synthetic |
| System prompt | explicit empty system message at train and eval (suppresses the template default) |
Evaluation
Greedy decoding, identical prompts and chat template across all models; base model evaluated zero-shot with the same harness. The Qwen column is the same-data, same-recipe sibling qwen3.5-4b-ec-magento (4.55B params vs 3.85B text params here — mind the ~15% size gap when comparing).
Magento held-out set (2,969 samples, 475 products never seen in training):
Table with columns: Task · metric, Base, this model, qwen3.5-4b-ec-magento| Task · metric | Base | this model | qwen3.5-4b-ec-magento |
|---|
| Attribute extraction · F1 | 0.000 | 0.945 | 0.938 |
| Attribute extraction · parse failures | 100% | 0.1% | 0% |
| Product QA · token-F1 | 0.039 | 0.954 | 0.943 |
| Relevance classification · accuracy | 0.132 | |
ECInstruct held-out set (2,000 samples):
Table with columns: Task · metric, Base, this model, qwen3.5-4b-ec-magento| Task · metric | Base | this model | qwen3.5-4b-ec-magento |
|---|
| Attribute extraction · F1 | 0.000 | 0.654 | 0.646 |
| Query→product rank · top-1 | 0.000 | 0.632 | 0.650 |
| Relevance classification · accuracy | 0.013 | 0.655 | 0.685 |
| Answerability · accuracy | 0.507 | 0.735 |
Limitations — read before relying on the numbers
- The Magento eval is synthetic-on-synthetic. Eval tasks were generated with the same templates as training data (products fully disjoint). It validly measures schema adherence — JSON format, Magento attribute vocabularies, the None-when-absent rule — but overstates production quality on real catalogs and real user queries.
- The base model's near-zero extraction scores are dominated by format non-adherence (it answers in prose); they understate its underlying capability, though prose output is itself a blocker for programmatic use.
- Fine-tuned on English-only structured data: expect degraded multilingual and general-chat ability versus the base model (drop the adapter to recover it). The vision tower is untouched, but this repo's GGUF is text-only.
- Free-form generation is weak (trained r=8, extraction-focused); use it for structured tasks, not copywriting.
- Use greedy decoding (
do_sample=False / temperature 0) — that's how it was evaluated.
Provenance
Table | |
|---|
| Training run | ministral3-3b-r8-mix56k-e1 (2026-07-09) |
| Adapter sha256 | c20e11c73705797541191bbda9287f31514f22a4a4c19164709e1695c0d3d9d1 |
| Train set sha256 | afb7e664cda4490597c1914db6aff94933991a56d2175435666f8f6b7a726532 (mixture_train.jsonl, 56,253 rows) |
| Eval set sha256 | 8feafdb2… (magento_eval.jsonl) · 2583a61e… (ecinstruct_eval.jsonl) |
| GGUF | adapter merged into mistralai/Ministral-3-3B-Instruct-2512-BF16, Q4_K_M, sha256 |
References