rbg-api is the standalone API types library for RoleBasedGroup (RBG) — a Kubernetes operator for managing role-based LLM inference workloads (e.g., prefill/decode disaggregation).
This repository is intended to be imported by upper-layer business systems that need to interact with RBG resources via the Go client, without depending on the full operator codebase.
| rbg-api Version | RBG Release | API Versions | Latest API |
|---|---|---|---|
| v0.9.0-alpha.2 | v0.9.0-alpha.2 | v1alpha1, v1alpha2 | v1alpha2 |
| v0.9.0-alpha.1 | v0.9.0-alpha.1 | v1alpha1, v1alpha2 | v1alpha2 |
| v0.8.0 | v0.8.0 | v1alpha1, v1alpha2 | v1alpha2 |
| v0.8.0-alpha.5 | v0.8.0-alpha.5 | v1alpha1, v1alpha2 | v1alpha2 |
| v0.7.0-alpha.3 | v0.7.0-alpha.3 | v1alpha1, v1alpha2 | v1alpha2 |
Important: Due to the module path (sigs.k8s.io/rbgs/api) being different from the repository host (github.com/sgl-project/rbg-api), direct go get will fail.
Add the following to your go.mod file:
require sigs.k8s.io/rbgs/api v0.8.0-alpha.5
replace sigs.k8s.io/rbgs/api => github.com/sgl-project/rbg-api v0.8.0-alpha.5Then run:
go mod tidyDirect GitHub imports are not supported because the module path and repository path do not match.
import (
"sigs.k8s.io/rbgs/api/workloads/v1alpha2"
"sigs.k8s.io/rbgs/api/workloads/constants"
)See the examples directory for a complete working example that demonstrates:
- Creating RoleBasedGroup objects
- Getting RoleBasedGroup objects
- Updating RoleBasedGroup objects (e.g., modifying replicas)
- Listing all RoleBasedGroup objects
- Deleting RoleBasedGroup objects
Run the example:
cd examples
go run main.go -kubeconfig=/path/to/kubeconfigThis repository provides the following Kubernetes CRD Go types under workloads/v1alpha2:
RoleBasedGroup(RBG) - Main CRD for managing role-based workloads with multiple rolesRoleBasedGroupSet(RBGS) - Set of RoleBasedGroups for managing multiple RBGs as a unitRoleInstance(RI) - Individual role instance representing a single replicaRoleInstanceSet(RIS) - Set of RoleInstances for managing role replicas
RoleBasedGroupScalingAdapter(RBGSA) - Scaling adapter for external metrics-based autoscalingCoordinatedPolicy(CPolicy) - Coordination policy for rolling updates and scaling across multiple roles
ClusterEngineRuntimeProfile(CERP) - Cluster-scoped engine runtime profile for container injection