sglang-xpu-run

sglang-xpu-run is a skill for Claude Code from intel/gpu-ai-skills. It costs 170 tokens per session (4,217 once invoked), scanned D, original, Apache-2.0.

A way to run a Hugging Face model on an Intel GPU with SGLang, a model-serving system that provides an OpenAI-compatible API.

In plain words
What is it for?
Use it to discover Intel GPUs, prepare the required environment, and serve a safetensors model through SGLang's API.
Why use it?
It helps avoid accidentally running inference on the CPU and provides guidance for Intel GPU, Docker, driver, and memory setup.

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 to discover Intel GPUs, prepare the required environment, and serve a safetensors model through SGLang's API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/intel/gpu-ai-skills/sglang-xpu-run
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-run
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-run/plugin install sglang-xpu-run 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-run

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/intel/gpu-ai-skills/sglang-xpu-run"><img src="https://agentmods.dev/badge/skills/intel/gpu-ai-skills/sglang-xpu-run.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 170 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,217 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.00170 $0.04217
Opus 5 $0.00085 $0.02108
Sonnet 5 $0.00034 $0.00843
Haiku 4.5 $0.00017 $0.00422

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

Security

Grade D, and why

sglang-xpu-run scanned grade D with 3 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

`--privileged`. vLLM images run as root and skip this issue — that's

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.

curl -s http://127.0.0.1:30000/v1/models | python3 -m json.tool

Makes network callslowCapability

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

curl -sf http://127.0.0.1:30000/v1/models >/dev/null && break
plugins/intel-gpu-ai-skills/skills/sglang-xpu-run/SKILL.md · 333 lines

How it starts

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

sglang-xpu-run

SGLang's XPU backend is functional. Use the pre-built intel/sglang-dev:latest image. Verify GPU detection before serving; SGLang silently falls back to CPU and you'll only notice when throughput is 50× lower than expected.

If you don't specifically need RadixAttention prefix caching or grammar-constrained output, prefer vllm-xpu-run — its Intel coverage is broader today.

Step 0 — discover GPUs and host RAM before anything else

Run xpu-discover first, or at minimum:

# GPU inventory
xpu-smi discovery

# Count cards and host RAM — used to size the build and ZE_AFFINITY_MASK
GPU_COUNT=$(xpu-smi discovery 2>/dev/null | grep -cE "^\| +[0-9]|Device [0-9]+:")
[ "${GPU_COUNT:-0}" -gt 0 ] || GPU_COUNT=1
RAM_GB=$(awk '/MemTotal/{print int($2/1024/1024)}' /proc/meminfo)
RENDER_GID=$(getent group render 2>/dev/null | cut -d: -f3)
RENDER_GID=${RENDER_GID:-$(stat -c '%g' /dev/dri/renderD128 2>/dev/null)}
echo "GPUs: $GPU_COUNT  RAM: ${RAM_GB} GB  render GID: $RENDER_GID"

Use GPU_COUNT to set ZE_AFFINITY_MASK and --tp; use RAM_GB to set MAX_JOBS for the build; use RENDER_GID in every docker run command below.

CUDA → XPU cheat sheet

CUDA Intel
lmsysorg/sglang:latest intel/sglang-dev:latest
--gpus all --privileged --device /dev/dri -v /dev/dri/by-path:/dev/dri/by-path --group-add <render-gid>
--device cuda (implicit) --device xpu + --attention-backend intel_xpu
--tp 2 --tp 2 + ZE_AFFINITY_MASK=0,1
--quantization awq silently broken on XPU (HTTP 200, garbage content)
--quantization fp8 works (runtime BF16→FP8 weight conversion)
no env vars needs SYCL_UR_USE_LEVEL_ZERO_V2=0 on Battlemage

Pull the image

docker pull intel/sglang-dev:latest

Use intel/sglang-dev:latest in all docker run commands below.

Pre-flight: verify XPU is visible inside the container

RENDER_GID=$(getent group render 2>/dev/null | cut -d: -f3)
RENDER_GID=${RENDER_GID:-$(stat -c '%g' /dev/dri/renderD128 2>/dev/null)}

docker run --rm \
    --privileged --network host --ipc=host --shm-size=32g \
    --device /dev/dri \
    -v /dev/dri/by-path:/dev/dri/by-path \
    --group-add "$RENDER_GID" \
    -e ZE_AFFINITY_MASK=0 \
    -e SYCL_UR_USE_LEVEL_ZERO_V2=0 \
    --entrypoint /bin/bash \
    intel/sglang-dev:latest \
    -lc 'CONDA_SH=$(find /home /root /opt -maxdepth 5 -name activate -path "*/miniforge*/bin/activate" 2>/dev/null | head -1); \
         . "${CONDA_SH:-$HOME/miniforge3/bin/activate}" && \
         conda activate py3.12 && \
         source /opt/intel/oneapi/setvars.sh --force >/dev/null && \
         python -c "import torch; n=torch.xpu.device_count(); \
                    print(\"xpu count:\", n); \
                    assert n>0, \"NO XPU VISIBLE\""'

Read the full file on GitHub · 333 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 333 lines · 170 tokens per session scan D 8b1c31737206

Subscribe to this mod's changes

sglang-xpu-run is a skill published in the GitHub repository intel/gpu-ai-skills (21 stars, last pushed 6d ago), licensed Apache-2.0. It adds 170 tokens to every session and 4,217 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, 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

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

google-cloud-solution-agentic-analytics-spark-knowledge-catalog

Discovers requirements and generates guidance to design and deploy a governed, secure agentic-analytics solution for data that's distributed across Google Cloud, other cloud providers, or on-premises. Data that's outside Google Cloud (such as data from Databricks, Snowflake, Salesforce, SAP, or Oracle systems) is…

google/skills · 138 tokens

training-check

Interactively monitor training metrics from the current Codex session, periodically checking WandB or fallback logs for NaN, divergence, plateaus, and broken runs.

wanshuiyin/Auto-claude-code-research-in-sleep · 35 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens