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)

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.

ollama run hf.co/bharathmuppa/angular-coder-1.5b:Q8_0

Or build it locally from the Modelfile:

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

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.

Downloads last month
110
Safetensors
Model size
2B params
Tensor type
BF16
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

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

Model tree for bharathmuppa/angular-coder-1.5b

Adapter
(193)
this model
Adapters
1 model

Dataset used to train bharathmuppa/angular-coder-1.5b