Instructions to use fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- Pi new
How to use fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA"
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 fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA
Run Hermes
hermes
- MLX LM
How to use fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA", "messages": [ {"role": "user", "content": "Hello"} ] }'
Laravel 13.x Qwen2.5-Coder-3B-Instruct LoRA
A code-specialized Qwen2.5-Coder-3B model fine-tuned on Laravel 13.x instruction-to-code pairs. Generates production-ready Laravel PHP code from natural language instructions.
Designed to work with fchis/Laravel-13x-Planner-Qwen3-1.7B-LoRA as a two-model pipeline, or standalone with specific instructions.
Key Finding: Specific Instructions = Perfect Output
When given specific, single-file instructions, this model produces near-perfect code:
| Instruction | Output quality | PHP valid |
|---|---|---|
| "Create model for Contact with fillable: name, email, subject, message" | Perfect — exact 4 fields, no extras | Yes |
| "Write migration to create contacts table with name, email, subject, message" | Perfect — full class wrapper, correct types | Yes |
| "Create Form Request with validation: name, email, subject, message" | Perfect — correct rules | Yes |
| "Write ContactController with store using StoreContactRequest, return 201" | Near-perfect — correct FormRequest injection | Yes |
When instructions are vague, quality drops. The model works best as the second stage of a planner→coder pipeline where the planner provides specific instructions.
Limitations (Honest Assessment)
After testing on real Laravel projects:
- Works well for: Migrations, Models (simple), Form Requests, short Controllers
- Struggles with: Long controllers (>30 lines), complex multi-concept models
- Known issues:
- Occasionally adds prose before
<?php(post-processing strips this) - May add unwanted relationships if instruction is vague
- May hallucinate fields not in the instruction if instruction doesn't list them explicitly
- Controllers can enter repetition loops on longer outputs — cap at 600 tokens
- 139 training examples is not enough to fully override base model patterns — 500+ would be better
- Occasionally adds prose before
Model Details
| Detail | Value |
|---|---|
| Base model | Qwen2.5-Coder-3B-Instruct (4-bit via MLX) |
| Fine-tuning | LoRA, 16 layers, mask-prompt |
| Training data | 139 instruction-to-code pairs (v5) |
| Training time | ~5 minutes on Apple M2 Pro 16GB |
| Peak memory | 5.8 GB |
| Best val loss | 0.344 (iter 200) |
Training Data Composition (v5)
- 8 simple models WITHOUT relationships (fixes over-generation)
- 8 instruction-grounded models (exact field matching)
- 10+ short controllers using FormRequest injection
- 4 full migration examples with class wrappers (all bare Schema examples removed)
- 3 route file examples
- No attribute-based controller examples (removed — toxic at 3B scale)
Usage
from mlx_lm import load, generate
model, tok = load("fchis/Laravel-13x-Qwen2.5-Coder-3B-Instruct-LoRA")
messages = [
{"role": "system", "content": "You are a senior Laravel developer. Write clean, production-ready Laravel code."},
{"role": "user", "content": "Create a Laravel Eloquent model for Contact with fillable fields: name, email, subject, message."}
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tok, prompt=text, max_tokens=500)
print(response)
Best Practices
- Be specific in instructions — list exact fields, relationships, methods
- One file per instruction — don't ask for migration + model in one prompt
- Cap max_tokens: migrations=500, models=500, controllers=600
- Post-process: strip text before
<?php, detect repetition loops
Companion Models
| Model | Role | Link |
|---|---|---|
| Planner | Decompose features into instructions | fchis/Laravel-13x-Planner-Qwen3-1.7B-LoRA |
| This model | Generate code per instruction | You're here |
| CLI tool | End-to-end pipeline | github.com/florinel-chis/laravel-ai-code-generator |
- Downloads last month
- 132
4-bit