# hf-architecture-tikz

hf-architecture-tikz draws Sebastian-Raschka-style TikZ architecture diagrams for HuggingFace decoder-only LLMs with formulas and layer parameter counts.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 158 repo stars
- Author: yzlnew
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/yzlnew/infra-skills/tree/HEAD/hf-architecture-tikz/SKILL.md
- Updated: 2026-07-09
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/hf-architecture-tikz

## What it does

This skill generates publication-ready vertical diagrams of transformer models modeled after Sebastian Raschka's LLM Architecture Gallery. It inspects a HuggingFace repository identifier or a local `config.json`, determines the model family automatically, and evaluates closed-form parameter counts for each sub-block.

Supported designs include MHA, GQA, MLA, and DeepSeek-V4-Flash with Hyper-Connections and sparse attention. It handles both standard and MoE feed-forward networks, hash-based routing, and multi-token prediction heads. Jinja2 templates generate the raw TikZ LaTeX document, which compiles to a PNG image using XeLaTeX and `pdftocairo`.

Local rendering depends on an installed TeX distribution with `xelatex` or `pdflatex` alongside `pdftocairo` for final image output.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add yzlnew/infra-skills --skill hf-architecture-tikz -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/hf-architecture-tikz/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/hf-architecture-tikz/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add yzlnew/infra-skills --skill hf-architecture-tikz -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/hf-architecture-tikz/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add yzlnew/infra-skills --skill hf-architecture-tikz -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/hf-architecture-tikz/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install yzlnew/infra-skills hf-architecture-tikz
```

2. **Manually: put the files in place**
- File: `.github/skills/hf-architecture-tikz/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add yzlnew/infra-skills --skill hf-architecture-tikz -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/yzlnew/infra-skills --path hf-architecture-tikz
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/hf-architecture-tikz/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/yzlnew/infra-skills/tree/HEAD/hf-architecture-tikz/SKILL.md

## When to use it
- render a publication-grade LaTeX diagram of a HuggingFace transformer model
- evaluate closed-form parameter totals for individual attention and FFN blocks
- illustrate architectures such as DeepSeek-V4-Flash featuring MLA and MoE

## Example prompts
- Draw the architecture of deepseek-ai/DeepSeek-V4-Flash in TikZ format
- Generate a Raschka-style diagram for a local config.json file
- Create a TikZ figure with parameter formulas for Qwen3

## Similar
- [tikz-scientific-figures](https://affpapa.org/en/nevibecode/skills/tikz-scientific-figures.md) — skill · ★ 108 repo stars
- [extract-tikz](https://affpapa.org/en/nevibecode/skills/extract-tikz.md) — skill · ★ 1729 repo stars
- [latex-posters](https://affpapa.org/en/nevibecode/skills/k-dense-ai-latex-posters.md) — skill · 2300 installs
- [latex-document-skill](https://affpapa.org/en/nevibecode/skills/latex-document-skill.md) — skill · 608 installs
- [beautiful_deck](https://affpapa.org/en/nevibecode/skills/beautiful-deck.md) — skill · ★ 240 repo stars
- [explorable-beamer](https://affpapa.org/en/nevibecode/skills/explorable-beamer.md) — skill · ★ 579 repo stars

From the same set: [yzlnew/infra-skills](https://affpapa.org/en/nevibecode/by/yzlnew/infra-skills.md) — 8 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
