⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
roofline
Router for the Inference Engineer role on on-prem LLM serving (vLLM/SGLang, OpenAI-compatible endpoint, air-gap). Use when the user asks what to do first with a local LLM server, how to approach a serving task, which skill, task or agent to use, what is inside or outside the inference engineer role, or talks about LLM serving, GPU inference, inference engineering in general terms.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
Roofline, a Lenialno product line. По-русски
Agent Skills for the Inference Engineer role: run vLLM or SGLang on your own GPUs behind an OpenAI-compatible endpoint, serve Claude Code and Qwen Code through a proxy, stay healthy on air-gapped hosts. 13 skills, one Claude Code subagent and a Taskfile toolbox; the competency map follows roadmap.sh/inference-engineering.
Quick start
As Agent Skills, for any agent that supports them (Claude Code, Codex, Cursor, OpenCode and others):
npx skills add lenialno/roofline --list # see what is inside
npx skills add lenialno/roofline --skill roofline --skill roofline-toolbox # pick skills
npx skills add lenialno/roofline --all # everything, all agents
npx skills add lenialno/roofline -g -a claude-code --skill roofline-toolbox # user scope, Claude Code only
As a Claude Code plugin, available in every project on the machine, from the Lenialno catalog lenialno/skills:
claude plugin marketplace add lenialno/skills
claude plugin install roofline@lenialno
[!TIP] Update with
claude plugin marketplace update lenialno, thenclaude plugin update roofline@lenialnoand/reload-plugins. To try a local clone for one session:claude --plugin-dir /path/to/roofline.
Then ask the agent what to do first with your local LLM server. The roofline skill routes the question to the right skill, task or subagent.
The toolbox needs python3 and curl, go-task for task, and nvidia-smi for the gpu task. The scripts also run without task.
Skills
| Skill | Covers | Ask it when |
|---|---|---|
roofline | role router: first steps, what is in and out of the role, which skill, task or agent to use | "where do I start", "is this my job", "which skill handles this" |
roofline-runtime | bring up vLLM or SGLang and keep it healthy: engine choice, flag order, launch profiles, air-gap, docker | "start or stop the server", "vLLM or SGLang", "set TP or max-model-len", "it fails to start" |
roofline-toolcall | tool calling and chat template: parsers by model family, streaming tool_calls, Claude Code and Qwen Code wiring | "tool calls come back as text", "arguments are not valid JSON", "400 on role tool" |
roofline-perf | VRAM and KV cache budget, batching, prefix cache, quantization and its cost, speculative decoding, benchmark method | "why is it slow", "more throughput", "which quantization", "how to read a benchmark" |
roofline-incident | runbook: triage health, metrics, gpu, logs; OOM variants, queue, p95 breaches, regressions after upgrades, postmortem | "server is down", "GPU memory is full", "p95 spiked", "Claude Code reports errors" |
roofline-capacity | GPU, VRAM and TP sizing, concurrency under SLO, replicas, model choice by evals, canary and rollback, cost | "how many GPUs", "which model fits", "how many concurrent users", "roll out safely" |
roofline-toolbox | Taskfile and dependency-free scripts the other skills call | "check, start, stop, benchmark or probe the server", or another skill says to run a task |
Agents pick a skill by its description, so phrases like the ones in the last column are enough. The first six also ship in Russian under the same name with a -ru suffix: roofline-ru, roofline-runtime-ru, roofline-toolcall-ru, roofline-perf-ru, roofline-incident-ru, roofline-capacity-ru. The toolbox is language-neutral and shared by both sets.
[!NOTE] No MCP servers and no hooks, by design. Live state comes from Task: the agent reads GPU memory, health, metrics and logs from the real server instead of guessing.
Subagent
incident-investigator (agents/incident-investigator.md) is a Claude Code subagent that roofline-incident hands an investigation to when it needs long logs or hours of metrics. It only reads and measures (health, metrics, gpu, models, logs, smoke-toolcall), never runs serve, stop or restart, and returns a verdict of at most 25 lines: cause, evidence, rejected hypotheses, next action.
Toolbox
A Taskfile plus dependency-free bash and python3 scripts in skills/roofline-toolbox/; the root Taskfile.yml re-exports it without a namespace. Every task is idempotent and exits non-zero on failure. From any project:
task -t /path/to/roofline/Taskfile.yml health
Or include it in the project Taskfile and call task infer:health:
version: '3'
includes:
infer:
taskfile: /path/to/roofline/skills/roofline-toolbox/Taskfile.yml
Commands run in the directory you call task from, where inference.env (KEY=value lines) and .inference-state/ live. task with no arguments prints the task list under the Roofline mark.
[!NOTE]
task servestarts only a named profile fromprofiles/(orPROFILES_DIR). Before promoting a profile:task health && task smoke-toolcall && task bench.
| Task | What it does |
|---|---|
gpu | memory, utilization, processes from nvidia-smi |
health | /health, /v1/models, one short completion with latency |
models | served model ids and max context from /v1/models |
profiles | list launch profiles in profiles/ |
metrics | queue, KV usage, prefix-cache hit rate, preemptions, p50/p95 TTFT and TPOT from /metrics |
status | gpu, then health, then models |
serve INFER_PROFILE=<name> | start from a profile, wait for /health, pid and log in .inference-state/ |
stop, restart, logs | stop by pid (no profile means all), stop then serve, tail the log (LINES=200 FOLLOW=1) |
bench | fixed SLO benchmark: BENCH_N, BENCH_C, BENCH_IN, BENCH_OUT; -- --json for a JSON line; exit 1 when the SLO is missed |
smoke-toolcall | tool-calling contract: non-stream, stream, negative prompt, round trip, parallel calls |
doctor | after an engine upgrade: parser names and /metrics series against the installed version, then smoke-toolcall; prints an issue link on a mismatch |
vram MODEL=/models/x | VRAM and KV budget, concurrency from config.json; GPU_GB, TP, CTX, KV_DTYPE=fp8 |
flags Q=<word> | grep the installed engine's --help (RUNTIME=vllm or sglang) |
Profiles and their variables: skills/roofline-toolbox/profiles/README.md.
Priority, highest first: task variable (task serve INFER_PROFILE=x), environment, inference.env in the current directory, built-in default.
| Variable | Meaning | Default |
|---|---|---|
INFER_URL | OpenAI-compatible base URL, no /v1 | http://127.0.0.1:8000 |
INFER_API_KEY | bearer token if the server needs one | empty |
INFER_PROFILE | profile name from profiles/ for serve, stop, logs | none |
INFER_STATE_DIR | pid files and logs | ./.inference-state |
SLO_TTFT_P95_MS | bench gate, p95 time to first token | 2000 |
SLO_TPOT_P95_MS | bench gate, p95 time per output token | 60 |
BENCH_N, BENCH_C, BENCH_IN, BENCH_OUT | bench shape: requests, concurrency, input and output tokens | 32, 8, 2048, 256 |
Examples
Real output, cap
// HOW IT'S BUILT
// FILES
4 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
skills/roofline/SKILL.md4.0 KBa3d5a9f91a3aupstream ↗
--- name: roofline description: "Router for the Inference Engineer role on on-prem LLM serving (vLLM/SGLang, OpenAI-compatible endpoint, air-gap). Use when the user asks what to do first with a local LLM server, how to approach a serving task, which skill, task or agent to use, what is inside or outside the inference engineer role, or talks about LLM serving, GPU inference, inference engineering in general terms." license: MIT --- # Inference Engineer: where to start The role as roadmap.sh defines it: make the model answer fast, cheaply and predictably in production. The stack in this package: on-prem GPU, vLLM or SGLang, an OpenAI-compatible endpoint, Claude Code and Qwen Code clients through a proxy. Code and weights never leave the perimeter. ## First five minutes ```bash task -t ${CLAUDE_SKILL_DIR}/../roofline-toolbox/Taskfile.yml status # gpu + health + models task -t ${CLAUDE_SKILL_DIR}/../roofline-toolbox/Taskfile.yml metrics # queue, KV, prefix cache, p95 ``` No server yet: skill `roofline-runtime`. The server exists but does not respond or has degraded: `roofline-incident`. Everything works and you need it faster: `roofline-perf`. ## Where to go for each request | Request | Handled by | |---|---| | bring up, restart, choose vLLM or SGLang, write a profile | skill `roofline-runtime`, `task serve/stop/logs/flags` | | tool calls arrive as plain text, parser, chat template, connect Claude Code or Qwen Code | skill `roofline-toolcall`, `task smoke-toolcall` | | slow, OOM under load, quantization, KV, batching, bench | skill `roofline-perf`, `task bench/vram/metrics` | | server is down, queue, p95 above SLO, broke after an upgrade | skill `roofline-incident`, then the `incident-investigator` agent for a long log review | | how many GPUs, how many users, rollout and rollback plan | skill `roofline-capacity`, `task vram` | | what the GPU can do right now, which models are up | `task gpu`, `task models` | The `incident-investigator` agent is only for investigations that need long log reads or metric comparisons over hours: it runs in its own context and returns a digest. ## Role boundaries In scope: serving, runtime flags, KV cache and batching, quantization with quality checks, SLOs and metrics, GPU memory and TP, observability, capacity, rollout. Full map across the 136 roadmap nodes: [references/competency-map.md](references/competency-map.md). Out of scope: training and research, fine-tuning and distillation as the main job (we know when to order them), cloud serving (GKE, SageMaker, HF Endpoints), custom CUDA kernels, image/video/speech pipelines, NVIDIA Dynamo and prefill/decode disaggregation (needed for a multi-node cluster, not for one or two servers). ## Working rules - Measure first, then change: `task metrics` and `task bench` before and after, one variable at a time - Take flags from the installed version: `task flags Q=<word>`, not from memory - After any configuration change: `task health`, `task smoke-toolcall`, `task bench` - After an engine upgrade: `task doctor` - Launch profiles come only from `profiles/`; the Taskfile does not run arbitrary server commands - No SLO or load data: ask, do not guess Theory the other skills rely on (KV cache, sampling, chat format, perplexity), with page numbers from Andriy Burkov, "The Hundred-Page Language Models Book" (page numbers refer to the Russian edition, BHV, 2026): [references/theory-from-burkov.md](references/theory-from-burkov.md). ## Sources - [roadmap.sh: Inference Engineering](https://roadmap.sh/inference-engineering): the role map; every node translated in `docs/roadmap-ru/` - [Claude Code: skills](https://code.claude.com/docs/en/skills), [plugins](https://code.claude.com/docs/en/plugins): package format - [Agent Skills specification](https://agentskills.io/specification): SKILL.md format - Andriy Burkov, "The Hundred-Page Language Models Book" (Russian edition: BHV-Petersburg, 2026, [buy on Ozon](https://www.ozon.ru/product/yazykovye-modeli-bez-lishnih-slov-burkov-andrey-4678629427/)): theory in [references/theory-from-burkov.md](references/theory-from-burkov.md)skills/roofline/references/competency-map.md3.7 KB47829ec5c0f7upstream ↗
# Competency map by roadmap.sh/inference-engineering Source: 136 roadmap nodes (snapshot of 2026-10-07), translated in `docs/roadmap-ru/`. The "Here" column shows what the engineer does in this product (on-prem, vLLM/SGLang, Taskfile). ## In scope | Roadmap group | Nodes | Here | Skill / task | |---|---|---|---| | Latency Metrics | TTFT, ITL, TPS, latency vs throughput, p50/p95/p99, end-to-end | set SLOs, measure p95 TTFT and TPOT, not the mean | perf, `task bench`, `task metrics` | | Inference Phases | prefill (compute-bound), decode (memory-bound), online/offline/async | diagnose the bottleneck by phase | perf, incident | | Application Context | AI-native apps, reasoning models | agents (Claude Code) produce many calls and long prompts; reasoning makes answers longer | capacity, toolcall | | Model Strategy | model selection, evaluation | pick the smallest model that passes product evals and the tool-calling smoke test | capacity, perf | | LLMs | transformer blocks, attention, KV cache, MoE | compute KV per token, understand MoE in a batch (all experts active) | perf, `task vram` | | Bottleneck Analysis | ops:byte, arithmetic intensity, roofline | decode is memory-bound: quantization and batching help, FLOPS do not | perf | | Attention Optimization | FlashAttention, PagedAttention, variants | built into the engines; check the backend, do not write your own | runtime | | GPU Architecture | compute, memory, NVLink, MIG, sizing | sizing: 1 GB per 1B parameters in FP8 plus 50% for KV | capacity, `task gpu` | | GPU Models | Hopper, Blackwell | FP8 on Hopper+, FP4 on Blackwell | perf | | Model Formats | safetensors | safetensors only in air-gap, checksums | runtime, capacity | | Inference Engines | vLLM, SGLang, TensorRT-LLM | vLLM and SGLang; TRT-LLM is not used | runtime | | Benchmarking & Profiling | genai-bench, GenAI-Perf, Locust | our own fixed bench `task bench`, one variable at a time | perf | | Quantization | PTQ, QAT, ModelOpt, quality | FP8 first, AWQ/GPTQ with a tool-calling check | perf | | Speculative Decoding | draft-target, EAGLE, n-gram | n-gram for code, EAGLE at low concurrency | perf | | Caching | prefix cache, KV storage, cache-aware routing, long context | stable system prompt, hit rate in metrics, routing when there are several replicas | perf, capacity | | Model Parallelism | TP, PP, EP, multi-node | TP within a node over NVLink; multi-node is outside the product | runtime, capacity | | Containerization | pinned deps, images | pin vLLM/CUDA/driver versions, image by digest | runtime, capacity | | Autoscaling | continuous batching, cold starts, routing, LoRA-aware, queue | batch limits, queue in metrics, warm-up before rollout | perf, incident | | Testing & Deployment | zero-downtime, cost, observability | canary on a second port, gate: health, smoke, bench | capacity, incident | | Security and Compliance | protecting weights and data | air-gap, no telemetry, token-based access | runtime | ## Out of scope (know it, do not do it) | Roadmap group | Why out of scope | |---|---| | Fine-Tuning, Distillation | the roadmap files them under model strategy: the engineer orders them when a small model fails evals | | CUDA: custom kernels | the engines pick kernels themselves; a kernel of your own is Rust through cudarc (CUDA C compiled by NVRTC at runtime), CubeCL or Rust-CUDA, while production kernels stay CUDA C++ behind FFI | | Multi-Cloud, GPU procurement in the cloud, geo-aware LB | on-prem, a single perimeter | | Disaggregation, NVIDIA Dynamo | needed with dozens of GPUs and prefill-heavy traffic on a cluster | | Image & Video, Speech, Embeddings, VLM | separate pipelines; translated in roadmap-ru for reference | | Local & Edge (Ollama, llama.cpp, mobile) | the product is server-side |skills/roofline/references/theory-from-burkov.md3.2 KB5634d8b88de4upstream ↗
# Theory for the engineer: a digest of Burkov's book Source: Andriy Burkov, "The Hundred-Page Language Models Book: Hands-On with PyTorch"; page numbers refer to the Russian edition (BHV-Petersburg, 2026, 208 pages). Only what changes serving decisions is here; pages are the book's. Russian edition on sale: [Ozon](https://www.ozon.ru/product/yazykovye-modeli-bez-lishnih-slov-burkov-andrey-4678629427/). | Fact from the book | Pages | What it means for serving | |---|---|---| | KV cache: after training the K and V matrices are fixed, so the keys and values of earlier tokens never change; they are computed once and stored. For a new token only its own K and V are computed and appended to the cache. RoPE does not get in the way of caching: the rotation is applied only to the new token at position L+1 | 140-141 | the KV cache is memory, not compute: its size grows linearly with context length and the number of concurrent requests. `task vram` computes the budget | | Plain pairwise attention grows quadratically with sequence length; long context is expensive | 149-159 | prefill of long prompts (Claude Code: 20-100k tokens) is compute-bound; the fix is prefix cache and chunked prefill, not quantization | | The format of roles and answer boundaries must match the training format. ChatML: `<\|im_start\|>role`, text, `<\|im_end\|>`; roles system, user, assistant. One prompt-building function for both training and inference | 164-170 | the chat template in tokenizer_config.json is the model's contract. A foreign or trimmed template breaks tool calling before any parser gets a chance | | Sampling: temperature divides the logits, top-k keeps k candidates, top-p keeps the smallest set whose probability mass is at least p, frequency and presence penalties lower the logits of repeats. Reducing randomness does not verify facts | 174-179 | temperature 0 for benches and smoke tests (reproducibility); speculative decoding loses acceptance rate at high temperature | | Perplexity: the exponent of the mean loss on real tokens; lower is better; compare only on the same data and tokenization | 85-89 | PPL before and after quantization on your own text. Growth above 1-2% is a signal, not noise | | LoRA: the base weights are frozen, a low-rank correction is trained, the base model stays in memory | 179-183 | many LoRAs on one base: route the request to the replica where the adapter is already loaded (roadmap: LoRA-aware routing) | | MoE activates a subset of experts per token | 199 | in a batch nearly all experts are active: count memory for the weights in full, the gain is only in compute per request | | Compression: quantization, pruning, distillation | 200 | quantization is the only one the serving engineer does; distillation is an order for the ML team | | A jailbreak bypasses the model's restrictions, prompt injection inserts commands through external data | 201-202 | a tool-calling agent executes injections from tool results; the defense lives in the client and the proxy, not the engine | | Instruction tuning does not guarantee factual correctness; the model's explanation does not prove how the answer was produced | 155, 192 | evals and smoke tests verify behavior, not the model's statements about itself |README.mdupstream ↗
Contents are not inlined in the catalog. Open the upstream file.
Plain-text copy, no login: /skill-bundles/lenialno-roofline-skills-roofline.md