angular-coder-1.5b / README.md
bharathmuppa's picture
Upload fused model
8a0f78a verified
|
Raw History Blame Contribute Delete
3.95 kB
---
license: apache-2.0
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
language:
- en
tags:
- angular
- gguf
- ollama
- typescript
- frontend
- code
- mlx
- lora
datasets:
- bharathmuppa/angular-instruct
pipeline_tag: text-generation
library_name: mlx
---
# angular-coder-1.5b
A small code model that is an expert in Angular. It knows each Angular version
from v14 to v22. It writes modern Angular: standalone components, signals,
`inject()`, `@if` / `@for`, `@defer`, zoneless change detection, signal forms,
the new application builder and the `ng update` migrations.
- Base model: `Qwen/Qwen2.5-Coder-1.5B-Instruct`
- Method: LoRA (rank 16, last 16 layers, attention + MLP), fused into the base weights
- Trained with `mlx-lm` on an Apple M2 Max
- Data: `bharathmuppa/angular-instruct` (2030 instruction pairs written from the official Angular docs and changelog)
## Use with mlx-lm (Apple Silicon)
```sh
pip install mlx-lm
python -m mlx_lm generate --model bharathmuppa/angular-coder-1.5b \
--prompt "Which Angular version introduced @defer and how do I use it?"
```
## Use with Ollama / llama.cpp (GGUF)
This repo also holds GGUF builds: `angular-coder-1.5b-Q4_K_M.gguf` (1.0 GB), `angular-coder-1.5b-Q8_0.gguf` (1.6 GB) and `angular-coder-1.5b-f16.gguf` (3.1 GB), plus a `Modelfile` with the system prompt and chat template.
```sh
ollama run hf.co/bharathmuppa/angular-coder-1.5b:Q8_0
```
Or build it locally from the Modelfile:
```sh
hf download bharathmuppa/angular-coder-1.5b --include "angular-coder-1.5b-Q8_0.gguf" "Modelfile" --local-dir angular-coder
cd angular-coder && sed -i '' 's/Q4_K_M/Q8_0/' Modelfile && ollama create angular-coder -f Modelfile && ollama run angular-coder
```
Q8_0 is recommended for version facts; Q4_K_M is fine for scaffolding. Both were checked against the full model on held-out questions.
## Use with transformers
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
m = "bharathmuppa/angular-coder-1.5b"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForCausalLM.from_pretrained(m, torch_dtype="auto", device_map="auto")
msgs = [{"role": "user", "content": "Write a standalone Angular 22 component with a required signal input."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=500)[0][ids.shape[1]:], skip_special_tokens=True))
```
The model was trained with this system prompt. Use it for best results:
> You are an expert Angular engineer. You know every Angular version from v12 to the current release: NgModules, standalone components, signals, the new control flow, inject(), deferrable views, zoneless change detection, SSR, the CLI and migrations. Answer with correct, modern, idiomatic TypeScript and say which Angular version a feature needs when it matters.
## Training
| Setting | Value |
| --- | --- |
| Records (train / valid / test) | 2427 / 131 / 79 |
| Iterations | 1700 |
| Batch size | 4 |
| Max sequence length | 2048 |
| Loss | assistant tokens only |
| Final validation loss | 1.313 (from 2.175) |
| Test loss, assistant tokens (base → tuned) | 2.104 → 1.293 |
| Learning rate | 3e-5, cosine decay, 50 warm-up steps |
## Limits
- Known-issue answers ("I'm on 19.2 and see X") give the right shape, release line and fix description, but the issue and PR numbers are often wrong. Verify them on GitHub. A 1.5B model does not memorize 250 issue numbers from a few exposures.
- Use `repetition_penalty` 1.1 or similar; long import lists can repeat otherwise.
- 1.5B parameters. It is good for Angular questions and small components. It is not a general assistant.
- Knowledge ends at Angular 22 (October 2026).
- Check generated code before you ship it.
## Sources
Training records were written from the Angular documentation
(`angular/angular`, `adev/src/content`, MIT license) and the Angular changelog.