-
public class ResourceGateLayer 2 admission control: before any download or adapter load, decide whether this model can actually run here. Pure decision logic (evaluate) over a probed Resources snapshot, so the rules are unit-testable without Android. Mirrors the server-side registration guard arithmetic — same multipliers, budget fraction, battery floor, storage headroom and unknown-memory assumption, served via
configSettings.guardrails.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classResourceGate.Resourcespublic final classResourceGate.Block
-
Field Summary
Fields Modifier and Type Field Description private final StringSTAGE_DOWNLOADprivate final StringSTAGE_LOADpublic final static ResourceGateINSTANCE
-
Method Summary
Modifier and Type Method Description final ResourceGate.Blockevaluate(ModelConfig config, String stage, ResourceGate.Resources resources, GuardrailConfig guardrails, ResourcePolicy policy)final LongnormalizeSizeBytes(Long raw)The catalog's size column is megabytes but travels under sizeBytesunchanged (e.g.final StringgetSTAGE_DOWNLOAD()final StringgetSTAGE_LOAD()-
-
Method Detail
-
evaluate
final ResourceGate.Block evaluate(ModelConfig config, String stage, ResourceGate.Resources resources, GuardrailConfig guardrails, ResourcePolicy policy)
-
normalizeSizeBytes
final Long normalizeSizeBytes(Long raw)
The catalog's size column is megabytes but travels under
sizeBytesunchanged (e.g. deberta-v3-small -> 184). Values below 1e6 can't be real byte counts for an on-device model, so interpret them as MB — identical normalization to the registry's admission guard.
-
getSTAGE_DOWNLOAD
final String getSTAGE_DOWNLOAD()
-
getSTAGE_LOAD
final String getSTAGE_LOAD()
-
-
-
-