qwen2.5-coder-7b-magento

A LoRA fine-tune of Qwen2.5-Coder-7B-Instruct (4-bit, MLX) specialized for writing idiomatic Magento 2 + Hyvä code. The adapter is fused into the base, so this is a self-contained model.

Developed by: Navin D. Bhudiya — AI Engineer (11+ years in e-commerce at scale).

⚠️ Apple Silicon only. This is an MLX model and runs via mlx-lm on Apple Silicon Macs. It is not loadable with transformers/vLLM/llama.cpp without conversion.

What it's for

A locally-running, open-source code assistant that writes house-style, modern Magento 2. A LoRA teaches style / conventions, not facts — so this model is good at how idiomatic Magento code is structured, and is best paired with RAG for factual grounding (see Limitations).

Consistently produces:

  • PHP 8 constructor property promotion + readonly, declare(strict_types=1), typed signatures
  • Plugins (not preferences) for behavior tweaks; observers + events.xml; correct di.xml wiring
  • HTTP-verb action interfaces (HttpGetActionInterface/HttpPostActionInterface), result objects
  • Service contracts (Api interfaces, repositories, SearchCriteria) over direct models
  • Declarative schema (db_schema.xml) + data/schema patches over InstallSchema
  • $escaper per context in .phtml; ViewModels over fat blocks
  • Hyvä = Alpine.js + Tailwind (no jQuery/Knockout)

…and avoids the base model's anti-patterns (e.g. setup_version, ObjectManager::getInstance(), Magento-1 app/code/local, and answering Magento questions in React/Vue/Java).

⚠️ Required inference settings

This model is served with sampling. Greedy decoding (temperature 0) can fall into repetition loops on long/complex generations.

  • temperature ≈ 0.3, top_p ≈ 0.95
  • repetition_penalty ≈ 1.1
  • stops on <|im_end|> (baked into config.json / generation_config.jsoneos_token_id includes 151645)

Run with mlx-lm

pip install mlx-lm

mlx_lm.generate --model navindbhudiya/qwen2.5-coder-7b-magento-v2 \
  --prompt "Create an observer for catalog_product_save_after." \
  --temp 0.3 --top-p 0.95 --max-tokens 400

Serve an OpenAI-compatible API

mlx_lm.server --model navindbhudiya/qwen2.5-coder-7b-magento-v2 --port 8080 \
  --host 127.0.0.1 --temp 0.3 --top-p 0.95
curl -s http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "model":"navindbhudiya/qwen2.5-coder-7b-magento-v2",
  "messages":[{"role":"user","content":"Build a Hyva accordion component with Alpine.js and Tailwind."}],
  "max_tokens":512, "temperature":0.3, "top_p":0.95, "repetition_penalty":1.1
}'

Training

  • Method: QLoRA via mlx-lm8 layers, rank 8, dropout 0.1, optimizer AdamW (weight_decay 0.01), cosine-decay LR (peak 1e-4, 50-step warmup → 1e-6), batch-size 1, max-seq-length 2048, 500 iters. Checkpoint selected by lowest validation loss (val loss 1.231).
  • Data: 478 instruction→answer chat pairs (430 train / 48 valid) teaching generic, idiomatic Magento 2 conventions across backend, frontend/Hyvä, database, performance, error-handling, and tooling.
  • Regularization: fewer layers + dropout + weight decay + cosine decay keep the training loss from collapsing and hold validation flat — favoring generalization over memorization.
  • Hardware: trained on a 24 GB fanless Apple Silicon MacBook Air.

Limitations

  • Facts vs style: as a style-focused LoRA, it can confabulate long-tail facts. Observed cases where the raw model is unreliable (and RAG fixes them): the CLI "Area code is not set" API (it may invent AreaRegistryInterface::setCurrentArea; the real API is App\State::setAreaCode), CSRF (may invent interfaces instead of App\CsrfAwareActionInterface), choosing InputException vs LocalizedException for invalid input, and occasionally re-introducing an N+1 by calling getById() inside a loop over rows it already loaded. Pair with RAG for ground-truth API details; trust the model for structure/idioms.
  • Occasional XML omission: can drop the <config>…</config> wrapper on module.xml/events.xml.
  • Greedy decoding loops: see Required inference settings — always use sampling + a repetition penalty.
  • Apple/MLX only.

Privacy / data provenance

Trained only on anonymized, generic Magento patterns authored from general knowledge. No client/ company/project names, no proprietary business logic, no secrets/keys/credentials, no PII are present in the training data (validated with automated leak + denylist scans before training).

Author

Navin D. Bhudiya — AI Engineer with 11+ years shipping e-commerce at scale. Builds production RAG, LLM agents, and intelligent search on AWS (Claude API, Amazon Bedrock, LangGraph, vector DBs). AWS + Anthropic certified.

Designed, trained, evaluated, and released this Magento 2 + Hyvä code model (dataset curation → QLoRA fine-tuning on Apple Silicon → checkpoint selection → evaluation → RAG grounding). Connect: linkedin.com/in/navindbhudiya

License & attribution

Finetuned from Qwen2.5-Coder-7B-Instruct (Apache-2.0); base MLX conversion: mlx-community/Qwen2.5-Coder-7B-Instruct-4bit. This derivative is released under Apache-2.0.

Downloads last month
148
Safetensors
Model size
1B params
Tensor type
F16
·
U32
·
MLX
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for navindbhudiya/qwen2.5-coder-7b-magento-v2

Base model

Qwen/Qwen2.5-7B
Adapter
(2)
this model