angular-coder-30b-a3b
A 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 @Service decorator, the application builder and the ng update migrations.
It was trained to write complete, compiling projects that follow one coding
guideline (docs/ANGULAR-GUIDELINES.md in the source repository).
- Base model:
Qwen/Qwen3-Coder-30B-A3B-Instruct - Method: LoRA (rank 16, attention projections q/k/v/o), merged into the base weights in bf16
- Trained with
transformersandpefton one NVIDIA A100 80GB - Data:
bharathmuppa/angular-instruct(3461 instruction pairs: Angular docs, version facts, known issues, Material, CDK, NgRx, angular-eslint, the CLI, and 400 compiled and lint-checked project records)
The weights are the full merged model in bf16, so this repository is large. The
adapter alone is in bharathmuppa/angular-coder-30b-a3b-lora.
Use with transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
m = "bharathmuppa/angular-coder-30b-a3b"
tok = AutoTokenizer.from_pretrained(m)
model = AutoModelForCausalLM.from_pretrained(m, dtype="auto", device_map="auto")
msgs = [{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Write a standalone Angular 22 component with a required signal input."}]
text = tok.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False)
enc = tok(text, return_tensors="pt").to(model.device)
print(tok.decode(model.generate(**enc, max_new_tokens=800)[0][enc["input_ids"].shape[1]:], skip_special_tokens=True))
The model was trained with this system prompt (SYSTEM above). 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.
Use with Ollama / llama.cpp (GGUF)
This repo also holds GGUF builds, made on the training pod with llama.cpp:
angular-coder-30b-a3b-Q4_K_M.gguf (about 18 GB, needs about 20 GB of memory) and
angular-coder-30b-a3b-Q8_0.gguf (about 32 GB), plus a Modelfile with the system prompt and
chat template.
ollama run hf.co/bharathmuppa/angular-coder-30b-a3b:Q4_K_M
Or build it locally from the Modelfile:
hf download bharathmuppa/angular-coder-30b-a3b --include "angular-coder-30b-a3b-Q4_K_M.gguf" "Modelfile" --local-dir angular-coder
cd angular-coder && ollama create angular-coder -f Modelfile && ollama run angular-coder
Q8_0 is closest to the bf16 weights; Q4_K_M is fine for scaffolding. On Apple
Silicon mlx-lm can also load the bf16 weights directly:
pip install mlx-lm
python -m mlx_lm convert --hf-path bharathmuppa/angular-coder-30b-a3b -q --q-bits 4 --mlx-path angular-coder-4bit
python -m mlx_lm generate --model angular-coder-4bit --prompt "What is new in Angular 22?"
Training
| Setting | Value |
|---|---|
| Records (train / valid / test) | 3182 / 172 / 103 |
| Steps done | 796 optimizer steps (2.0 epochs; the loop has a wall-clock limit of 170 minutes) |
| Final loss | train 1.1279, eval 1.1662 |
| Batch | 1 x 8 gradient accumulation, max 4096 tokens |
| Learning rate | 3e-5, cosine, 50 warm-up steps |
| LoRA | rank 16, alpha 16, dropout 0.05, q/k/v/o |
| Loss | answer tokens only |
The run log with every loss line is in the dataset repository
bharathmuppa/angular-lm-runs. The source, the dataset builder, the checker that
compiles and lints the project records, and the evaluation script are in the
GitLab project mahaamatsya/ai/angular-lm.
Limits
The model writes scaffolds well. Logic can still have defects, so review the output and run the compiler and the linter. Version facts after early 2026 come only from the training data.