Interface ModelSource

All Known Implementing Classes:
ModelStorageProviderImpl.FileModelSource

public interface ModelSource
Represents a source from which a model can be loaded. This abstracts the different locations where models might be stored (local filesystem, HTTP, S3, etc.) behind a common interface.
  • Method Details

    • getUri

      String getUri()
      Gets the URI for this model source.
      Returns:
      The URI as a string
    • getModelId

      String getModelId()
      Gets the model ID associated with this source.
      Returns:
      The model ID
    • getVersion

      String getVersion()
      Gets the version associated with this source.
      Returns:
      The version
    • resolveToLocalPath

      CompletableFuture<Path> resolveToLocalPath()
      Resolves this model source to a local path asynchronously. If the source is already local, returns the path. If the source is remote, downloads the model to a local path and returns that path.
      Returns:
      A CompletableFuture containing the path to the model on the local filesystem
    • isLocal

      boolean isLocal()
      Checks if this model source is already available locally.
      Returns:
      true if the model is available locally, false otherwise
    • getStatus

      Gets the current status of this model source.
      Returns:
      The model source status
    • setStatus

      void setStatus(ModelSource.ModelSourceStatus status)
      Sets the status of this model source.
      Parameters:
      status - The new status