sglang: Skill for Claude Code

.agents/skills/generate-profile/SKILL.md

generate-profile is a skill for Claude Code, Codex from sgl-project/sglang. It costs 38 tokens per session (1,295 once invoked), scanned A, original, Apache-2.0.

A guide for creating an end-to-end performance trace of an SGLang language-model server run. The trace can be opened in Chrome's tracing tools to inspect timing.

In plain words
What is it for?
Use it to launch a server on a CUDA GPU, wait for its health endpoint, validate a model request, capture the trace, and obtain the profile file path.
Why use it?
It combines server startup, readiness checks, a quick accuracy check, and trace capture so the profile represents a validated serving run.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is sgl-project/sglang's own configuration. It tells Claude Code and Codex how to work on sglang itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything sglang configures →

About the project

SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.

sgl-project/sglang · 38,324 stars · on GitHub · sglang.io

Reuse

Borrowing it

Nothing to install: this file belongs to sgl-project/sglang. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sgl-project/sglang/main/.agents/skills/generate-profile/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-profile

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/generate-profile/github.svg)](https://agentmods.dev/skills/sgl-project/sglang/generate-profile)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/generate-profile"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/generate-profile/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-profile

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/generate-profile"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/generate-profile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01295
Opus 5.5 $0.00015 $0.00518
Sonnet 5.5 $0.00008 $0.00259
Haiku 4.5 $0.00004 $0.00129

Measured 14d ago against content hash 6c28b99d93aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

generate-profile scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

if curl -s http://127.0.0.1:<port>/health 2>/dev/null | grep -q "ok\|healthy"; then
.agents/skills/generate-profile/SKILL.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generate an E2E Profile of an SGLang Server Run

This skill launches an SGLang server, validates it with a quick accuracy test, generates a profiling trace, and returns the profile file path.

Prerequisites

  • A working SGLang installation (pip install -e . or equivalent)
  • At least one available CUDA GPU
  • The sgl-eval CLI, installed in its own virtualenv as described in .claude/rules/prefer-sgl-eval.md, not in the server's env

Step-by-step Workflow

Step 1: Launch the server

CUDA_VISIBLE_DEVICES=<gpu_id> sglang serve --model-path <model> --port <port> &
  • Default model: Qwen/Qwen3-8B (good balance of speed and quality)
  • Default port: 30000
  • The server runs in the background. Save the PID for cleanup.
  • Use the GPU specified by the user's preferences (check memory files for GPU preferences).

Step 2: Wait for server readiness

Poll the health endpoint until the server is ready:

for i in $(seq 1 120); do
  if curl -s http://127.0.0.1:<port>/health 2>/dev/null | grep -q "ok\|healthy"; then
    echo "Server ready"
    break
  fi
  sleep 5
done

The server prints "The server is fired up and ready to roll!" to stdout when ready. The health endpoint returns 200 once the server can accept requests.

Typical startup time: 30-90 seconds depending on model size and whether CUDA graphs are being compiled.

Step 3: Validate accuracy (sanity check)

sgl-eval run gsm8k --base-url http://127.0.0.1:<port>/v1 --num-examples 20
  • Expected score: > 80% for capable models (Qwen3-8B, Llama-3.1-8B-Instruct, etc.)
  • This is a quick sanity check, not a rigorous benchmark.
  • If accuracy is unexpectedly low, something is wrong — do not proceed to profiling.

Step 4: Generate the profile

python3 -m sglang.test.send_one --profile

This command:

  1. Sends a request to the server
  2. Triggers the profiler for 5 steps (default)
  3. Generates a trace file under /tmp/<timestamp>/
  4. The trace directory contains:
    • <timestamp>-TP-0.trace.json.gz — Chrome trace format (open in chrome://tracing or Perfetto)
    • server_args.json — the server configuration used

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed · +1 lines 6c28b99d93aa
  2. 1mo ago Changed · -2 lines 0d8a29a88eef
  3. 2mo ago First seen · 144 lines · 38 tokens per session scan A 0fcd80691c8c

Subscribe to this mod's changes

generate-profile is a skill published in the GitHub repository sgl-project/sglang (38,324 stars, last pushed today), licensed Apache-2.0. It adds 38 tokens to every session and 1,295 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

groq-inference

Ultra-fast LLM inference on custom LPU hardware. OpenAI-compatible API at api.groq.com. Lowest latency in the industry (500-1000+ tok/s). Supports chat completions, vision, audio (Whisper STT + TTS), tool calling, JSON mode, and streaming. Free tier available. Inference only — no training.

synthetic-sciences/openscience · 77 tokens

perf-optimize

Launch and operate this repo's perf-optimize workflow, which iteratively APPLIES TensorRT-LLM serving optimizations — baseline benchmark at one concurrency or a Pareto curve of them (tok/s/user vs tok/s/gpu), analytical SOL projection on by default (via the internal-perf-sol-analysis skill) sizing the headroom the…

NVIDIA/TensorRT-LLM · 224 tokens

perf-analyze

Launch and operate this repo's perf-analyze workflow, which DIAGNOSES a TensorRT-LLM serving deployment without applying changes — benchmark at one concurrency or a Pareto curve of them (tok/s/user vs tok/s/gpu), analytical SOL projection on by default (via the internal-perf-sol-analysis skill), nsys + ncu per-kernel…

NVIDIA/TensorRT-LLM · 159 tokens

fireworks-ai-inference

Fast inference and fine-tuning platform with serverless and on-demand GPU deployments. OpenAI-compatible API for chat completions, embeddings, function calling, vision, and structured output. Supports SFT, DPO, and RL fine-tuning. SOC2 + HIPAA compliant.

synthetic-sciences/openscience · 62 tokens

vllm

Use when self-hosting an OpenAI-compatible LLM endpoint with vLLM 0.32 — vllm serve, offline LLM.generate / llm.chat, PagedAttention with continuous batching and prefix caching, --tensor-parallel-size / --pipeline-parallel-size, AWQ/GPTQ/FP8 quantization, or wiring LangChain/LlamaIndex clients at…

znlgis/opengis-skills · 121 tokens

llm-kv-cache-paged-attention

Use this skill when the user says 'KV cache', 'PagedAttention', 'vLLM memory', 'gpumemoryutilization', 'prefix caching', 'max concurrent sequences', 'KV cache size', 'context length OOM'. Explains KV cache memory math and how paged allocation, prefix caching, KV quantization, and attention variants (MQA/GQA/MLA)…

j4flmao/agent-skills · 150 tokens