large-class-style

large-class-style is a skill for Claude Code from sgl-project/sglang. It costs 51 tokens per session (1,800 once invoked), scanned A, original, Apache-2.0.

A code-style guide for SGLang's Scheduler, TokenizerManager, and ModelRunner classes, which coordinate request scheduling, token handling, and model execution.

In plain words
What is it for?
Use it when changing or reviewing those three classes, especially to decide what belongs in the orchestrator and what belongs in a separate collaborator.
Why use it?
It keeps these large coordination files focused on wiring and sequencing instead of accumulating business logic, making ownership and testing clearer.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

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,516 stars · on GitHub · sglang.io

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.

agentmods
npx agentmods add skills/sgl-project/sglang/large-class-style
Any agent
npx skills add sgl-project/sglang --skill large-class-style
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 large-class-style

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/large-class-style.svg)](https://agentmods.dev/skills/sgl-project/sglang/large-class-style)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/large-class-style"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/large-class-style.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00051 $0.01800
Opus 5 $0.00026 $0.00900
Sonnet 5 $0.00010 $0.00360
Haiku 4.5 $0.00005 $0.00180

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

Security

Grade A, and why

large-class-style scanned grade A with 0 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/large-class-style/SKILL.md · 140 lines

How it starts

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

Code Style for Scheduler / TokenizerManager / ModelRunner

Conventions for SGLang's three large classes:

  • Schedulerpython/sglang/srt/managers/scheduler.py
  • TokenizerManagerpython/sglang/srt/managers/tokenizer_manager.py
  • ModelRunnerpython/sglang/srt/model_executor/model_runner.py

1. Frozen Code

  • Some core files are frozen: orchestration-only — a thin composition root that constructs collaborators, wires them, delegates to them, and coordinates the calls. They must stay that way.
  • Domain logic does not belong in a frozen file; it lives in a collaborator class in its own module.

1.1 Why

  • The file is a thin orchestrator over collaborator classes; freezing keeps it that way and stops it growing back into a god class.
  • Keeping domain logic in collaborators (their own files) is what makes per-file code ownership, single responsibility, and unit testing possible.
  • The orchestrator is the composition root: it may know about every collaborator, because wiring and sequencing them is its job. Coordination stays here — domain logic does not.

1.2 Frozen files

  • python/sglang/srt/model_executor/model_runner.py

1.3 Allowed: orchestration

Every statement refers to a collaborator and is one of:

  1. Construct — a short init_<thing> helper whose body is essentially a single construction (follows §2); use maybe_init_<thing> with a one-line gate when conditional.
  2. Wire — a short call that runs the helper from the orchestrator (e.g. in __init__).
  3. Delegate — calls to a collaborator's methods at the necessary call sites (self.foo.run(...)).
  4. Coordinate — the minimal control flow that selects or orders the above: an if choosing whether / which collaborator to wire or call, the order of calls, threading one call's result into the next.
  • Heuristic: a statement is allowed only if it constructs, wires, delegates, or selects/orders those — never if it computes or transforms a value beyond passing arguments and results through.

Read the full file on GitHub · 140 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. 6d ago First seen · 140 lines · 51 tokens per session scan A e4c7ffb53e47

Subscribe to this mod's changes

large-class-style is a skill published in the GitHub repository sgl-project/sglang (35,516 stars, last pushed today), licensed Apache-2.0. It adds 51 tokens to every session and 1,800 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. 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

perf-host-analysis

Analyze host/CPU overhead in TensorRT-LLM inference from nsys traces. Detect whether host overhead is the bottleneck using GPU idle ratio, host prep exposed ratio, and per-phase evidence. For regressions, isolate forward steps via allreduce/NVTX patterns, compare host operation breakdowns across versions, and identify…

NVIDIA/TensorRT-LLM · 171 tokens

perf-host-optimization

Profiles and optimizes TensorRT-LLM host/CPU overhead using lineprofiler (with nsys support planned). Runs iterative profile-analyze-optimize-validate rounds. Use when GPU utilization is low or optimizing PyExecutor throughput.

NVIDIA/TensorRT-LLM · 52 tokens

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

mooncake-api

Help users work with the Mooncake Python APIs for distributed storage and high-performance data transfer. Use when working with Mooncake Store (distributed KV cache), Transfer Engine (RDMA/TCP transfers), service setup (master, metadata server), PyTorch tensors in the Store, zero-copy/buffer management, batch…

kvcache-ai/Mooncake · 122 tokens

mooncake-troubleshoot

Automatically diagnose Mooncake deployment and runtime issues. Checks services (mooncakemaster, metadata server), RDMA devices, environment variables, connectivity, memory limits, object integrity, and analyzes logs for common error patterns. Use when Mooncake deployment fails, services won't start, connections fail…

kvcache-ai/Mooncake · 134 tokens

release-notes

Draft concise release notes.

ollama/ollama · 9 tokens