Laravel 13.x Planner โ Qwen3-1.7B LoRA
A reasoning/planning model that decomposes vague Laravel feature requests into specific, actionable coding instructions with file paths. Designed as the first stage of a two-model pipeline.
How It Works
User: "simple contact form that saves to database"
โ
THIS MODEL (Planner, 1.7B, ~1.5s):
<think>Form request, controller, and model.</think>
[
{"file": "app/Http/Requests/ContactFormRequest.php",
"instruction": "Create a Form Request with validation: name, email, subject, message"},
{"file": "app/Http/Controllers/ContactController.php",
"instruction": "Write a ContactController with store method using FormRequest"},
{"file": "app/Models/Contact.php",
"instruction": "Create model for Contact with fillable: name, email, subject, message"}
]
โ
CODER MODEL (3B, ~1s per file) โ generates PHP for each
Limitations (Honest Assessment)
- 43 training examples โ covers common patterns but misses edge cases
- Sometimes omits migrations โ doesn't always include database table creation
- Sometimes omits routes โ despite training examples with routes
- Can over-decompose complex requests (8+ instructions when 4 would suffice)
- Instructions can be vague โ saying "fillable fields" instead of listing exact fields
- The planner is the bottleneck โ when it gives vague instructions, the coder produces vague output
The key insight from testing: the coder produces perfect output when given specific instructions. Improving the planner's instruction specificity is the highest-impact improvement.
Model Details
| Detail | Value |
|---|---|
| Base model | Qwen3-1.7B (4-bit via MLX) |
| Fine-tuning | LoRA, 16 layers, mask-prompt |
| Training data | 43 featureโinstructions decompositions |
| Training time | ~2 minutes on Apple M2 Pro 16GB |
| Peak memory | 3.3 GB |
| Best val loss | 0.786 (iter 50) |
Companion Models
| Model | Role | Link |
|---|---|---|
| This model | Decompose features | You're here |
| Coder | Generate code | fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA |
| CLI tool | End-to-end pipeline | github.com/florinel-chis/laravel-ai-code-generator |
Usage
from mlx_lm import load, generate
import json, re
model, tok = load("fchis/Laravel-13x-Planner-Qwen3-1.7B-LoRA")
messages = [
{"role": "system", "content": "You are a Laravel architect. Decompose feature requests into specific coding tasks. Think briefly, then output a JSON array of objects. Each object has 'file' (path) and 'instruction' (what to write)."},
{"role": "user", "content": "simple contact form - name, email, subject, message - saves to database"}
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
plan = generate(model, tok, prompt=text, max_tokens=1500)
match = re.search(r'\[.*?\]', plan, re.DOTALL)
tasks = json.loads(match.group()) if match else []
for t in tasks:
print(f" {t['file']} โ {t['instruction'][:60]}")
- Downloads last month
- 48
Model size
0.3B params
Tensor type
BF16
ยท
U32 ยท
Hardware compatibility
Log In to add your hardware
4-bit