Package com.gencior.triton.core.pojo
Class TritonModelIndex
java.lang.Object
com.gencior.triton.core.pojo.TritonModelIndex
Encapsulates metadata about a single model in the Triton repository index.
This class represents a model entry from the repository index, providing essential metadata about a model's availability and health status. Each model index entry indicates whether the model is currently ready for inference or if it's unavailable and why.
This is an immutable object that wraps the gRPC message
RepositoryIndexResponse.ModelIndex.
State Values:
- READY: Model is loaded and ready to accept inference requests
- UNAVAILABLE: Model is not ready; check
getReason()for details - LOADING: Model is currently being loaded (transient state)
- UNLOADING: Model is currently being unloaded (transient state)
Usage Example:
List<TritonModelIndex> models = repositoryIndex.getModels();
for (TritonModelIndex model : models) {
System.out.println("Model: " + model.getName() + " v" + model.getVersion());
if (!"READY".equals(model.getState())) {
System.out.println("Status: " + model.getState());
System.out.println("Reason: " + model.getReason());
}
}
- Since:
- 1.0.0
- Author:
- sachachoumiloff
-
Method Summary
Modifier and TypeMethodDescriptionstatic TritonModelIndexCreates a TritonModelIndex from a gRPC ModelIndex message.getName()Returns the name of the model.Returns the reason for the current state, if not ready.getState()Returns the current state of the model.Returns the version of the model.toString()
-
Method Details
-
fromProto
Creates a TritonModelIndex from a gRPC ModelIndex message.- Parameters:
proto- the gRPC ModelIndex message from Triton server- Returns:
- a new TritonModelIndex instance
-
getName
Returns the name of the model.- Returns:
- the model name as it appears in the repository
-
getVersion
Returns the version of the model.- Returns:
- the model version (typically a semantic version like "1.0" or similar identifier)
-
getState
Returns the current state of the model.- Returns:
- the state (typically "READY", "UNAVAILABLE", "LOADING", or "UNLOADING")
-
getReason
Returns the reason for the current state, if not ready.This field is typically empty when the model state is "READY", and contains an error message or explanation when the model is unavailable.
- Returns:
- the reason text explaining the state, empty if not applicable
-
toString
-