Skip to content

Decision record · ADR

ADR-0058: Lower the SMG frontend in a shared inferlab-gateway-smg package under the backend name smg

Status: accepted | Date: 2026-10-03

References: ADR-0022, RFC-0003, RFC-0006

Two integrations render the SMG frontend. TokenSpeed prefill/decode (RFC-0003:C-TOKENSPEED-PREFILL-DECODE) runs SMG as a fused Gateway and P/D Router over gRPC prefill and decode workers; the Specialized Engine integration runs SMG as the routed-single Gateway in front of one token Engine. Each built the smg launch command, readiness, and implementation identity on its own, and the copies diverged: TokenSpeed selected the backend name tokenspeed-smg, launched python3 -m smg launch, and recorded the adapter version as the implementation version, while the Specialized Engine selected smg, launched the smg console script, and recorded the installed tokenspeed-smg distribution version. Which SMG ran and how it was launched therefore had two authorities. Every observed workspace environment that runs the SMG Gateway installs it from the tokenspeed-smg distribution, which provides the smg console script. The adapter SDK is framework-neutral and is consumed by every integration.

SMG frontend lowering moves into a new workspace-side Python package, inferlab-gateway-smg, which depends only on the adapter SDK. It owns the backend name smg, used for both the Gateway and the P/D Router, the implementation identity smg with the version of the installed tokenspeed-smg distribution, the smg launch command with the options every SMG frontend shares, the routed-single and prefill/decode target forms, the Gateway readiness probe, and the P/D Router worker-registry readiness that mirrors SMG’s /workers schema. The integrations keep what their qualification decides: worker commands, routing policy, the public endpoint capabilities they declare, and every other setting. The former TokenSpeed backend name tokenspeed-smg is rejected during resolution with a hint to select smg, rather than kept as an alias.

Both integrations record the same SMG identity and launch SMG the same way, so a frontend fact recorded for one reads the same for the other, and an SMG launch change lands once. TokenSpeed prefill/decode workspaces must rename tokenspeed-smg to smg in their Gateway and P/D Router selection; an unrenamed workspace fails resolution with that instruction. TokenSpeed frontend evidence now records the SMG distribution version instead of the adapter version, which the integration identity still records. The release gains one workspace-side wheel, and its first PyPI publication needs a trusted publisher configured for the new project. The SMG engine contract and its protocol identity are not changed by this decision.

A shared workspace-side package, inferlab-gateway-smg, that owns the SMG backend name, implementation identity, launch command for routed-single and prefill/decode targets, Gateway readiness, and the P/D Router worker-registry readiness, consumed by both integrations (accepted)

Section titled “A shared workspace-side package, inferlab-gateway-smg, that owns the SMG backend name, implementation identity, launch command for routed-single and prefill/decode targets, Gateway readiness, and the P/D Router worker-registry readiness, consumed by both integrations (accepted)”
  • Pros: One authority for the SMG backend name, launch form, and recorded version, Keeps the adapter SDK free of any one frontend implementation’s facts
  • Cons: One more independently versioned package to build, publish, and pin

Move the shared SMG lowering into the adapter SDK (rejected)

Section titled “Move the shared SMG lowering into the adapter SDK (rejected)”
  • Pros: No new package
  • Cons: Puts one frontend implementation’s command line and registry schema into the framework-neutral SDK every integration consumes

Keep the two integration-local copies and align them by convention (rejected)

Section titled “Keep the two integration-local copies and align them by convention (rejected)”
  • Pros: No change
  • Cons: The copies have already diverged in backend name, launch form, and recorded version; nothing keeps them aligned