Skip to content
Back to skills

Model Internals

ASecurity

"Maintain and diagnose nano-vLLM internals, including Qwen3

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
ai-agentsbackendperformance

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill model-internals --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Model Internals?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Model Internals
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-model-internals-arex-skill/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-model-internals-arex-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: model-internals
description: "Maintain and diagnose nano-vLLM internals, including Qwen3
  architecture, tensor-parallel layers, FlashAttention/Triton context, KV cache,
  and safetensors weight loading."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Model internals

Use this route when the task is to modify, diagnose, or extend nano-vLLM source
behavior rather than simply run generation. The implementation is intentionally
small and Qwen3-focused; many failures come from assuming it is a general
Transformers runtime.

## Fast path

1. Identify whether the issue is model compatibility, weight naming, tensor
   parallel sharding, attention context, or runtime scheduling.
2. For a candidate model, run
   [scripts/inspect_model_contract.py](scripts/inspect_model_contract.py) with
   the intended `--tensor-parallel-size` before loading weights.
3. Read [references/architecture.md](references/architecture.md) for the
   forward path, attention context, KV-cache, and sharding contracts.
4. Read [references/weight-loading.md](references/weight-loading.md) when a
   safetensors key is missing, renamed, or needs a new packed-module mapping.
5. Use [references/troubleshooting.md](references/troubleshooting.md) to map
   common backend/import/dist failures to the owning layer.

Route user-facing prompt generation to
[../offline-inference/SKILL.md](../offline-inference/SKILL.md). Route runtime
batch sizing, graph capture, and benchmarking to
[../performance-tuning/SKILL.md](../performance-tuning/SKILL.md).

## Compatibility checklist

- The Hugging Face config should be Qwen3-like, with attention head counts,
  key-value head counts, hidden size, intermediate size, and vocabulary size
  divisible by the selected tensor-parallel size where the sharded layers need
  it.
- The model uses packed QKV and gate/up projections internally. Weight names
  containing `q_proj`, `k_proj`, `v_proj`, `gate_proj`, or `up_proj` are mapped
  into packed parameters; all other names must match a parameter directly.
- Attention uses FlashAttention varlen prefill and KV-cache decode paths, plus a
  Triton kernel to store keys/values into block slots. Context fields must be
  set correctly before calling attention.
- The runner sets the default device to CUDA while building/loading/running the
  model and resets it afterward. Avoid hidden CPU tensor creation inside model
  code unless explicitly moved.

## Extension rules

When adding another model family, treat it as a full compatibility project:
create a model module, define packed-module mappings, validate dimension
sharding, verify safetensors names, and add smoke coverage for prefill, decode,
KV-cache allocation, and sampling. Do not only add an AutoConfig branch.

Files in this skill

  • SKILL.md2.7 KB
  • references/architecture.md3.7 KB
  • references/troubleshooting.md2.1 KB
  • references/weight-loading.md2.8 KB
  • scripts/inspect_model_contract.py5.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.