Instructions to use gabrielgts/qwen3.5-4b-ec-magento with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use gabrielgts/qwen3.5-4b-ec-magento with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B") model = PeftModel.from_pretrained(base_model, "gabrielgts/qwen3.5-4b-ec-magento") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use gabrielgts/qwen3.5-4b-ec-magento with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M # Run inference directly in the terminal: llama cli -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M # Run inference directly in the terminal: llama cli -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Use Docker
docker model run hf.co/gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use gabrielgts/qwen3.5-4b-ec-magento with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gabrielgts/qwen3.5-4b-ec-magento" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gabrielgts/qwen3.5-4b-ec-magento", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
- Ollama
How to use gabrielgts/qwen3.5-4b-ec-magento with Ollama:
ollama run hf.co/gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
- Unsloth Desktop
- Pi
How to use gabrielgts/qwen3.5-4b-ec-magento with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use gabrielgts/qwen3.5-4b-ec-magento with Docker Model Runner:
docker model run hf.co/gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
- Lemonade
How to use gabrielgts/qwen3.5-4b-ec-magento with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Run and chat with the model
lemonade run user.qwen3.5-4b-ec-magento-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use gabrielgts/qwen3.5-4b-ec-magento with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use gabrielgts/qwen3.5-4b-ec-magento with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "gabrielgts/qwen3.5-4b-ec-magento:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
qwen3.5-4b-ec-magento
A QLoRA adapter for Qwen/Qwen3.5-4B specialized in e-commerce catalog tasks with Magento 2 conventions: attribute extraction to JSON, product Q&A, search-relevance classification, and product ranking.
The repo contains both distribution formats:
| Path | What | Size | For |
|---|---|---|---|
/ (root) |
LoRA adapter (PEFT) | 42MB | transformers/peft/unsloth on top of the base model |
gguf/ |
Merged + quantized Q4_K_M + Ollama Modelfile | 2.6GB | llama.cpp / Ollama, CPU+GPU serving |
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(
"gtstadeu/qwen3.5-4b-ec-magento", max_seq_length=2048, load_in_4bit=True)
FastLanguageModel.for_inference(model)
messages = [{"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"}]
# Qwen3.5 gotchas: enable_thinking=False is REQUIRED (the adapter was trained with a
# closed <think> block; an open one makes it emit reasoning instead of the answer),
# and the multimodal Processor requires tokenizer(text=...), never positional.
text = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, enable_thinking=False, tokenize=False)
inputs = tokenizer(text=text, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=64, do_sample=False) # greedy recommended
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
# [{"attribute": "size", "value": "43"}]
Plain peft also works: PeftModel.from_pretrained(base_model, "gtstadeu/qwen3.5-4b-ec-magento") over Qwen/Qwen3.5-4B.
Usage — GGUF / Ollama
hf download gtstadeu/qwen3.5-4b-ec-magento --include 'gguf/*' --local-dir .
cd gguf && ollama create qwen3.5-4b-ec-magento -f Modelfile
ollama run qwen3.5-4b-ec-magento --think=false "target attribute: color ..."
Ollama ≥ 0.31 uses its built-in Qwen3.5 renderer and defaults to thinking mode — pass --think=false (CLI) or "think": false (API) for the trained fast-path output. Requires an Ollama version with qwen35 architecture support. ~95 tok/s on an RTX 3070.
Training recipe
| 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 |
| Trainable params | 10.6M of 4,550M (0.23%) |
| 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 |
Evaluation
Greedy decoding, identical prompts and chat template across all models; base model evaluated zero-shot with the same harness. ec50k is an intermediate adapter trained on ECInstruct only (not published) — shown to isolate what the Magento data adds.
Magento held-out set (2,969 samples, 475 products never seen in training):
| Task · metric | Base | ec50k | this model |
|---|---|---|---|
| Attribute extraction · F1 | 0.015 | 0.320 | 0.938 |
| Attribute extraction · parse failures | 71.5% | 8.1% | 0% |
| Product QA · token-F1 | 0.041 | 0.299 | 0.943 |
| Relevance classification · accuracy | 0.194 | 0.770 | 0.962 |
| Relevance rank · top-1 | 0.345 | 0.770 | 0.799 |
ECInstruct held-out set (2,000 samples):
| Task · metric | Base | ec50k | this model |
|---|---|---|---|
| Attribute extraction · F1 | 0.000 | 0.685 | 0.646 |
| Query→product rank · top-1 | 0.013 | 0.670 | 0.650 |
| Relevance classification · accuracy | 0.258 | 0.678 | 0.685 |
| Answerability · accuracy | 0.503 | 0.778 | 0.780 |
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.
- English only. Inputs should fit a 2,048-token budget (strip HTML from product descriptions).
- 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
| Training run | qwen3.5-4b-r8-mix56k-e1 (2026-07-03) |
| Adapter sha256 | 8e7a7f89da314bd7c206b1f2fad2ad9eaaa4b0e988f72ea8f4592aa099bc6b42 |
| Train set sha256 | afb7e664cda4490597c1914db6aff94933991a56d2175435666f8f6b7a726532 (mixture_train.jsonl, 56,253 rows) |
| Eval set sha256 | 8feafdb2… (magento_eval.jsonl) · 2583a61e… (ecinstruct_eval.jsonl) |
| Stack | torch 2.6.0+cu124 · transformers 5.5.0 · unsloth 2026.6.9 |
References
- ECInstruct / eCeLLM: arXiv:2402.08831
- QLoRA: arXiv:2305.14314
- LoRA rank for merchant extraction (r=8 finding): arXiv:2606.08051
- Downloads last month
- 15
4-bit
Model tree for gabrielgts/qwen3.5-4b-ec-magento
Dataset used to train gabrielgts/qwen3.5-4b-ec-magento
Papers for gabrielgts/qwen3.5-4b-ec-magento
How Small Can You Go? LoRA Fine-Tuning 270M-8B Models for Merchant Information Extraction in Financial Transactions
eCeLLM: Generalizing Large Language Models for E-commerce from Large-scale, High-quality Instruction Data
QLoRA: Efficient Finetuning of Quantized LLMs
Evaluation results
- Attribute extraction micro-F1 on Synthetic Magento eval — Luma sample data, 2,969 samples, 475 unseen productsself-reported0.938
- Product QA token-F1 on Synthetic Magento eval — Luma sample data, 2,969 samples, 475 unseen productsself-reported0.943
- Relevance classification accuracy on Synthetic Magento eval — Luma sample data, 2,969 samples, 475 unseen productsself-reported0.962
- Attribute extraction micro-F1 on ECInstruct held-out test split (2,000 samples)self-reported0.646
- Relevance classification accuracy on ECInstruct held-out test split (2,000 samples)self-reported0.685