em-router / README.md
ninosh's picture
docs: add complete model card
15b2d20 verified
|
Raw History Blame Contribute Delete
2.9 kB
---
language:
- en
license: apache-2.0
tags:
- em
- skill-router
- commit-msg
- gguf
- qwen2.5
- lora
base_model: Qwen/Qwen2.5-1.5B-Instruct
pipeline_tag: text-generation
---
# em-router
Skill-routing and commit-message model fine-tuned for the **em** developer CLI tool.
Given a free-text developer request → outputs the single best skill slug (`sdd-feature`, `ws-commit`, `gitnexus-exploring`, …).
Given a unified git diff → outputs a one-line [Conventional Commit](https://www.conventionalcommits.org/) message.
## Model Details
| Field | Value |
|---|---|
| **Developed by** | Travis Dinh ([ninosh](https://huggingface.co/ninosh)) |
| **Base model** | [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) |
| **Model type** | LoRA fine-tune → GGUF Q4\_K\_M |
| **Language** | English |
| **License** | Apache-2.0 |
| **Tasks** | Skill routing (classification), commit message generation |
## Training
| Hyperparameter | Value |
|---|---|
| Framework | Unsloth + TRL SFTTrainer |
| Hardware | Kaggle T4 (fp16) |
| LoRA rank / alpha | 16 / 32 |
| Epochs | 3 |
| Effective batch size | 16 |
| Learning rate | 2e-4 |
| Final eval loss | 1.369 |
### Training Data
| Dataset | Rows | Task |
|---|---|---|
| [ninosh/em-commit-msg-train](https://huggingface.co/datasets/ninosh/em-commit-msg-train) | 150 | Conventional commit from diff |
| [ninosh/em-intent-train](https://huggingface.co/datasets/ninosh/em-intent-train) | 240 | Skill slug from developer request |
Both use OpenAI chat format (`system` / `user` / `assistant`), combined and split 90/10 train/val.
## Files
| File | Size | Description |
|---|---|---|
| `em-router-Q4_K_M.gguf` | ~986 MB | 4-bit quantized — use with llama.cpp or Ollama |
| `adapter_model.safetensors` | ~71 MB | Raw LoRA adapter — use with PEFT/Unsloth for further fine-tuning |
| `tokenizer.json` | 11 MB | Qwen2.5 tokenizer |
## Usage
### With em CLI (recommended)
```bash
# Download once (~986 MB)
em model pull
# Generate a commit message from staged diff
git diff HEAD | em model run --task commit-msg
# Route a request to the best skill
em model run --task intent --prompt "I need to review my recent changes"
```
### With llama.cpp
```bash
huggingface-cli download ninosh/em-router em-router-Q4_K_M.gguf
llama-cli -m em-router-Q4_K_M.gguf --chat-template chatml \
-p "You are a skill router. Output only one skill slug. No explanation.\nUser: review my changes"
```
### With Ollama
```bash
ollama run hf.co/ninosh/em-router
```
## Skill Set Version
Trained against skill set hash `86f22cbf`. Run `em model status` to check whether a newer version is available.
## Limitations
- Covers the `em` skill library (~80 skills). Out-of-scope requests return the closest match.
- Commit messages are single-line only; no body/footer generation.
- Context window 2048 tokens; very large diffs are truncated.