sgl-project/rbg
Kubernetes controller for coordinating multi-role LLM inference workloads
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
RoleBasedGroup (RBG) is a Kubernetes control plane for inference workloads, not an inference engine. A workloads.x-k8s.io/v1alpha2 RoleBasedGroup models a service as named roles, each with its own replica count, Pod template, and lifecycle settings. Dependencies gate startup on role readiness. RoleInstance groups Pods that share a lifecycle and supports in-place updates; RoleInstanceSet is the preferred workload type. CoordinatedPolicy is a separate CRD for operations that span roles.
The Go module is sigs.k8s.io/rbgs and declares Go 1.25.0, Kubernetes API and client libraries at v0.34.2, and OpenKruise v1.8.3. The tree separates API definitions (api/), client code (client-go/), and command entrypoints (cmd/). The image runs /manager and also ships kubectl-rbg. The integration boundary is the Kubernetes API and the Pod templates: RBG defines how the workload is organized and reconciled, while the containers implement model serving.
Key Capabilities & Differentiators
A role can use standalonePattern for one Pod per instance or leaderWorkerPattern for a distributed replica with a leader and workers. This lets a service mix single-Pod roles with multi-node tensor-parallel roles. Reusable role templates accept role-specific patches. RoleID injection and built-in discovery give workloads stable role identities and a way to discover peers; CoordinatedPolicy exposes maxSkew and progression for cross-role rollouts and scaling.
The SGLang examples cover both aggregated and prefill/decode-disaggregated serving. Dynamo examples cover both layouts, including multi-node variants. Mooncake examples cover KV-cache reuse and separate transfer-engine configurations for SGLang and vLLM. Topology-aware placement is intended to account for GPU interconnect and network locality, while gang-scheduling examples use Volcano or scheduler-plugins. These mechanisms help express placement and coordination requirements; they do not establish a throughput or latency improvement on a given cluster.
Trade-offs & Limitations
Compared with independent Deployments or StatefulSets, RBG makes startup dependencies, coordinated rollouts, and linked recovery part of the workload model rather than leaving them to scripts or operators. LeaderWorkerSet addresses the leader-worker grouping problem; RBG adds coordination among distinct roles that may have different replica layouts. For a single inference server, or for services whose roles can safely evolve independently, the native primitives are usually the simpler choice.
The cost is an additional controller, custom resources and webhooks, and an API migration path to manage. Compatibility mode keeps existing legacy workloads reconciling but rejects new uses; strict mode removes the corresponding watches and permissions and rejects legacy types on create and update. Gang scheduling and placement constraints can also leave replicas pending if the cluster cannot satisfy them, so validate scheduling with realistic GPU inventory. Apache-2.0 covers RBG itself, not the terms of model weights or third-party runtime images.
Hardware & Deployment Guide
Self-host on Kubernetes using Helm and pin the release chart after checking its compatibility guidance. The compatibility table lists v0.7.0 with Kubernetes v1.22.x or later and no LeaderWorkerSet requirement; v0.6.0 lists Kubernetes v1.28.x or later and LeaderWorkerSet v0.7.0 or later. Do not extrapolate that matrix to newer tags. The Docker build uses Go 1.26.6, produces the manager and CLI with make build and make build-cli, and ships them on Alpine. /manager runs as UID/GID 65532; a replacement base image must preserve /bin/sleep for the manager's preStop hook.
For new clusters, disable deprecated workload types and use RoleInstanceSet. On upgrades with legacy roles, keep compatibility mode until migration and reconciliation have completed and old RBG-owned workloads are gone, then disable it. The v0.7.0 milestone introduced conversion webhooks, coordinated policies, and gang scheduling alongside v1alpha2. The v0.9.0 alpha series separately records work on webhook shutdown draining, exclusive topology scheduling, and RoleInstance restart-budget handling. For GPU serving, provision the engine images, model artifacts, GPU capacity, and network independently of the controller.
Kubernetes platform teams deploying prefill/decode-disaggregated or multi-node inference that needs role-aware placement, controlled startup, and coordinated rollouts or scaling.
You need a model server or hosted inference API, or your workload is a single role that a Deployment or StatefulSet can manage without cross-role policies.
Quick Start & Installation
VERSION=$(curl -sL https://api.github.com/repos/sgl-project/rbg/releases/latest | grep '"tag_name"' | sed -E 's/.*"v([^"]+)".*/\1/') helm upgrade --install rbgs https://github.com/sgl-project/rbg/releases/download/v$VERSION/rbgs-$VERSION.tgz \ --namespace rbgs-system --create-namespace --wait
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| rbg ★ | 318 | — | Go | Apache-2.0 | Kubernetes controller for coordinating multi-role LLM inference workloads |
| transformers | 169.6k | +337 | Python | Apache-2.0 | A PyTorch model-definition SDK for unified inference and training across modalit |
| langchaingo | 9.8k | +11 | Go | MIT | A Go SDK for composing LLM calls, retrieval, and tools inside applications |
| pytorch | 105.9k | +299 | Python | — | Python-first tensor SDK for GPU-accelerated training and inference |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/sgl-project/rbg.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about rbg
How do I wire a prefill/decode-disaggregated service into RBG?
How much GPU memory does RBG require?
Can we self-host RBG commercially or in a restricted network?
When should we choose RBG over Deployment, StatefulSet, or LeaderWorkerSet?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy