sglang: Skill for Claude Code

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

generate-profile is a skill for Claude Code from sgl-project/sglang. It costs 38 tokens per session (1,317 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 Code

Written for Claude Code: installed under .claude/.

This is sgl-project/sglang's own configuration. It tells Claude Code 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 · 35,551 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/.claude/skills/generate-profile/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

Made for: Claude Code.

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.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.svg" alt="Measured on agentmods" 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,317 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.01317
Opus 5 $0.00019 $0.00659
Sonnet 5 $0.00008 $0.00263
Haiku 4.5 $0.00004 $0.00132

Measured 8d ago against content hash 0fcd80691c8c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 8d 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
.claude/skills/generate-profile/SKILL.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 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

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)

python3 -m sglang.test.run_eval --host 127.0.0.1 --port <port> --eval-name gsm8k --num-examples 20
  • Expected accuracy: > 0.8 for capable models (Qwen3-8B, Llama-3.1-8B-Instruct, etc.)
  • This is a quick sanity check, not a rigorous benchmark.
  • sglang.test.few_shot_gsm8k is deprecated; use the unified run_eval entrypoint.
  • If you intentionally need the old completion-style GSM8K path, add --api completion.
  • 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 · 144 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. 8d 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 (35,551 stars, last pushed today), licensed Apache-2.0. It adds 38 tokens to every session and 1,317 once invoked, about $0.0002 per session on Opus 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

llama-factory

Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.

davila7/claude-code-templates · 51 tokens

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 · 228 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 + torch-profiler…

NVIDIA/TensorRT-LLM · 163 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

ort

ONNX Runtime in Rust via the ort crate (2.x): loading sessions, configuring CPU/CoreML/CUDA execution providers, tensor I/O with ndarray, async-safe spawnblocking wrapping, global thread-pool init, and debugging provider/opset issues.

bobmatnyc/claude-mpm-skills · 54 tokens