sglang-xpu-bench

sglang-xpu-bench is a skill for Claude Code from intel/gpu-ai-skills. It costs 93 tokens per session (4,122 once invoked), scanned C, original, Apache-2.0.

A benchmarking tool for a running SGLang language-model server on an Intel GPU. It measures how quickly requests begin and finish, along with request speed and overall capacity.

In plain words
What is it for?
Use it after starting an SGLang server to check the endpoint and measure time to first output, time between outputs, total latency, and throughput.
Why use it?
It helps reveal whether the server is using the intended Intel GPU and how it performs under serving requests.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the intel-gpu-ai-skills plugin — 21 skills, 1 agent shipped together

Good fit Use it after starting an SGLang server to check the endpoint and measure time to first output, time between outputs, total latency, and throughput.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/intel/gpu-ai-skills/sglang-xpu-bench
About the project

Intel GPU AI Skills is a collection of agent skills for setting up, running, benchmarking, and profiling Hugging Face models on Intel GPUs. It supports workflows involving PyTorch, vLLM-XPU, SGLang-XPU, llama.cpp-SYCL, and migration from CUDA to XPU. The catalogue contains the project's skills, instructions, agent, and plugin.

intel/gpu-ai-skills · 21 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add intel/gpu-ai-skills --skill sglang-xpu-bench
Clone the repo
git clone --depth 1 https://github.com/intel/gpu-ai-skills

Made for: Claude Code.

Or install intel-gpu-ai-skills, the plugin that ships this one along with the rest of its 21 skills, 1 agent.

Its marketplace also offers this one on its own, as the plugin sglang-xpu-bench/plugin install sglang-xpu-bench after adding the marketplace above.

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 sglang-xpu-bench

README.md
[![agentmods](https://agentmods.dev/badge/skills/intel/gpu-ai-skills/sglang-xpu-bench/github.svg)](https://agentmods.dev/skills/intel/gpu-ai-skills/sglang-xpu-bench)
Your own site
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/sglang-xpu-bench"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/sglang-xpu-bench/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 sglang-xpu-bench

Your own site · 80×15
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/sglang-xpu-bench"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/sglang-xpu-bench.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,122 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00093 $0.04122
Opus 5 $0.00046 $0.02061
Sonnet 5 $0.00019 $0.00824
Haiku 4.5 $0.00009 $0.00412

Measured 11d ago against content hash 1c456eb5918e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

sglang-xpu-bench scanned grade C with 2 findings 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 11d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

MODEL=$(docker exec "$CONTAINER_NAME" curl -s http://127.0.0.1:$SGLANG_PORT/v1/models | python3 -c "import sys,json; print(json.load(sys.stdin)['data'][0]['id'])")

Makes network callslowCapability

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

if ! docker exec "$CONTAINER_NAME" curl -s http://127.0.0.1:$SGLANG_PORT/v1/models >/dev/null 2>&1; then
plugins/intel-gpu-ai-skills/skills/sglang-xpu-bench/SKILL.md · 334 lines

How it starts

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

sglang-xpu-bench

sglang.bench_serving is SGLang's online benchmark client (the counterpart to vllm bench serve). Speaks the OpenAI-compatible API exposed by sglang-xpu-run.

Step 0 — verify SGLang server is running on Intel XPU

REQUIRED: Before benchmarking, you must confirm a SGLang server is running, identify its port, and verify it's using Intel XPU (not CPU fallback, not NVIDIA). This prevents benchmarking a server that silently fell back to CPU.

Run the checks below in a single shell session (later blocks reuse $SGLANG_PID, $SGLANG_PORT, $MODEL from earlier ones).

Find the server process and its container:

# 1. Check if SGLang is running and find its container
SGLANG_PID=$(ps aux | grep -iE 'sglang|launch_server' | grep -v grep | awk 'NR==1 {print $2}')
if [ -z "$SGLANG_PID" ]; then
    echo "❌ No SGLang server found running. Start one with sglang-xpu-run."
    exit 1
fi
echo "✓ SGLang server found (PID: $SGLANG_PID)"

CONTAINER_NAME=$(docker ps --format '{{.Names}}' 2>/dev/null | while read name; do
    if docker top "$name" -o pid 2>/dev/null | awk 'NR>1' | grep -qxF "$SGLANG_PID"; then echo "$name"; break; fi
done)
if [ -z "$CONTAINER_NAME" ]; then
    echo "❌ No container matched PID $SGLANG_PID. This skill runs the bench client"
    echo "   via 'docker exec' because the sglang package is only installed inside"
    echo "   the server container. A host-only SGLang install is not supported here."
    exit 1
fi
echo "✓ SGLang container: $CONTAINER_NAME"

Read the launch args once — they give you both the container-internal port and the --device flag. The bench client runs via docker exec inside the container, so the port must be the one SGLang binds inside the container (host ss can't see the container-namespaced socket). The --device xpu check is REQUIRED — it catches a server that silently fell back to CPU:

# 2. Read port + device from the launch args in one pass (REQUIRED)
ARGS=$(ps -p "$SGLANG_PID" -o args=)
SGLANG_PORT=$(echo "$ARGS" | awk '{for(i=1;i<=NF;i++) if($i=="--port" && i<NF) print $(i+1)}' | head -1)
SGLANG_PORT=${SGLANG_PORT:-30000}   # sglang default
DEVICE_ARG=$(echo "$ARGS" | awk '{for(i=1;i<=NF;i++) if($i=="--device" && i<NF) print $(i+1)}' | head -1)
echo "DEVICE_ARG=${DEVICE_ARG:-none}"
if [ "$DEVICE_ARG" = "cuda" ]; then
    echo "❌ Server is on NVIDIA CUDA, not Intel XPU."; exit 1
elif [ "$DEVICE_ARG" = "xpu" ]; then
    echo "✓ SGLang server has --device xpu"
else
    echo "⚠️  Could not confirm --device xpu (got: '${DEVICE_ARG:-none}'); relying on XPU memory check."
fi

# 3. Verify reachable from inside the container and read model name
if ! docker exec "$CONTAINER_NAME" curl -s http://127.0.0.1:$SGLANG_PORT/v1/models >/dev/null 2>&1; then
    echo "❌ SGLang server not responding on container port $SGLANG_PORT."
    exit 1
fi
MODEL=$(docker exec "$CONTAINER_NAME" curl -s http://127.0.0.1:$SGLANG_PORT/v1/models | python3 -c "import sys,json; print(json.load(sys.stdin)['data'][0]['id'])")
echo "✓ Responding on container port $SGLANG_PORT — model: $MODEL"

Read the full file on GitHub · 334 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. 11d ago First seen · 334 lines · 93 tokens per session scan C 1c456eb5918e

Subscribe to this mod's changes

sglang-xpu-bench is a skill published in the GitHub repository intel/gpu-ai-skills (21 stars, last pushed 6d ago), licensed Apache-2.0. It adds 93 tokens to every session and 4,122 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens