Răsfoiți Sursa

grpc基本文件生成

wangmiaomiao 11 luni în urmă
părinte
comite
8fd30092f1

+ 24 - 0
slibra-admin/pom.xml

@@ -102,6 +102,30 @@
             <artifactId>spring-boot-starter-thymeleaf</artifactId>
             <version>2.7.12</version>
         </dependency>
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.11.0</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/com.google.api.grpc/proto-google-common-protos -->
+        <dependency>
+            <groupId>com.google.api.grpc</groupId>
+            <artifactId>proto-google-common-protos</artifactId>
+            <version>2.37.1</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/io.grpc/grpc-protobuf -->
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-protobuf</artifactId>
+            <version>1.62.2</version>
+        </dependency>
+        <!-- https://mvnrepository.com/artifact/io.grpc/grpc-stub -->
+        <dependency>
+            <groupId>io.grpc</groupId>
+            <artifactId>grpc-stub</artifactId>
+            <version>1.62.2</version>
+        </dependency>
+
 
 
 

+ 115 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/Inference.java

@@ -0,0 +1,115 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+public final class Inference {
+  private Inference() {}
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistryLite registry) {
+  }
+
+  public static void registerAllExtensions(
+      com.google.protobuf.ExtensionRegistry registry) {
+    registerAllExtensions(
+        (com.google.protobuf.ExtensionRegistryLite) registry);
+  }
+  static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor;
+  static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_fieldAccessorTable;
+  static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_InputEntry_descriptor;
+  static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_InputEntry_fieldAccessorTable;
+  static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_descriptor;
+  static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_fieldAccessorTable;
+  static final com.google.protobuf.Descriptors.Descriptor
+    internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_descriptor;
+  static final 
+    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+      internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_fieldAccessorTable;
+
+  public static com.google.protobuf.Descriptors.FileDescriptor
+      getDescriptor() {
+    return descriptor;
+  }
+  private static  com.google.protobuf.Descriptors.FileDescriptor
+      descriptor;
+  static {
+    String[] descriptorData = {
+      "\n\017inference.proto\022 org.pytorch.serve.grp" +
+      "c.inference\032\033google/protobuf/empty.proto" +
+      "\032\027google/rpc/status.proto\"\322\001\n\022Prediction" +
+      "sRequest\022\022\n\nmodel_name\030\001 \001(\t\022\025\n\rmodel_ve" +
+      "rsion\030\002 \001(\t\022N\n\005input\030\003 \003(\0132?.org.pytorch" +
+      ".serve.grpc.inference.PredictionsRequest" +
+      ".InputEntry\022\023\n\013sequence_id\030\004 \001(\t\032,\n\nInpu" +
+      "tEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\014:\0028\001\"a" +
+      "\n\022PredictionResponse\022\022\n\nprediction\030\001 \001(\014" +
+      "\022\023\n\013sequence_id\030\002 \001(\t\022\"\n\006status\030\003 \001(\0132\022." +
+      "google.rpc.Status\"*\n\030TorchServeHealthRes" +
+      "ponse\022\016\n\006health\030\001 \001(\t2\200\004\n\024InferenceAPIsS" +
+      "ervice\022\\\n\004Ping\022\026.google.protobuf.Empty\032:" +
+      ".org.pytorch.serve.grpc.inference.TorchS" +
+      "erveHealthResponse\"\000\022{\n\013Predictions\0224.or" +
+      "g.pytorch.serve.grpc.inference.Predictio" +
+      "nsRequest\0324.org.pytorch.serve.grpc.infer" +
+      "ence.PredictionResponse\"\000\022\203\001\n\021StreamPred" +
+      "ictions\0224.org.pytorch.serve.grpc.inferen" +
+      "ce.PredictionsRequest\0324.org.pytorch.serv" +
+      "e.grpc.inference.PredictionResponse\"\0000\001\022" +
+      "\206\001\n\022StreamPredictions2\0224.org.pytorch.ser" +
+      "ve.grpc.inference.PredictionsRequest\0324.o" +
+      "rg.pytorch.serve.grpc.inference.Predicti" +
+      "onResponse\"\000(\0010\001B\002P\001b\006proto3"
+    };
+    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
+        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
+          public com.google.protobuf.ExtensionRegistry assignDescriptors(
+              com.google.protobuf.Descriptors.FileDescriptor root) {
+            descriptor = root;
+            return null;
+          }
+        };
+    com.google.protobuf.Descriptors.FileDescriptor
+      .internalBuildGeneratedFileFrom(descriptorData,
+        new com.google.protobuf.Descriptors.FileDescriptor[] {
+          com.google.protobuf.EmptyProto.getDescriptor(),
+          com.google.rpc.StatusProto.getDescriptor(),
+        }, assigner);
+    internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor =
+      getDescriptor().getMessageTypes().get(0);
+    internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor,
+        new String[] { "ModelName", "ModelVersion", "Input", "SequenceId", });
+    internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_InputEntry_descriptor =
+      internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor.getNestedTypes().get(0);
+    internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_InputEntry_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_InputEntry_descriptor,
+        new String[] { "Key", "Value", });
+    internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_descriptor =
+      getDescriptor().getMessageTypes().get(1);
+    internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_descriptor,
+        new String[] { "Prediction", "SequenceId", "Status", });
+    internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_descriptor =
+      getDescriptor().getMessageTypes().get(2);
+    internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_fieldAccessorTable = new
+      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+        internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_descriptor,
+        new String[] { "Health", });
+    com.google.protobuf.EmptyProto.getDescriptor();
+    com.google.rpc.StatusProto.getDescriptor();
+  }
+
+  // @@protoc_insertion_point(outer_class_scope)
+}

+ 514 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/InferenceAPIsServiceGrpc.java

@@ -0,0 +1,514 @@
+package org.pytorch.serve.grpc.inference;
+
+import static io.grpc.MethodDescriptor.generateFullMethodName;
+
+/**
+ */
+@javax.annotation.Generated(
+    value = "by gRPC proto compiler (version 1.45.1)",
+    comments = "Source: inference.proto")
+@io.grpc.stub.annotations.GrpcGenerated
+public final class InferenceAPIsServiceGrpc {
+
+  private InferenceAPIsServiceGrpc() {}
+
+  public static final String SERVICE_NAME = "org.pytorch.serve.grpc.inference.InferenceAPIsService";
+
+  // Static method descriptors that strictly reflect the proto.
+  private static volatile io.grpc.MethodDescriptor<com.google.protobuf.Empty,
+      TorchServeHealthResponse> getPingMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "Ping",
+      requestType = com.google.protobuf.Empty.class,
+      responseType = TorchServeHealthResponse.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<com.google.protobuf.Empty,
+      TorchServeHealthResponse> getPingMethod() {
+    io.grpc.MethodDescriptor<com.google.protobuf.Empty, TorchServeHealthResponse> getPingMethod;
+    if ((getPingMethod = InferenceAPIsServiceGrpc.getPingMethod) == null) {
+      synchronized (InferenceAPIsServiceGrpc.class) {
+        if ((getPingMethod = InferenceAPIsServiceGrpc.getPingMethod) == null) {
+          InferenceAPIsServiceGrpc.getPingMethod = getPingMethod =
+              io.grpc.MethodDescriptor.<com.google.protobuf.Empty, TorchServeHealthResponse>newBuilder()
+              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Ping"))
+              .setSampledToLocalTracing(true)
+              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  com.google.protobuf.Empty.getDefaultInstance()))
+              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  TorchServeHealthResponse.getDefaultInstance()))
+              .setSchemaDescriptor(new InferenceAPIsServiceMethodDescriptorSupplier("Ping"))
+              .build();
+        }
+      }
+    }
+    return getPingMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<PredictionsRequest,
+      PredictionResponse> getPredictionsMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "Predictions",
+      requestType = PredictionsRequest.class,
+      responseType = PredictionResponse.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+  public static io.grpc.MethodDescriptor<PredictionsRequest,
+      PredictionResponse> getPredictionsMethod() {
+    io.grpc.MethodDescriptor<PredictionsRequest, PredictionResponse> getPredictionsMethod;
+    if ((getPredictionsMethod = InferenceAPIsServiceGrpc.getPredictionsMethod) == null) {
+      synchronized (InferenceAPIsServiceGrpc.class) {
+        if ((getPredictionsMethod = InferenceAPIsServiceGrpc.getPredictionsMethod) == null) {
+          InferenceAPIsServiceGrpc.getPredictionsMethod = getPredictionsMethod =
+              io.grpc.MethodDescriptor.<PredictionsRequest, PredictionResponse>newBuilder()
+              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Predictions"))
+              .setSampledToLocalTracing(true)
+              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  PredictionsRequest.getDefaultInstance()))
+              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  PredictionResponse.getDefaultInstance()))
+              .setSchemaDescriptor(new InferenceAPIsServiceMethodDescriptorSupplier("Predictions"))
+              .build();
+        }
+      }
+    }
+    return getPredictionsMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<PredictionsRequest,
+      PredictionResponse> getStreamPredictionsMethod;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "StreamPredictions",
+      requestType = PredictionsRequest.class,
+      responseType = PredictionResponse.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
+  public static io.grpc.MethodDescriptor<PredictionsRequest,
+      PredictionResponse> getStreamPredictionsMethod() {
+    io.grpc.MethodDescriptor<PredictionsRequest, PredictionResponse> getStreamPredictionsMethod;
+    if ((getStreamPredictionsMethod = InferenceAPIsServiceGrpc.getStreamPredictionsMethod) == null) {
+      synchronized (InferenceAPIsServiceGrpc.class) {
+        if ((getStreamPredictionsMethod = InferenceAPIsServiceGrpc.getStreamPredictionsMethod) == null) {
+          InferenceAPIsServiceGrpc.getStreamPredictionsMethod = getStreamPredictionsMethod =
+              io.grpc.MethodDescriptor.<PredictionsRequest, PredictionResponse>newBuilder()
+              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
+              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamPredictions"))
+              .setSampledToLocalTracing(true)
+              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  PredictionsRequest.getDefaultInstance()))
+              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  PredictionResponse.getDefaultInstance()))
+              .setSchemaDescriptor(new InferenceAPIsServiceMethodDescriptorSupplier("StreamPredictions"))
+              .build();
+        }
+      }
+    }
+    return getStreamPredictionsMethod;
+  }
+
+  private static volatile io.grpc.MethodDescriptor<PredictionsRequest,
+      PredictionResponse> getStreamPredictions2Method;
+
+  @io.grpc.stub.annotations.RpcMethod(
+      fullMethodName = SERVICE_NAME + '/' + "StreamPredictions2",
+      requestType = PredictionsRequest.class,
+      responseType = PredictionResponse.class,
+      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
+  public static io.grpc.MethodDescriptor<PredictionsRequest,
+      PredictionResponse> getStreamPredictions2Method() {
+    io.grpc.MethodDescriptor<PredictionsRequest, PredictionResponse> getStreamPredictions2Method;
+    if ((getStreamPredictions2Method = InferenceAPIsServiceGrpc.getStreamPredictions2Method) == null) {
+      synchronized (InferenceAPIsServiceGrpc.class) {
+        if ((getStreamPredictions2Method = InferenceAPIsServiceGrpc.getStreamPredictions2Method) == null) {
+          InferenceAPIsServiceGrpc.getStreamPredictions2Method = getStreamPredictions2Method =
+              io.grpc.MethodDescriptor.<PredictionsRequest, PredictionResponse>newBuilder()
+              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
+              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StreamPredictions2"))
+              .setSampledToLocalTracing(true)
+              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  PredictionsRequest.getDefaultInstance()))
+              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+                  PredictionResponse.getDefaultInstance()))
+              .setSchemaDescriptor(new InferenceAPIsServiceMethodDescriptorSupplier("StreamPredictions2"))
+              .build();
+        }
+      }
+    }
+    return getStreamPredictions2Method;
+  }
+
+  /**
+   * Creates a new async stub that supports all call types for the service
+   */
+  public static InferenceAPIsServiceStub newStub(io.grpc.Channel channel) {
+    io.grpc.stub.AbstractStub.StubFactory<InferenceAPIsServiceStub> factory =
+      new io.grpc.stub.AbstractStub.StubFactory<InferenceAPIsServiceStub>() {
+        @Override
+        public InferenceAPIsServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+          return new InferenceAPIsServiceStub(channel, callOptions);
+        }
+      };
+    return InferenceAPIsServiceStub.newStub(factory, channel);
+  }
+
+  /**
+   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
+   */
+  public static InferenceAPIsServiceBlockingStub newBlockingStub(
+      io.grpc.Channel channel) {
+    io.grpc.stub.AbstractStub.StubFactory<InferenceAPIsServiceBlockingStub> factory =
+      new io.grpc.stub.AbstractStub.StubFactory<InferenceAPIsServiceBlockingStub>() {
+        @Override
+        public InferenceAPIsServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+          return new InferenceAPIsServiceBlockingStub(channel, callOptions);
+        }
+      };
+    return InferenceAPIsServiceBlockingStub.newStub(factory, channel);
+  }
+
+  /**
+   * Creates a new ListenableFuture-style stub that supports unary calls on the service
+   */
+  public static InferenceAPIsServiceFutureStub newFutureStub(
+      io.grpc.Channel channel) {
+    io.grpc.stub.AbstractStub.StubFactory<InferenceAPIsServiceFutureStub> factory =
+      new io.grpc.stub.AbstractStub.StubFactory<InferenceAPIsServiceFutureStub>() {
+        @Override
+        public InferenceAPIsServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+          return new InferenceAPIsServiceFutureStub(channel, callOptions);
+        }
+      };
+    return InferenceAPIsServiceFutureStub.newStub(factory, channel);
+  }
+
+  /**
+   */
+  public static abstract class InferenceAPIsServiceImplBase implements io.grpc.BindableService {
+
+    /**
+     * <pre>
+     * Check health status of the TorchServe server.
+     * </pre>
+     */
+    public void ping(com.google.protobuf.Empty request,
+        io.grpc.stub.StreamObserver<TorchServeHealthResponse> responseObserver) {
+      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPingMethod(), responseObserver);
+    }
+
+    /**
+     * <pre>
+     * Predictions entry point to get inference using default model version.
+     * </pre>
+     */
+    public void predictions(PredictionsRequest request,
+                            io.grpc.stub.StreamObserver<PredictionResponse> responseObserver) {
+      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPredictionsMethod(), responseObserver);
+    }
+
+    /**
+     * <pre>
+     * Streaming response for an inference request.
+     * </pre>
+     */
+    public void streamPredictions(PredictionsRequest request,
+                                  io.grpc.stub.StreamObserver<PredictionResponse> responseObserver) {
+      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getStreamPredictionsMethod(), responseObserver);
+    }
+
+    /**
+     * <pre>
+     * Bi-direction streaming inference and response.
+     * </pre>
+     */
+    public io.grpc.stub.StreamObserver<PredictionsRequest> streamPredictions2(
+        io.grpc.stub.StreamObserver<PredictionResponse> responseObserver) {
+      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStreamPredictions2Method(), responseObserver);
+    }
+
+    @Override public final io.grpc.ServerServiceDefinition bindService() {
+      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
+          .addMethod(
+            getPingMethod(),
+            io.grpc.stub.ServerCalls.asyncUnaryCall(
+              new MethodHandlers<
+                com.google.protobuf.Empty,
+                TorchServeHealthResponse>(
+                  this, METHODID_PING)))
+          .addMethod(
+            getPredictionsMethod(),
+            io.grpc.stub.ServerCalls.asyncUnaryCall(
+              new MethodHandlers<
+                PredictionsRequest,
+                PredictionResponse>(
+                  this, METHODID_PREDICTIONS)))
+          .addMethod(
+            getStreamPredictionsMethod(),
+            io.grpc.stub.ServerCalls.asyncServerStreamingCall(
+              new MethodHandlers<
+                PredictionsRequest,
+                PredictionResponse>(
+                  this, METHODID_STREAM_PREDICTIONS)))
+          .addMethod(
+            getStreamPredictions2Method(),
+            io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
+              new MethodHandlers<
+                PredictionsRequest,
+                PredictionResponse>(
+                  this, METHODID_STREAM_PREDICTIONS2)))
+          .build();
+    }
+  }
+
+  /**
+   */
+  public static final class InferenceAPIsServiceStub extends io.grpc.stub.AbstractAsyncStub<InferenceAPIsServiceStub> {
+    private InferenceAPIsServiceStub(
+        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+      super(channel, callOptions);
+    }
+
+    @Override
+    protected InferenceAPIsServiceStub build(
+        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+      return new InferenceAPIsServiceStub(channel, callOptions);
+    }
+
+    /**
+     * <pre>
+     * Check health status of the TorchServe server.
+     * </pre>
+     */
+    public void ping(com.google.protobuf.Empty request,
+        io.grpc.stub.StreamObserver<TorchServeHealthResponse> responseObserver) {
+      io.grpc.stub.ClientCalls.asyncUnaryCall(
+          getChannel().newCall(getPingMethod(), getCallOptions()), request, responseObserver);
+    }
+
+    /**
+     * <pre>
+     * Predictions entry point to get inference using default model version.
+     * </pre>
+     */
+    public void predictions(PredictionsRequest request,
+                            io.grpc.stub.StreamObserver<PredictionResponse> responseObserver) {
+      io.grpc.stub.ClientCalls.asyncUnaryCall(
+          getChannel().newCall(getPredictionsMethod(), getCallOptions()), request, responseObserver);
+    }
+
+    /**
+     * <pre>
+     * Streaming response for an inference request.
+     * </pre>
+     */
+    public void streamPredictions(PredictionsRequest request,
+                                  io.grpc.stub.StreamObserver<PredictionResponse> responseObserver) {
+      io.grpc.stub.ClientCalls.asyncServerStreamingCall(
+          getChannel().newCall(getStreamPredictionsMethod(), getCallOptions()), request, responseObserver);
+    }
+
+    /**
+     * <pre>
+     * Bi-direction streaming inference and response.
+     * </pre>
+     */
+    public io.grpc.stub.StreamObserver<PredictionsRequest> streamPredictions2(
+        io.grpc.stub.StreamObserver<PredictionResponse> responseObserver) {
+      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
+          getChannel().newCall(getStreamPredictions2Method(), getCallOptions()), responseObserver);
+    }
+  }
+
+  /**
+   */
+  public static final class InferenceAPIsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<InferenceAPIsServiceBlockingStub> {
+    private InferenceAPIsServiceBlockingStub(
+        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+      super(channel, callOptions);
+    }
+
+    @Override
+    protected InferenceAPIsServiceBlockingStub build(
+        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+      return new InferenceAPIsServiceBlockingStub(channel, callOptions);
+    }
+
+    /**
+     * <pre>
+     * Check health status of the TorchServe server.
+     * </pre>
+     */
+    public TorchServeHealthResponse ping(com.google.protobuf.Empty request) {
+      return io.grpc.stub.ClientCalls.blockingUnaryCall(
+          getChannel(), getPingMethod(), getCallOptions(), request);
+    }
+
+    /**
+     * <pre>
+     * Predictions entry point to get inference using default model version.
+     * </pre>
+     */
+    public PredictionResponse predictions(PredictionsRequest request) {
+      return io.grpc.stub.ClientCalls.blockingUnaryCall(
+          getChannel(), getPredictionsMethod(), getCallOptions(), request);
+    }
+
+    /**
+     * <pre>
+     * Streaming response for an inference request.
+     * </pre>
+     */
+    public java.util.Iterator<PredictionResponse> streamPredictions(
+        PredictionsRequest request) {
+      return io.grpc.stub.ClientCalls.blockingServerStreamingCall(
+          getChannel(), getStreamPredictionsMethod(), getCallOptions(), request);
+    }
+  }
+
+  /**
+   */
+  public static final class InferenceAPIsServiceFutureStub extends io.grpc.stub.AbstractFutureStub<InferenceAPIsServiceFutureStub> {
+    private InferenceAPIsServiceFutureStub(
+        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+      super(channel, callOptions);
+    }
+
+    @Override
+    protected InferenceAPIsServiceFutureStub build(
+        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
+      return new InferenceAPIsServiceFutureStub(channel, callOptions);
+    }
+
+    /**
+     * <pre>
+     * Check health status of the TorchServe server.
+     * </pre>
+     */
+    public com.google.common.util.concurrent.ListenableFuture<TorchServeHealthResponse> ping(
+        com.google.protobuf.Empty request) {
+      return io.grpc.stub.ClientCalls.futureUnaryCall(
+          getChannel().newCall(getPingMethod(), getCallOptions()), request);
+    }
+
+    /**
+     * <pre>
+     * Predictions entry point to get inference using default model version.
+     * </pre>
+     */
+    public com.google.common.util.concurrent.ListenableFuture<PredictionResponse> predictions(
+        PredictionsRequest request) {
+      return io.grpc.stub.ClientCalls.futureUnaryCall(
+          getChannel().newCall(getPredictionsMethod(), getCallOptions()), request);
+    }
+  }
+
+  private static final int METHODID_PING = 0;
+  private static final int METHODID_PREDICTIONS = 1;
+  private static final int METHODID_STREAM_PREDICTIONS = 2;
+  private static final int METHODID_STREAM_PREDICTIONS2 = 3;
+
+  private static final class MethodHandlers<Req, Resp> implements
+      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
+      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
+      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
+      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
+    private final InferenceAPIsServiceImplBase serviceImpl;
+    private final int methodId;
+
+    MethodHandlers(InferenceAPIsServiceImplBase serviceImpl, int methodId) {
+      this.serviceImpl = serviceImpl;
+      this.methodId = methodId;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
+      switch (methodId) {
+        case METHODID_PING:
+          serviceImpl.ping((com.google.protobuf.Empty) request,
+              (io.grpc.stub.StreamObserver<TorchServeHealthResponse>) responseObserver);
+          break;
+        case METHODID_PREDICTIONS:
+          serviceImpl.predictions((PredictionsRequest) request,
+              (io.grpc.stub.StreamObserver<PredictionResponse>) responseObserver);
+          break;
+        case METHODID_STREAM_PREDICTIONS:
+          serviceImpl.streamPredictions((PredictionsRequest) request,
+              (io.grpc.stub.StreamObserver<PredictionResponse>) responseObserver);
+          break;
+        default:
+          throw new AssertionError();
+      }
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public io.grpc.stub.StreamObserver<Req> invoke(
+        io.grpc.stub.StreamObserver<Resp> responseObserver) {
+      switch (methodId) {
+        case METHODID_STREAM_PREDICTIONS2:
+          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamPredictions2(
+              (io.grpc.stub.StreamObserver<PredictionResponse>) responseObserver);
+        default:
+          throw new AssertionError();
+      }
+    }
+  }
+
+  private static abstract class InferenceAPIsServiceBaseDescriptorSupplier
+      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
+    InferenceAPIsServiceBaseDescriptorSupplier() {}
+
+    @Override
+    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
+      return Inference.getDescriptor();
+    }
+
+    @Override
+    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
+      return getFileDescriptor().findServiceByName("InferenceAPIsService");
+    }
+  }
+
+  private static final class InferenceAPIsServiceFileDescriptorSupplier
+      extends InferenceAPIsServiceBaseDescriptorSupplier {
+    InferenceAPIsServiceFileDescriptorSupplier() {}
+  }
+
+  private static final class InferenceAPIsServiceMethodDescriptorSupplier
+      extends InferenceAPIsServiceBaseDescriptorSupplier
+      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
+    private final String methodName;
+
+    InferenceAPIsServiceMethodDescriptorSupplier(String methodName) {
+      this.methodName = methodName;
+    }
+
+    @Override
+    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
+      return getServiceDescriptor().findMethodByName(methodName);
+    }
+  }
+
+  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
+
+  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
+    io.grpc.ServiceDescriptor result = serviceDescriptor;
+    if (result == null) {
+      synchronized (InferenceAPIsServiceGrpc.class) {
+        result = serviceDescriptor;
+        if (result == null) {
+          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
+              .setSchemaDescriptor(new InferenceAPIsServiceFileDescriptorSupplier())
+              .addMethod(getPingMethod())
+              .addMethod(getPredictionsMethod())
+              .addMethod(getStreamPredictionsMethod())
+              .addMethod(getStreamPredictions2Method())
+              .build();
+        }
+      }
+    }
+    return result;
+  }
+}

+ 850 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/PredictionResponse.java

@@ -0,0 +1,850 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+/**
+ * Protobuf type {@code org.pytorch.serve.grpc.inference.PredictionResponse}
+ */
+public  final class PredictionResponse extends
+    com.google.protobuf.GeneratedMessageV3 implements
+    // @@protoc_insertion_point(message_implements:org.pytorch.serve.grpc.inference.PredictionResponse)
+    PredictionResponseOrBuilder {
+private static final long serialVersionUID = 0L;
+  // Use PredictionResponse.newBuilder() to construct.
+  private PredictionResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
+    super(builder);
+  }
+  private PredictionResponse() {
+    prediction_ = com.google.protobuf.ByteString.EMPTY;
+    sequenceId_ = "";
+  }
+
+  @Override
+  public final com.google.protobuf.UnknownFieldSet
+  getUnknownFields() {
+    return this.unknownFields;
+  }
+  private PredictionResponse(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    this();
+    if (extensionRegistry == null) {
+      throw new NullPointerException();
+    }
+    int mutable_bitField0_ = 0;
+    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+        com.google.protobuf.UnknownFieldSet.newBuilder();
+    try {
+      boolean done = false;
+      while (!done) {
+        int tag = input.readTag();
+        switch (tag) {
+          case 0:
+            done = true;
+            break;
+          default: {
+            if (!parseUnknownFieldProto3(
+                input, unknownFields, extensionRegistry, tag)) {
+              done = true;
+            }
+            break;
+          }
+          case 10: {
+
+            prediction_ = input.readBytes();
+            break;
+          }
+          case 18: {
+            String s = input.readStringRequireUtf8();
+
+            sequenceId_ = s;
+            break;
+          }
+          case 26: {
+            com.google.rpc.Status.Builder subBuilder = null;
+            if (status_ != null) {
+              subBuilder = status_.toBuilder();
+            }
+            status_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
+            if (subBuilder != null) {
+              subBuilder.mergeFrom(status_);
+              status_ = subBuilder.buildPartial();
+            }
+
+            break;
+          }
+        }
+      }
+    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+      throw e.setUnfinishedMessage(this);
+    } catch (java.io.IOException e) {
+      throw new com.google.protobuf.InvalidProtocolBufferException(
+          e).setUnfinishedMessage(this);
+    } finally {
+      this.unknownFields = unknownFields.build();
+      makeExtensionsImmutable();
+    }
+  }
+  public static final com.google.protobuf.Descriptors.Descriptor
+      getDescriptor() {
+    return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_descriptor;
+  }
+
+  protected FieldAccessorTable
+      internalGetFieldAccessorTable() {
+    return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_fieldAccessorTable
+        .ensureFieldAccessorsInitialized(
+            PredictionResponse.class, Builder.class);
+  }
+
+  public static final int PREDICTION_FIELD_NUMBER = 1;
+  private com.google.protobuf.ByteString prediction_;
+  /**
+   * <pre>
+   * Response content for prediction
+   * </pre>
+   *
+   * <code>bytes prediction = 1;</code>
+   */
+  public com.google.protobuf.ByteString getPrediction() {
+    return prediction_;
+  }
+
+  public static final int SEQUENCE_ID_FIELD_NUMBER = 2;
+  private volatile Object sequenceId_;
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 2;</code>
+   */
+  public String getSequenceId() {
+    Object ref = sequenceId_;
+    if (ref instanceof String) {
+      return (String) ref;
+    } else {
+      com.google.protobuf.ByteString bs = 
+          (com.google.protobuf.ByteString) ref;
+      String s = bs.toStringUtf8();
+      sequenceId_ = s;
+      return s;
+    }
+  }
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 2;</code>
+   */
+  public com.google.protobuf.ByteString
+      getSequenceIdBytes() {
+    Object ref = sequenceId_;
+    if (ref instanceof String) {
+      com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString.copyFromUtf8(
+              (String) ref);
+      sequenceId_ = b;
+      return b;
+    } else {
+      return (com.google.protobuf.ByteString) ref;
+    }
+  }
+
+  public static final int STATUS_FIELD_NUMBER = 3;
+  private com.google.rpc.Status status_;
+  /**
+   * <pre>
+   * Error information for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>.google.rpc.Status status = 3;</code>
+   */
+  public boolean hasStatus() {
+    return status_ != null;
+  }
+  /**
+   * <pre>
+   * Error information for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>.google.rpc.Status status = 3;</code>
+   */
+  public com.google.rpc.Status getStatus() {
+    return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
+  }
+  /**
+   * <pre>
+   * Error information for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>.google.rpc.Status status = 3;</code>
+   */
+  public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
+    return getStatus();
+  }
+
+  private byte memoizedIsInitialized = -1;
+  public final boolean isInitialized() {
+    byte isInitialized = memoizedIsInitialized;
+    if (isInitialized == 1) return true;
+    if (isInitialized == 0) return false;
+
+    memoizedIsInitialized = 1;
+    return true;
+  }
+
+  public void writeTo(com.google.protobuf.CodedOutputStream output)
+                      throws java.io.IOException {
+    if (!prediction_.isEmpty()) {
+      output.writeBytes(1, prediction_);
+    }
+    if (!getSequenceIdBytes().isEmpty()) {
+      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sequenceId_);
+    }
+    if (status_ != null) {
+      output.writeMessage(3, getStatus());
+    }
+    unknownFields.writeTo(output);
+  }
+
+  public int getSerializedSize() {
+    int size = memoizedSize;
+    if (size != -1) return size;
+
+    size = 0;
+    if (!prediction_.isEmpty()) {
+      size += com.google.protobuf.CodedOutputStream
+        .computeBytesSize(1, prediction_);
+    }
+    if (!getSequenceIdBytes().isEmpty()) {
+      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sequenceId_);
+    }
+    if (status_ != null) {
+      size += com.google.protobuf.CodedOutputStream
+        .computeMessageSize(3, getStatus());
+    }
+    size += unknownFields.getSerializedSize();
+    memoizedSize = size;
+    return size;
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    if (obj == this) {
+     return true;
+    }
+    if (!(obj instanceof PredictionResponse)) {
+      return super.equals(obj);
+    }
+    PredictionResponse other = (PredictionResponse) obj;
+
+    boolean result = true;
+    result = result && getPrediction()
+        .equals(other.getPrediction());
+    result = result && getSequenceId()
+        .equals(other.getSequenceId());
+    result = result && (hasStatus() == other.hasStatus());
+    if (hasStatus()) {
+      result = result && getStatus()
+          .equals(other.getStatus());
+    }
+    result = result && unknownFields.equals(other.unknownFields);
+    return result;
+  }
+
+  @Override
+  public int hashCode() {
+    if (memoizedHashCode != 0) {
+      return memoizedHashCode;
+    }
+    int hash = 41;
+    hash = (19 * hash) + getDescriptor().hashCode();
+    hash = (37 * hash) + PREDICTION_FIELD_NUMBER;
+    hash = (53 * hash) + getPrediction().hashCode();
+    hash = (37 * hash) + SEQUENCE_ID_FIELD_NUMBER;
+    hash = (53 * hash) + getSequenceId().hashCode();
+    if (hasStatus()) {
+      hash = (37 * hash) + STATUS_FIELD_NUMBER;
+      hash = (53 * hash) + getStatus().hashCode();
+    }
+    hash = (29 * hash) + unknownFields.hashCode();
+    memoizedHashCode = hash;
+    return hash;
+  }
+
+  public static PredictionResponse parseFrom(
+      java.nio.ByteBuffer data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static PredictionResponse parseFrom(
+      java.nio.ByteBuffer data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static PredictionResponse parseFrom(
+      com.google.protobuf.ByteString data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static PredictionResponse parseFrom(
+      com.google.protobuf.ByteString data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static PredictionResponse parseFrom(byte[] data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static PredictionResponse parseFrom(
+      byte[] data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static PredictionResponse parseFrom(java.io.InputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input);
+  }
+  public static PredictionResponse parseFrom(
+      java.io.InputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input, extensionRegistry);
+  }
+  public static PredictionResponse parseDelimitedFrom(java.io.InputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseDelimitedWithIOException(PARSER, input);
+  }
+  public static PredictionResponse parseDelimitedFrom(
+      java.io.InputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+  }
+  public static PredictionResponse parseFrom(
+      com.google.protobuf.CodedInputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input);
+  }
+  public static PredictionResponse parseFrom(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input, extensionRegistry);
+  }
+
+  public Builder newBuilderForType() { return newBuilder(); }
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(PredictionResponse prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  @Override
+  protected Builder newBuilderForType(
+      BuilderParent parent) {
+    Builder builder = new Builder(parent);
+    return builder;
+  }
+  /**
+   * Protobuf type {@code org.pytorch.serve.grpc.inference.PredictionResponse}
+   */
+  public static final class Builder extends
+      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
+      // @@protoc_insertion_point(builder_implements:org.pytorch.serve.grpc.inference.PredictionResponse)
+      PredictionResponseOrBuilder {
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_descriptor;
+    }
+
+    protected FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              PredictionResponse.class, Builder.class);
+    }
+
+    // Construct using org.pytorch.serve.grpc.inference.PredictionResponse.newBuilder()
+    private Builder() {
+      maybeForceBuilderInitialization();
+    }
+
+    private Builder(
+        BuilderParent parent) {
+      super(parent);
+      maybeForceBuilderInitialization();
+    }
+    private void maybeForceBuilderInitialization() {
+      if (com.google.protobuf.GeneratedMessageV3
+              .alwaysUseFieldBuilders) {
+      }
+    }
+    public Builder clear() {
+      super.clear();
+      prediction_ = com.google.protobuf.ByteString.EMPTY;
+
+      sequenceId_ = "";
+
+      if (statusBuilder_ == null) {
+        status_ = null;
+      } else {
+        status_ = null;
+        statusBuilder_ = null;
+      }
+      return this;
+    }
+
+    public com.google.protobuf.Descriptors.Descriptor
+        getDescriptorForType() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionResponse_descriptor;
+    }
+
+    public PredictionResponse getDefaultInstanceForType() {
+      return PredictionResponse.getDefaultInstance();
+    }
+
+    public PredictionResponse build() {
+      PredictionResponse result = buildPartial();
+      if (!result.isInitialized()) {
+        throw newUninitializedMessageException(result);
+      }
+      return result;
+    }
+
+    public PredictionResponse buildPartial() {
+      PredictionResponse result = new PredictionResponse(this);
+      result.prediction_ = prediction_;
+      result.sequenceId_ = sequenceId_;
+      if (statusBuilder_ == null) {
+        result.status_ = status_;
+      } else {
+        result.status_ = statusBuilder_.build();
+      }
+      onBuilt();
+      return result;
+    }
+
+    public Builder clone() {
+      return (Builder) super.clone();
+    }
+    public Builder setField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        Object value) {
+      return (Builder) super.setField(field, value);
+    }
+    public Builder clearField(
+        com.google.protobuf.Descriptors.FieldDescriptor field) {
+      return (Builder) super.clearField(field);
+    }
+    public Builder clearOneof(
+        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+      return (Builder) super.clearOneof(oneof);
+    }
+    public Builder setRepeatedField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        int index, Object value) {
+      return (Builder) super.setRepeatedField(field, index, value);
+    }
+    public Builder addRepeatedField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        Object value) {
+      return (Builder) super.addRepeatedField(field, value);
+    }
+    public Builder mergeFrom(com.google.protobuf.Message other) {
+      if (other instanceof PredictionResponse) {
+        return mergeFrom((PredictionResponse)other);
+      } else {
+        super.mergeFrom(other);
+        return this;
+      }
+    }
+
+    public Builder mergeFrom(PredictionResponse other) {
+      if (other == PredictionResponse.getDefaultInstance()) return this;
+      if (other.getPrediction() != com.google.protobuf.ByteString.EMPTY) {
+        setPrediction(other.getPrediction());
+      }
+      if (!other.getSequenceId().isEmpty()) {
+        sequenceId_ = other.sequenceId_;
+        onChanged();
+      }
+      if (other.hasStatus()) {
+        mergeStatus(other.getStatus());
+      }
+      this.mergeUnknownFields(other.unknownFields);
+      onChanged();
+      return this;
+    }
+
+    public final boolean isInitialized() {
+      return true;
+    }
+
+    public Builder mergeFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      PredictionResponse parsedMessage = null;
+      try {
+        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        parsedMessage = (PredictionResponse) e.getUnfinishedMessage();
+        throw e.unwrapIOException();
+      } finally {
+        if (parsedMessage != null) {
+          mergeFrom(parsedMessage);
+        }
+      }
+      return this;
+    }
+
+    private com.google.protobuf.ByteString prediction_ = com.google.protobuf.ByteString.EMPTY;
+    /**
+     * <pre>
+     * Response content for prediction
+     * </pre>
+     *
+     * <code>bytes prediction = 1;</code>
+     */
+    public com.google.protobuf.ByteString getPrediction() {
+      return prediction_;
+    }
+    /**
+     * <pre>
+     * Response content for prediction
+     * </pre>
+     *
+     * <code>bytes prediction = 1;</code>
+     */
+    public Builder setPrediction(com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  
+      prediction_ = value;
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * Response content for prediction
+     * </pre>
+     *
+     * <code>bytes prediction = 1;</code>
+     */
+    public Builder clearPrediction() {
+      
+      prediction_ = getDefaultInstance().getPrediction();
+      onChanged();
+      return this;
+    }
+
+    private Object sequenceId_ = "";
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 2;</code>
+     */
+    public String getSequenceId() {
+      Object ref = sequenceId_;
+      if (!(ref instanceof String)) {
+        com.google.protobuf.ByteString bs =
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        sequenceId_ = s;
+        return s;
+      } else {
+        return (String) ref;
+      }
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 2;</code>
+     */
+    public com.google.protobuf.ByteString
+        getSequenceIdBytes() {
+      Object ref = sequenceId_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        sequenceId_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 2;</code>
+     */
+    public Builder setSequenceId(
+        String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  
+      sequenceId_ = value;
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 2;</code>
+     */
+    public Builder clearSequenceId() {
+      
+      sequenceId_ = getDefaultInstance().getSequenceId();
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 2;</code>
+     */
+    public Builder setSequenceIdBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+      
+      sequenceId_ = value;
+      onChanged();
+      return this;
+    }
+
+    private com.google.rpc.Status status_ = null;
+    private com.google.protobuf.SingleFieldBuilderV3<
+        com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> statusBuilder_;
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public boolean hasStatus() {
+      return statusBuilder_ != null || status_ != null;
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public com.google.rpc.Status getStatus() {
+      if (statusBuilder_ == null) {
+        return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
+      } else {
+        return statusBuilder_.getMessage();
+      }
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public Builder setStatus(com.google.rpc.Status value) {
+      if (statusBuilder_ == null) {
+        if (value == null) {
+          throw new NullPointerException();
+        }
+        status_ = value;
+        onChanged();
+      } else {
+        statusBuilder_.setMessage(value);
+      }
+
+      return this;
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public Builder setStatus(
+        com.google.rpc.Status.Builder builderForValue) {
+      if (statusBuilder_ == null) {
+        status_ = builderForValue.build();
+        onChanged();
+      } else {
+        statusBuilder_.setMessage(builderForValue.build());
+      }
+
+      return this;
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public Builder mergeStatus(com.google.rpc.Status value) {
+      if (statusBuilder_ == null) {
+        if (status_ != null) {
+          status_ =
+            com.google.rpc.Status.newBuilder(status_).mergeFrom(value).buildPartial();
+        } else {
+          status_ = value;
+        }
+        onChanged();
+      } else {
+        statusBuilder_.mergeFrom(value);
+      }
+
+      return this;
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public Builder clearStatus() {
+      if (statusBuilder_ == null) {
+        status_ = null;
+        onChanged();
+      } else {
+        status_ = null;
+        statusBuilder_ = null;
+      }
+
+      return this;
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public com.google.rpc.Status.Builder getStatusBuilder() {
+      
+      onChanged();
+      return getStatusFieldBuilder().getBuilder();
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
+      if (statusBuilder_ != null) {
+        return statusBuilder_.getMessageOrBuilder();
+      } else {
+        return status_ == null ?
+            com.google.rpc.Status.getDefaultInstance() : status_;
+      }
+    }
+    /**
+     * <pre>
+     * Error information for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>.google.rpc.Status status = 3;</code>
+     */
+    private com.google.protobuf.SingleFieldBuilderV3<
+        com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> 
+        getStatusFieldBuilder() {
+      if (statusBuilder_ == null) {
+        statusBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+            com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>(
+                getStatus(),
+                getParentForChildren(),
+                isClean());
+        status_ = null;
+      }
+      return statusBuilder_;
+    }
+    public final Builder setUnknownFields(
+        final com.google.protobuf.UnknownFieldSet unknownFields) {
+      return super.setUnknownFieldsProto3(unknownFields);
+    }
+
+    public final Builder mergeUnknownFields(
+        final com.google.protobuf.UnknownFieldSet unknownFields) {
+      return super.mergeUnknownFields(unknownFields);
+    }
+
+
+    // @@protoc_insertion_point(builder_scope:org.pytorch.serve.grpc.inference.PredictionResponse)
+  }
+
+  // @@protoc_insertion_point(class_scope:org.pytorch.serve.grpc.inference.PredictionResponse)
+  private static final PredictionResponse DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new PredictionResponse();
+  }
+
+  public static PredictionResponse getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final com.google.protobuf.Parser<PredictionResponse>
+      PARSER = new com.google.protobuf.AbstractParser<PredictionResponse>() {
+    public PredictionResponse parsePartialFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return new PredictionResponse(input, extensionRegistry);
+    }
+  };
+
+  public static com.google.protobuf.Parser<PredictionResponse> parser() {
+    return PARSER;
+  }
+
+  @Override
+  public com.google.protobuf.Parser<PredictionResponse> getParserForType() {
+    return PARSER;
+  }
+
+  public PredictionResponse getDefaultInstanceForType() {
+    return DEFAULT_INSTANCE;
+  }
+
+}
+

+ 61 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/PredictionResponseOrBuilder.java

@@ -0,0 +1,61 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+public interface PredictionResponseOrBuilder extends
+    // @@protoc_insertion_point(interface_extends:org.pytorch.serve.grpc.inference.PredictionResponse)
+    com.google.protobuf.MessageOrBuilder {
+
+  /**
+   * <pre>
+   * Response content for prediction
+   * </pre>
+   *
+   * <code>bytes prediction = 1;</code>
+   */
+  com.google.protobuf.ByteString getPrediction();
+
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 2;</code>
+   */
+  String getSequenceId();
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 2;</code>
+   */
+  com.google.protobuf.ByteString
+      getSequenceIdBytes();
+
+  /**
+   * <pre>
+   * Error information for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>.google.rpc.Status status = 3;</code>
+   */
+  boolean hasStatus();
+  /**
+   * <pre>
+   * Error information for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>.google.rpc.Status status = 3;</code>
+   */
+  com.google.rpc.Status getStatus();
+  /**
+   * <pre>
+   * Error information for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>.google.rpc.Status status = 3;</code>
+   */
+  com.google.rpc.StatusOrBuilder getStatusOrBuilder();
+}

+ 1175 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/PredictionsRequest.java

@@ -0,0 +1,1175 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+/**
+ * Protobuf type {@code org.pytorch.serve.grpc.inference.PredictionsRequest}
+ */
+public  final class PredictionsRequest extends
+    com.google.protobuf.GeneratedMessageV3 implements
+    // @@protoc_insertion_point(message_implements:org.pytorch.serve.grpc.inference.PredictionsRequest)
+    PredictionsRequestOrBuilder {
+private static final long serialVersionUID = 0L;
+  // Use PredictionsRequest.newBuilder() to construct.
+  private PredictionsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
+    super(builder);
+  }
+  private PredictionsRequest() {
+    modelName_ = "";
+    modelVersion_ = "";
+    sequenceId_ = "";
+  }
+
+  @Override
+  public final com.google.protobuf.UnknownFieldSet
+  getUnknownFields() {
+    return this.unknownFields;
+  }
+  private PredictionsRequest(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    this();
+    if (extensionRegistry == null) {
+      throw new NullPointerException();
+    }
+    int mutable_bitField0_ = 0;
+    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+        com.google.protobuf.UnknownFieldSet.newBuilder();
+    try {
+      boolean done = false;
+      while (!done) {
+        int tag = input.readTag();
+        switch (tag) {
+          case 0:
+            done = true;
+            break;
+          default: {
+            if (!parseUnknownFieldProto3(
+                input, unknownFields, extensionRegistry, tag)) {
+              done = true;
+            }
+            break;
+          }
+          case 10: {
+            String s = input.readStringRequireUtf8();
+
+            modelName_ = s;
+            break;
+          }
+          case 18: {
+            String s = input.readStringRequireUtf8();
+
+            modelVersion_ = s;
+            break;
+          }
+          case 26: {
+            if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
+              input_ = com.google.protobuf.MapField.newMapField(
+                  InputDefaultEntryHolder.defaultEntry);
+              mutable_bitField0_ |= 0x00000004;
+            }
+            com.google.protobuf.MapEntry<String, com.google.protobuf.ByteString>
+            input__ = input.readMessage(
+                InputDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
+            input_.getMutableMap().put(
+                input__.getKey(), input__.getValue());
+            break;
+          }
+          case 34: {
+            String s = input.readStringRequireUtf8();
+
+            sequenceId_ = s;
+            break;
+          }
+        }
+      }
+    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+      throw e.setUnfinishedMessage(this);
+    } catch (java.io.IOException e) {
+      throw new com.google.protobuf.InvalidProtocolBufferException(
+          e).setUnfinishedMessage(this);
+    } finally {
+      this.unknownFields = unknownFields.build();
+      makeExtensionsImmutable();
+    }
+  }
+  public static final com.google.protobuf.Descriptors.Descriptor
+      getDescriptor() {
+    return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor;
+  }
+
+  @SuppressWarnings({"rawtypes"})
+  protected com.google.protobuf.MapField internalGetMapField(
+      int number) {
+    switch (number) {
+      case 3:
+        return internalGetInput();
+      default:
+        throw new RuntimeException(
+            "Invalid map field number: " + number);
+    }
+  }
+  protected FieldAccessorTable
+      internalGetFieldAccessorTable() {
+    return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_fieldAccessorTable
+        .ensureFieldAccessorsInitialized(
+            PredictionsRequest.class, Builder.class);
+  }
+
+  private int bitField0_;
+  public static final int MODEL_NAME_FIELD_NUMBER = 1;
+  private volatile Object modelName_;
+  /**
+   * <pre>
+   * Name of model.
+   * </pre>
+   *
+   * <code>string model_name = 1;</code>
+   */
+  public String getModelName() {
+    Object ref = modelName_;
+    if (ref instanceof String) {
+      return (String) ref;
+    } else {
+      com.google.protobuf.ByteString bs = 
+          (com.google.protobuf.ByteString) ref;
+      String s = bs.toStringUtf8();
+      modelName_ = s;
+      return s;
+    }
+  }
+  /**
+   * <pre>
+   * Name of model.
+   * </pre>
+   *
+   * <code>string model_name = 1;</code>
+   */
+  public com.google.protobuf.ByteString
+      getModelNameBytes() {
+    Object ref = modelName_;
+    if (ref instanceof String) {
+      com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString.copyFromUtf8(
+              (String) ref);
+      modelName_ = b;
+      return b;
+    } else {
+      return (com.google.protobuf.ByteString) ref;
+    }
+  }
+
+  public static final int MODEL_VERSION_FIELD_NUMBER = 2;
+  private volatile Object modelVersion_;
+  /**
+   * <pre>
+   * Version of model to run prediction on.
+   * </pre>
+   *
+   * <code>string model_version = 2;</code>
+   */
+  public String getModelVersion() {
+    Object ref = modelVersion_;
+    if (ref instanceof String) {
+      return (String) ref;
+    } else {
+      com.google.protobuf.ByteString bs = 
+          (com.google.protobuf.ByteString) ref;
+      String s = bs.toStringUtf8();
+      modelVersion_ = s;
+      return s;
+    }
+  }
+  /**
+   * <pre>
+   * Version of model to run prediction on.
+   * </pre>
+   *
+   * <code>string model_version = 2;</code>
+   */
+  public com.google.protobuf.ByteString
+      getModelVersionBytes() {
+    Object ref = modelVersion_;
+    if (ref instanceof String) {
+      com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString.copyFromUtf8(
+              (String) ref);
+      modelVersion_ = b;
+      return b;
+    } else {
+      return (com.google.protobuf.ByteString) ref;
+    }
+  }
+
+  public static final int INPUT_FIELD_NUMBER = 3;
+  private static final class InputDefaultEntryHolder {
+    static final com.google.protobuf.MapEntry<
+        String, com.google.protobuf.ByteString> defaultEntry =
+            com.google.protobuf.MapEntry
+            .<String, com.google.protobuf.ByteString>newDefaultInstance(
+                Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_InputEntry_descriptor,
+                com.google.protobuf.WireFormat.FieldType.STRING,
+                "",
+                com.google.protobuf.WireFormat.FieldType.BYTES,
+                com.google.protobuf.ByteString.EMPTY);
+  }
+  private com.google.protobuf.MapField<
+      String, com.google.protobuf.ByteString> input_;
+  private com.google.protobuf.MapField<String, com.google.protobuf.ByteString>
+  internalGetInput() {
+    if (input_ == null) {
+      return com.google.protobuf.MapField.emptyMapField(
+          InputDefaultEntryHolder.defaultEntry);
+    }
+    return input_;
+  }
+
+  public int getInputCount() {
+    return internalGetInput().getMap().size();
+  }
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+
+  public boolean containsInput(
+      String key) {
+    if (key == null) { throw new NullPointerException(); }
+    return internalGetInput().getMap().containsKey(key);
+  }
+  /**
+   * Use {@link #getInputMap()} instead.
+   */
+  @Deprecated
+  public java.util.Map<String, com.google.protobuf.ByteString> getInput() {
+    return getInputMap();
+  }
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+
+  public java.util.Map<String, com.google.protobuf.ByteString> getInputMap() {
+    return internalGetInput().getMap();
+  }
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+
+  public com.google.protobuf.ByteString getInputOrDefault(
+      String key,
+      com.google.protobuf.ByteString defaultValue) {
+    if (key == null) { throw new NullPointerException(); }
+    java.util.Map<String, com.google.protobuf.ByteString> map =
+        internalGetInput().getMap();
+    return map.containsKey(key) ? map.get(key) : defaultValue;
+  }
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+
+  public com.google.protobuf.ByteString getInputOrThrow(
+      String key) {
+    if (key == null) { throw new NullPointerException(); }
+    java.util.Map<String, com.google.protobuf.ByteString> map =
+        internalGetInput().getMap();
+    if (!map.containsKey(key)) {
+      throw new IllegalArgumentException();
+    }
+    return map.get(key);
+  }
+
+  public static final int SEQUENCE_ID_FIELD_NUMBER = 4;
+  private volatile Object sequenceId_;
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 4;</code>
+   */
+  public String getSequenceId() {
+    Object ref = sequenceId_;
+    if (ref instanceof String) {
+      return (String) ref;
+    } else {
+      com.google.protobuf.ByteString bs = 
+          (com.google.protobuf.ByteString) ref;
+      String s = bs.toStringUtf8();
+      sequenceId_ = s;
+      return s;
+    }
+  }
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 4;</code>
+   */
+  public com.google.protobuf.ByteString
+      getSequenceIdBytes() {
+    Object ref = sequenceId_;
+    if (ref instanceof String) {
+      com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString.copyFromUtf8(
+              (String) ref);
+      sequenceId_ = b;
+      return b;
+    } else {
+      return (com.google.protobuf.ByteString) ref;
+    }
+  }
+
+  private byte memoizedIsInitialized = -1;
+  public final boolean isInitialized() {
+    byte isInitialized = memoizedIsInitialized;
+    if (isInitialized == 1) return true;
+    if (isInitialized == 0) return false;
+
+    memoizedIsInitialized = 1;
+    return true;
+  }
+
+  public void writeTo(com.google.protobuf.CodedOutputStream output)
+                      throws java.io.IOException {
+    if (!getModelNameBytes().isEmpty()) {
+      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, modelName_);
+    }
+    if (!getModelVersionBytes().isEmpty()) {
+      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, modelVersion_);
+    }
+    com.google.protobuf.GeneratedMessageV3
+      .serializeStringMapTo(
+        output,
+        internalGetInput(),
+        InputDefaultEntryHolder.defaultEntry,
+        3);
+    if (!getSequenceIdBytes().isEmpty()) {
+      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, sequenceId_);
+    }
+    unknownFields.writeTo(output);
+  }
+
+  public int getSerializedSize() {
+    int size = memoizedSize;
+    if (size != -1) return size;
+
+    size = 0;
+    if (!getModelNameBytes().isEmpty()) {
+      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, modelName_);
+    }
+    if (!getModelVersionBytes().isEmpty()) {
+      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, modelVersion_);
+    }
+    for (java.util.Map.Entry<String, com.google.protobuf.ByteString> entry
+         : internalGetInput().getMap().entrySet()) {
+      com.google.protobuf.MapEntry<String, com.google.protobuf.ByteString>
+      input__ = InputDefaultEntryHolder.defaultEntry.newBuilderForType()
+          .setKey(entry.getKey())
+          .setValue(entry.getValue())
+          .build();
+      size += com.google.protobuf.CodedOutputStream
+          .computeMessageSize(3, input__);
+    }
+    if (!getSequenceIdBytes().isEmpty()) {
+      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, sequenceId_);
+    }
+    size += unknownFields.getSerializedSize();
+    memoizedSize = size;
+    return size;
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    if (obj == this) {
+     return true;
+    }
+    if (!(obj instanceof PredictionsRequest)) {
+      return super.equals(obj);
+    }
+    PredictionsRequest other = (PredictionsRequest) obj;
+
+    boolean result = true;
+    result = result && getModelName()
+        .equals(other.getModelName());
+    result = result && getModelVersion()
+        .equals(other.getModelVersion());
+    result = result && internalGetInput().equals(
+        other.internalGetInput());
+    result = result && getSequenceId()
+        .equals(other.getSequenceId());
+    result = result && unknownFields.equals(other.unknownFields);
+    return result;
+  }
+
+  @Override
+  public int hashCode() {
+    if (memoizedHashCode != 0) {
+      return memoizedHashCode;
+    }
+    int hash = 41;
+    hash = (19 * hash) + getDescriptor().hashCode();
+    hash = (37 * hash) + MODEL_NAME_FIELD_NUMBER;
+    hash = (53 * hash) + getModelName().hashCode();
+    hash = (37 * hash) + MODEL_VERSION_FIELD_NUMBER;
+    hash = (53 * hash) + getModelVersion().hashCode();
+    if (!internalGetInput().getMap().isEmpty()) {
+      hash = (37 * hash) + INPUT_FIELD_NUMBER;
+      hash = (53 * hash) + internalGetInput().hashCode();
+    }
+    hash = (37 * hash) + SEQUENCE_ID_FIELD_NUMBER;
+    hash = (53 * hash) + getSequenceId().hashCode();
+    hash = (29 * hash) + unknownFields.hashCode();
+    memoizedHashCode = hash;
+    return hash;
+  }
+
+  public static PredictionsRequest parseFrom(
+      java.nio.ByteBuffer data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static PredictionsRequest parseFrom(
+      java.nio.ByteBuffer data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static PredictionsRequest parseFrom(
+      com.google.protobuf.ByteString data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static PredictionsRequest parseFrom(
+      com.google.protobuf.ByteString data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static PredictionsRequest parseFrom(byte[] data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static PredictionsRequest parseFrom(
+      byte[] data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static PredictionsRequest parseFrom(java.io.InputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input);
+  }
+  public static PredictionsRequest parseFrom(
+      java.io.InputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input, extensionRegistry);
+  }
+  public static PredictionsRequest parseDelimitedFrom(java.io.InputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseDelimitedWithIOException(PARSER, input);
+  }
+  public static PredictionsRequest parseDelimitedFrom(
+      java.io.InputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+  }
+  public static PredictionsRequest parseFrom(
+      com.google.protobuf.CodedInputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input);
+  }
+  public static PredictionsRequest parseFrom(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input, extensionRegistry);
+  }
+
+  public Builder newBuilderForType() { return newBuilder(); }
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(PredictionsRequest prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  @Override
+  protected Builder newBuilderForType(
+      BuilderParent parent) {
+    Builder builder = new Builder(parent);
+    return builder;
+  }
+  /**
+   * Protobuf type {@code org.pytorch.serve.grpc.inference.PredictionsRequest}
+   */
+  public static final class Builder extends
+      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
+      // @@protoc_insertion_point(builder_implements:org.pytorch.serve.grpc.inference.PredictionsRequest)
+      PredictionsRequestOrBuilder {
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor;
+    }
+
+    @SuppressWarnings({"rawtypes"})
+    protected com.google.protobuf.MapField internalGetMapField(
+        int number) {
+      switch (number) {
+        case 3:
+          return internalGetInput();
+        default:
+          throw new RuntimeException(
+              "Invalid map field number: " + number);
+      }
+    }
+    @SuppressWarnings({"rawtypes"})
+    protected com.google.protobuf.MapField internalGetMutableMapField(
+        int number) {
+      switch (number) {
+        case 3:
+          return internalGetMutableInput();
+        default:
+          throw new RuntimeException(
+              "Invalid map field number: " + number);
+      }
+    }
+    protected FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              PredictionsRequest.class, Builder.class);
+    }
+
+    // Construct using org.pytorch.serve.grpc.inference.PredictionsRequest.newBuilder()
+    private Builder() {
+      maybeForceBuilderInitialization();
+    }
+
+    private Builder(
+        BuilderParent parent) {
+      super(parent);
+      maybeForceBuilderInitialization();
+    }
+    private void maybeForceBuilderInitialization() {
+      if (com.google.protobuf.GeneratedMessageV3
+              .alwaysUseFieldBuilders) {
+      }
+    }
+    public Builder clear() {
+      super.clear();
+      modelName_ = "";
+
+      modelVersion_ = "";
+
+      internalGetMutableInput().clear();
+      sequenceId_ = "";
+
+      return this;
+    }
+
+    public com.google.protobuf.Descriptors.Descriptor
+        getDescriptorForType() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_PredictionsRequest_descriptor;
+    }
+
+    public PredictionsRequest getDefaultInstanceForType() {
+      return PredictionsRequest.getDefaultInstance();
+    }
+
+    public PredictionsRequest build() {
+      PredictionsRequest result = buildPartial();
+      if (!result.isInitialized()) {
+        throw newUninitializedMessageException(result);
+      }
+      return result;
+    }
+
+    public PredictionsRequest buildPartial() {
+      PredictionsRequest result = new PredictionsRequest(this);
+      int from_bitField0_ = bitField0_;
+      int to_bitField0_ = 0;
+      result.modelName_ = modelName_;
+      result.modelVersion_ = modelVersion_;
+      result.input_ = internalGetInput();
+      result.input_.makeImmutable();
+      result.sequenceId_ = sequenceId_;
+      result.bitField0_ = to_bitField0_;
+      onBuilt();
+      return result;
+    }
+
+    public Builder clone() {
+      return (Builder) super.clone();
+    }
+    public Builder setField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        Object value) {
+      return (Builder) super.setField(field, value);
+    }
+    public Builder clearField(
+        com.google.protobuf.Descriptors.FieldDescriptor field) {
+      return (Builder) super.clearField(field);
+    }
+    public Builder clearOneof(
+        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+      return (Builder) super.clearOneof(oneof);
+    }
+    public Builder setRepeatedField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        int index, Object value) {
+      return (Builder) super.setRepeatedField(field, index, value);
+    }
+    public Builder addRepeatedField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        Object value) {
+      return (Builder) super.addRepeatedField(field, value);
+    }
+    public Builder mergeFrom(com.google.protobuf.Message other) {
+      if (other instanceof PredictionsRequest) {
+        return mergeFrom((PredictionsRequest)other);
+      } else {
+        super.mergeFrom(other);
+        return this;
+      }
+    }
+
+    public Builder mergeFrom(PredictionsRequest other) {
+      if (other == PredictionsRequest.getDefaultInstance()) return this;
+      if (!other.getModelName().isEmpty()) {
+        modelName_ = other.modelName_;
+        onChanged();
+      }
+      if (!other.getModelVersion().isEmpty()) {
+        modelVersion_ = other.modelVersion_;
+        onChanged();
+      }
+      internalGetMutableInput().mergeFrom(
+          other.internalGetInput());
+      if (!other.getSequenceId().isEmpty()) {
+        sequenceId_ = other.sequenceId_;
+        onChanged();
+      }
+      this.mergeUnknownFields(other.unknownFields);
+      onChanged();
+      return this;
+    }
+
+    public final boolean isInitialized() {
+      return true;
+    }
+
+    public Builder mergeFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      PredictionsRequest parsedMessage = null;
+      try {
+        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        parsedMessage = (PredictionsRequest) e.getUnfinishedMessage();
+        throw e.unwrapIOException();
+      } finally {
+        if (parsedMessage != null) {
+          mergeFrom(parsedMessage);
+        }
+      }
+      return this;
+    }
+    private int bitField0_;
+
+    private Object modelName_ = "";
+    /**
+     * <pre>
+     * Name of model.
+     * </pre>
+     *
+     * <code>string model_name = 1;</code>
+     */
+    public String getModelName() {
+      Object ref = modelName_;
+      if (!(ref instanceof String)) {
+        com.google.protobuf.ByteString bs =
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        modelName_ = s;
+        return s;
+      } else {
+        return (String) ref;
+      }
+    }
+    /**
+     * <pre>
+     * Name of model.
+     * </pre>
+     *
+     * <code>string model_name = 1;</code>
+     */
+    public com.google.protobuf.ByteString
+        getModelNameBytes() {
+      Object ref = modelName_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        modelName_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+    /**
+     * <pre>
+     * Name of model.
+     * </pre>
+     *
+     * <code>string model_name = 1;</code>
+     */
+    public Builder setModelName(
+        String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  
+      modelName_ = value;
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * Name of model.
+     * </pre>
+     *
+     * <code>string model_name = 1;</code>
+     */
+    public Builder clearModelName() {
+      
+      modelName_ = getDefaultInstance().getModelName();
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * Name of model.
+     * </pre>
+     *
+     * <code>string model_name = 1;</code>
+     */
+    public Builder setModelNameBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+      
+      modelName_ = value;
+      onChanged();
+      return this;
+    }
+
+    private Object modelVersion_ = "";
+    /**
+     * <pre>
+     * Version of model to run prediction on.
+     * </pre>
+     *
+     * <code>string model_version = 2;</code>
+     */
+    public String getModelVersion() {
+      Object ref = modelVersion_;
+      if (!(ref instanceof String)) {
+        com.google.protobuf.ByteString bs =
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        modelVersion_ = s;
+        return s;
+      } else {
+        return (String) ref;
+      }
+    }
+    /**
+     * <pre>
+     * Version of model to run prediction on.
+     * </pre>
+     *
+     * <code>string model_version = 2;</code>
+     */
+    public com.google.protobuf.ByteString
+        getModelVersionBytes() {
+      Object ref = modelVersion_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        modelVersion_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+    /**
+     * <pre>
+     * Version of model to run prediction on.
+     * </pre>
+     *
+     * <code>string model_version = 2;</code>
+     */
+    public Builder setModelVersion(
+        String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  
+      modelVersion_ = value;
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * Version of model to run prediction on.
+     * </pre>
+     *
+     * <code>string model_version = 2;</code>
+     */
+    public Builder clearModelVersion() {
+      
+      modelVersion_ = getDefaultInstance().getModelVersion();
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * Version of model to run prediction on.
+     * </pre>
+     *
+     * <code>string model_version = 2;</code>
+     */
+    public Builder setModelVersionBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+      
+      modelVersion_ = value;
+      onChanged();
+      return this;
+    }
+
+    private com.google.protobuf.MapField<
+        String, com.google.protobuf.ByteString> input_;
+    private com.google.protobuf.MapField<String, com.google.protobuf.ByteString>
+    internalGetInput() {
+      if (input_ == null) {
+        return com.google.protobuf.MapField.emptyMapField(
+            InputDefaultEntryHolder.defaultEntry);
+      }
+      return input_;
+    }
+    private com.google.protobuf.MapField<String, com.google.protobuf.ByteString>
+    internalGetMutableInput() {
+      onChanged();;
+      if (input_ == null) {
+        input_ = com.google.protobuf.MapField.newMapField(
+            InputDefaultEntryHolder.defaultEntry);
+      }
+      if (!input_.isMutable()) {
+        input_ = input_.copy();
+      }
+      return input_;
+    }
+
+    public int getInputCount() {
+      return internalGetInput().getMap().size();
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+
+    public boolean containsInput(
+        String key) {
+      if (key == null) { throw new NullPointerException(); }
+      return internalGetInput().getMap().containsKey(key);
+    }
+    /**
+     * Use {@link #getInputMap()} instead.
+     */
+    @Deprecated
+    public java.util.Map<String, com.google.protobuf.ByteString> getInput() {
+      return getInputMap();
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+
+    public java.util.Map<String, com.google.protobuf.ByteString> getInputMap() {
+      return internalGetInput().getMap();
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+
+    public com.google.protobuf.ByteString getInputOrDefault(
+        String key,
+        com.google.protobuf.ByteString defaultValue) {
+      if (key == null) { throw new NullPointerException(); }
+      java.util.Map<String, com.google.protobuf.ByteString> map =
+          internalGetInput().getMap();
+      return map.containsKey(key) ? map.get(key) : defaultValue;
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+
+    public com.google.protobuf.ByteString getInputOrThrow(
+        String key) {
+      if (key == null) { throw new NullPointerException(); }
+      java.util.Map<String, com.google.protobuf.ByteString> map =
+          internalGetInput().getMap();
+      if (!map.containsKey(key)) {
+        throw new IllegalArgumentException();
+      }
+      return map.get(key);
+    }
+
+    public Builder clearInput() {
+      internalGetMutableInput().getMutableMap()
+          .clear();
+      return this;
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+
+    public Builder removeInput(
+        String key) {
+      if (key == null) { throw new NullPointerException(); }
+      internalGetMutableInput().getMutableMap()
+          .remove(key);
+      return this;
+    }
+    /**
+     * Use alternate mutation accessors instead.
+     */
+    @Deprecated
+    public java.util.Map<String, com.google.protobuf.ByteString>
+    getMutableInput() {
+      return internalGetMutableInput().getMutableMap();
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+    public Builder putInput(
+        String key,
+        com.google.protobuf.ByteString value) {
+      if (key == null) { throw new NullPointerException(); }
+      if (value == null) { throw new NullPointerException(); }
+      internalGetMutableInput().getMutableMap()
+          .put(key, value);
+      return this;
+    }
+    /**
+     * <pre>
+     * Input data for model prediction
+     * </pre>
+     *
+     * <code>map&lt;string, bytes&gt; input = 3;</code>
+     */
+
+    public Builder putAllInput(
+        java.util.Map<String, com.google.protobuf.ByteString> values) {
+      internalGetMutableInput().getMutableMap()
+          .putAll(values);
+      return this;
+    }
+
+    private Object sequenceId_ = "";
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 4;</code>
+     */
+    public String getSequenceId() {
+      Object ref = sequenceId_;
+      if (!(ref instanceof String)) {
+        com.google.protobuf.ByteString bs =
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        sequenceId_ = s;
+        return s;
+      } else {
+        return (String) ref;
+      }
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 4;</code>
+     */
+    public com.google.protobuf.ByteString
+        getSequenceIdBytes() {
+      Object ref = sequenceId_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        sequenceId_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 4;</code>
+     */
+    public Builder setSequenceId(
+        String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  
+      sequenceId_ = value;
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 4;</code>
+     */
+    public Builder clearSequenceId() {
+      
+      sequenceId_ = getDefaultInstance().getSequenceId();
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * SequenceId is required for StreamPredictions2 API.
+     * </pre>
+     *
+     * <code>string sequence_id = 4;</code>
+     */
+    public Builder setSequenceIdBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+      
+      sequenceId_ = value;
+      onChanged();
+      return this;
+    }
+    public final Builder setUnknownFields(
+        final com.google.protobuf.UnknownFieldSet unknownFields) {
+      return super.setUnknownFieldsProto3(unknownFields);
+    }
+
+    public final Builder mergeUnknownFields(
+        final com.google.protobuf.UnknownFieldSet unknownFields) {
+      return super.mergeUnknownFields(unknownFields);
+    }
+
+
+    // @@protoc_insertion_point(builder_scope:org.pytorch.serve.grpc.inference.PredictionsRequest)
+  }
+
+  // @@protoc_insertion_point(class_scope:org.pytorch.serve.grpc.inference.PredictionsRequest)
+  private static final PredictionsRequest DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new PredictionsRequest();
+  }
+
+  public static PredictionsRequest getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final com.google.protobuf.Parser<PredictionsRequest>
+      PARSER = new com.google.protobuf.AbstractParser<PredictionsRequest>() {
+    public PredictionsRequest parsePartialFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return new PredictionsRequest(input, extensionRegistry);
+    }
+  };
+
+  public static com.google.protobuf.Parser<PredictionsRequest> parser() {
+    return PARSER;
+  }
+
+  @Override
+  public com.google.protobuf.Parser<PredictionsRequest> getParserForType() {
+    return PARSER;
+  }
+
+  public PredictionsRequest getDefaultInstanceForType() {
+    return DEFAULT_INSTANCE;
+  }
+
+}
+

+ 117 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/PredictionsRequestOrBuilder.java

@@ -0,0 +1,117 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+public interface PredictionsRequestOrBuilder extends
+    // @@protoc_insertion_point(interface_extends:org.pytorch.serve.grpc.inference.PredictionsRequest)
+    com.google.protobuf.MessageOrBuilder {
+
+  /**
+   * <pre>
+   * Name of model.
+   * </pre>
+   *
+   * <code>string model_name = 1;</code>
+   */
+  String getModelName();
+  /**
+   * <pre>
+   * Name of model.
+   * </pre>
+   *
+   * <code>string model_name = 1;</code>
+   */
+  com.google.protobuf.ByteString
+      getModelNameBytes();
+
+  /**
+   * <pre>
+   * Version of model to run prediction on.
+   * </pre>
+   *
+   * <code>string model_version = 2;</code>
+   */
+  String getModelVersion();
+  /**
+   * <pre>
+   * Version of model to run prediction on.
+   * </pre>
+   *
+   * <code>string model_version = 2;</code>
+   */
+  com.google.protobuf.ByteString
+      getModelVersionBytes();
+
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+  int getInputCount();
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+  boolean containsInput(
+      String key);
+  /**
+   * Use {@link #getInputMap()} instead.
+   */
+  @Deprecated
+  java.util.Map<String, com.google.protobuf.ByteString>
+  getInput();
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+  java.util.Map<String, com.google.protobuf.ByteString>
+  getInputMap();
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+
+  com.google.protobuf.ByteString getInputOrDefault(
+      String key,
+      com.google.protobuf.ByteString defaultValue);
+  /**
+   * <pre>
+   * Input data for model prediction
+   * </pre>
+   *
+   * <code>map&lt;string, bytes&gt; input = 3;</code>
+   */
+
+  com.google.protobuf.ByteString getInputOrThrow(
+      String key);
+
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 4;</code>
+   */
+  String getSequenceId();
+  /**
+   * <pre>
+   * SequenceId is required for StreamPredictions2 API.
+   * </pre>
+   *
+   * <code>string sequence_id = 4;</code>
+   */
+  com.google.protobuf.ByteString
+      getSequenceIdBytes();
+}

+ 544 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/TorchServeHealthResponse.java

@@ -0,0 +1,544 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+/**
+ * Protobuf type {@code org.pytorch.serve.grpc.inference.TorchServeHealthResponse}
+ */
+public  final class TorchServeHealthResponse extends
+    com.google.protobuf.GeneratedMessageV3 implements
+    // @@protoc_insertion_point(message_implements:org.pytorch.serve.grpc.inference.TorchServeHealthResponse)
+    TorchServeHealthResponseOrBuilder {
+private static final long serialVersionUID = 0L;
+  // Use TorchServeHealthResponse.newBuilder() to construct.
+  private TorchServeHealthResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
+    super(builder);
+  }
+  private TorchServeHealthResponse() {
+    health_ = "";
+  }
+
+  @Override
+  public final com.google.protobuf.UnknownFieldSet
+  getUnknownFields() {
+    return this.unknownFields;
+  }
+  private TorchServeHealthResponse(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    this();
+    if (extensionRegistry == null) {
+      throw new NullPointerException();
+    }
+    int mutable_bitField0_ = 0;
+    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
+        com.google.protobuf.UnknownFieldSet.newBuilder();
+    try {
+      boolean done = false;
+      while (!done) {
+        int tag = input.readTag();
+        switch (tag) {
+          case 0:
+            done = true;
+            break;
+          default: {
+            if (!parseUnknownFieldProto3(
+                input, unknownFields, extensionRegistry, tag)) {
+              done = true;
+            }
+            break;
+          }
+          case 10: {
+            String s = input.readStringRequireUtf8();
+
+            health_ = s;
+            break;
+          }
+        }
+      }
+    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+      throw e.setUnfinishedMessage(this);
+    } catch (java.io.IOException e) {
+      throw new com.google.protobuf.InvalidProtocolBufferException(
+          e).setUnfinishedMessage(this);
+    } finally {
+      this.unknownFields = unknownFields.build();
+      makeExtensionsImmutable();
+    }
+  }
+  public static final com.google.protobuf.Descriptors.Descriptor
+      getDescriptor() {
+    return Inference.internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_descriptor;
+  }
+
+  protected FieldAccessorTable
+      internalGetFieldAccessorTable() {
+    return Inference.internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_fieldAccessorTable
+        .ensureFieldAccessorsInitialized(
+            TorchServeHealthResponse.class, Builder.class);
+  }
+
+  public static final int HEALTH_FIELD_NUMBER = 1;
+  private volatile Object health_;
+  /**
+   * <pre>
+   * TorchServe health
+   * </pre>
+   *
+   * <code>string health = 1;</code>
+   */
+  public String getHealth() {
+    Object ref = health_;
+    if (ref instanceof String) {
+      return (String) ref;
+    } else {
+      com.google.protobuf.ByteString bs = 
+          (com.google.protobuf.ByteString) ref;
+      String s = bs.toStringUtf8();
+      health_ = s;
+      return s;
+    }
+  }
+  /**
+   * <pre>
+   * TorchServe health
+   * </pre>
+   *
+   * <code>string health = 1;</code>
+   */
+  public com.google.protobuf.ByteString
+      getHealthBytes() {
+    Object ref = health_;
+    if (ref instanceof String) {
+      com.google.protobuf.ByteString b = 
+          com.google.protobuf.ByteString.copyFromUtf8(
+              (String) ref);
+      health_ = b;
+      return b;
+    } else {
+      return (com.google.protobuf.ByteString) ref;
+    }
+  }
+
+  private byte memoizedIsInitialized = -1;
+  public final boolean isInitialized() {
+    byte isInitialized = memoizedIsInitialized;
+    if (isInitialized == 1) return true;
+    if (isInitialized == 0) return false;
+
+    memoizedIsInitialized = 1;
+    return true;
+  }
+
+  public void writeTo(com.google.protobuf.CodedOutputStream output)
+                      throws java.io.IOException {
+    if (!getHealthBytes().isEmpty()) {
+      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, health_);
+    }
+    unknownFields.writeTo(output);
+  }
+
+  public int getSerializedSize() {
+    int size = memoizedSize;
+    if (size != -1) return size;
+
+    size = 0;
+    if (!getHealthBytes().isEmpty()) {
+      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, health_);
+    }
+    size += unknownFields.getSerializedSize();
+    memoizedSize = size;
+    return size;
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    if (obj == this) {
+     return true;
+    }
+    if (!(obj instanceof TorchServeHealthResponse)) {
+      return super.equals(obj);
+    }
+    TorchServeHealthResponse other = (TorchServeHealthResponse) obj;
+
+    boolean result = true;
+    result = result && getHealth()
+        .equals(other.getHealth());
+    result = result && unknownFields.equals(other.unknownFields);
+    return result;
+  }
+
+  @Override
+  public int hashCode() {
+    if (memoizedHashCode != 0) {
+      return memoizedHashCode;
+    }
+    int hash = 41;
+    hash = (19 * hash) + getDescriptor().hashCode();
+    hash = (37 * hash) + HEALTH_FIELD_NUMBER;
+    hash = (53 * hash) + getHealth().hashCode();
+    hash = (29 * hash) + unknownFields.hashCode();
+    memoizedHashCode = hash;
+    return hash;
+  }
+
+  public static TorchServeHealthResponse parseFrom(
+      java.nio.ByteBuffer data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      java.nio.ByteBuffer data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      com.google.protobuf.ByteString data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      com.google.protobuf.ByteString data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static TorchServeHealthResponse parseFrom(byte[] data)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      byte[] data,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws com.google.protobuf.InvalidProtocolBufferException {
+    return PARSER.parseFrom(data, extensionRegistry);
+  }
+  public static TorchServeHealthResponse parseFrom(java.io.InputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      java.io.InputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input, extensionRegistry);
+  }
+  public static TorchServeHealthResponse parseDelimitedFrom(java.io.InputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseDelimitedWithIOException(PARSER, input);
+  }
+  public static TorchServeHealthResponse parseDelimitedFrom(
+      java.io.InputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      com.google.protobuf.CodedInputStream input)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input);
+  }
+  public static TorchServeHealthResponse parseFrom(
+      com.google.protobuf.CodedInputStream input,
+      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+      throws java.io.IOException {
+    return com.google.protobuf.GeneratedMessageV3
+        .parseWithIOException(PARSER, input, extensionRegistry);
+  }
+
+  public Builder newBuilderForType() { return newBuilder(); }
+  public static Builder newBuilder() {
+    return DEFAULT_INSTANCE.toBuilder();
+  }
+  public static Builder newBuilder(TorchServeHealthResponse prototype) {
+    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+  }
+  public Builder toBuilder() {
+    return this == DEFAULT_INSTANCE
+        ? new Builder() : new Builder().mergeFrom(this);
+  }
+
+  @Override
+  protected Builder newBuilderForType(
+      BuilderParent parent) {
+    Builder builder = new Builder(parent);
+    return builder;
+  }
+  /**
+   * Protobuf type {@code org.pytorch.serve.grpc.inference.TorchServeHealthResponse}
+   */
+  public static final class Builder extends
+      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
+      // @@protoc_insertion_point(builder_implements:org.pytorch.serve.grpc.inference.TorchServeHealthResponse)
+      TorchServeHealthResponseOrBuilder {
+    public static final com.google.protobuf.Descriptors.Descriptor
+        getDescriptor() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_descriptor;
+    }
+
+    protected FieldAccessorTable
+        internalGetFieldAccessorTable() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_fieldAccessorTable
+          .ensureFieldAccessorsInitialized(
+              TorchServeHealthResponse.class, Builder.class);
+    }
+
+    // Construct using org.pytorch.serve.grpc.inference.TorchServeHealthResponse.newBuilder()
+    private Builder() {
+      maybeForceBuilderInitialization();
+    }
+
+    private Builder(
+        BuilderParent parent) {
+      super(parent);
+      maybeForceBuilderInitialization();
+    }
+    private void maybeForceBuilderInitialization() {
+      if (com.google.protobuf.GeneratedMessageV3
+              .alwaysUseFieldBuilders) {
+      }
+    }
+    public Builder clear() {
+      super.clear();
+      health_ = "";
+
+      return this;
+    }
+
+    public com.google.protobuf.Descriptors.Descriptor
+        getDescriptorForType() {
+      return Inference.internal_static_org_pytorch_serve_grpc_inference_TorchServeHealthResponse_descriptor;
+    }
+
+    public TorchServeHealthResponse getDefaultInstanceForType() {
+      return TorchServeHealthResponse.getDefaultInstance();
+    }
+
+    public TorchServeHealthResponse build() {
+      TorchServeHealthResponse result = buildPartial();
+      if (!result.isInitialized()) {
+        throw newUninitializedMessageException(result);
+      }
+      return result;
+    }
+
+    public TorchServeHealthResponse buildPartial() {
+      TorchServeHealthResponse result = new TorchServeHealthResponse(this);
+      result.health_ = health_;
+      onBuilt();
+      return result;
+    }
+
+    public Builder clone() {
+      return (Builder) super.clone();
+    }
+    public Builder setField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        Object value) {
+      return (Builder) super.setField(field, value);
+    }
+    public Builder clearField(
+        com.google.protobuf.Descriptors.FieldDescriptor field) {
+      return (Builder) super.clearField(field);
+    }
+    public Builder clearOneof(
+        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+      return (Builder) super.clearOneof(oneof);
+    }
+    public Builder setRepeatedField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        int index, Object value) {
+      return (Builder) super.setRepeatedField(field, index, value);
+    }
+    public Builder addRepeatedField(
+        com.google.protobuf.Descriptors.FieldDescriptor field,
+        Object value) {
+      return (Builder) super.addRepeatedField(field, value);
+    }
+    public Builder mergeFrom(com.google.protobuf.Message other) {
+      if (other instanceof TorchServeHealthResponse) {
+        return mergeFrom((TorchServeHealthResponse)other);
+      } else {
+        super.mergeFrom(other);
+        return this;
+      }
+    }
+
+    public Builder mergeFrom(TorchServeHealthResponse other) {
+      if (other == TorchServeHealthResponse.getDefaultInstance()) return this;
+      if (!other.getHealth().isEmpty()) {
+        health_ = other.health_;
+        onChanged();
+      }
+      this.mergeUnknownFields(other.unknownFields);
+      onChanged();
+      return this;
+    }
+
+    public final boolean isInitialized() {
+      return true;
+    }
+
+    public Builder mergeFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws java.io.IOException {
+      TorchServeHealthResponse parsedMessage = null;
+      try {
+        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
+      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+        parsedMessage = (TorchServeHealthResponse) e.getUnfinishedMessage();
+        throw e.unwrapIOException();
+      } finally {
+        if (parsedMessage != null) {
+          mergeFrom(parsedMessage);
+        }
+      }
+      return this;
+    }
+
+    private Object health_ = "";
+    /**
+     * <pre>
+     * TorchServe health
+     * </pre>
+     *
+     * <code>string health = 1;</code>
+     */
+    public String getHealth() {
+      Object ref = health_;
+      if (!(ref instanceof String)) {
+        com.google.protobuf.ByteString bs =
+            (com.google.protobuf.ByteString) ref;
+        String s = bs.toStringUtf8();
+        health_ = s;
+        return s;
+      } else {
+        return (String) ref;
+      }
+    }
+    /**
+     * <pre>
+     * TorchServe health
+     * </pre>
+     *
+     * <code>string health = 1;</code>
+     */
+    public com.google.protobuf.ByteString
+        getHealthBytes() {
+      Object ref = health_;
+      if (ref instanceof String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (String) ref);
+        health_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+    /**
+     * <pre>
+     * TorchServe health
+     * </pre>
+     *
+     * <code>string health = 1;</code>
+     */
+    public Builder setHealth(
+        String value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  
+      health_ = value;
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * TorchServe health
+     * </pre>
+     *
+     * <code>string health = 1;</code>
+     */
+    public Builder clearHealth() {
+      
+      health_ = getDefaultInstance().getHealth();
+      onChanged();
+      return this;
+    }
+    /**
+     * <pre>
+     * TorchServe health
+     * </pre>
+     *
+     * <code>string health = 1;</code>
+     */
+    public Builder setHealthBytes(
+        com.google.protobuf.ByteString value) {
+      if (value == null) {
+    throw new NullPointerException();
+  }
+  checkByteStringIsUtf8(value);
+      
+      health_ = value;
+      onChanged();
+      return this;
+    }
+    public final Builder setUnknownFields(
+        final com.google.protobuf.UnknownFieldSet unknownFields) {
+      return super.setUnknownFieldsProto3(unknownFields);
+    }
+
+    public final Builder mergeUnknownFields(
+        final com.google.protobuf.UnknownFieldSet unknownFields) {
+      return super.mergeUnknownFields(unknownFields);
+    }
+
+
+    // @@protoc_insertion_point(builder_scope:org.pytorch.serve.grpc.inference.TorchServeHealthResponse)
+  }
+
+  // @@protoc_insertion_point(class_scope:org.pytorch.serve.grpc.inference.TorchServeHealthResponse)
+  private static final TorchServeHealthResponse DEFAULT_INSTANCE;
+  static {
+    DEFAULT_INSTANCE = new TorchServeHealthResponse();
+  }
+
+  public static TorchServeHealthResponse getDefaultInstance() {
+    return DEFAULT_INSTANCE;
+  }
+
+  private static final com.google.protobuf.Parser<TorchServeHealthResponse>
+      PARSER = new com.google.protobuf.AbstractParser<TorchServeHealthResponse>() {
+    public TorchServeHealthResponse parsePartialFrom(
+        com.google.protobuf.CodedInputStream input,
+        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+        throws com.google.protobuf.InvalidProtocolBufferException {
+      return new TorchServeHealthResponse(input, extensionRegistry);
+    }
+  };
+
+  public static com.google.protobuf.Parser<TorchServeHealthResponse> parser() {
+    return PARSER;
+  }
+
+  @Override
+  public com.google.protobuf.Parser<TorchServeHealthResponse> getParserForType() {
+    return PARSER;
+  }
+
+  public TorchServeHealthResponse getDefaultInstanceForType() {
+    return DEFAULT_INSTANCE;
+  }
+
+}
+

+ 27 - 0
slibra-admin/src/main/java/org/pytorch/serve/grpc/inference/TorchServeHealthResponseOrBuilder.java

@@ -0,0 +1,27 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: inference.proto
+
+package org.pytorch.serve.grpc.inference;
+
+public interface TorchServeHealthResponseOrBuilder extends
+    // @@protoc_insertion_point(interface_extends:org.pytorch.serve.grpc.inference.TorchServeHealthResponse)
+    com.google.protobuf.MessageOrBuilder {
+
+  /**
+   * <pre>
+   * TorchServe health
+   * </pre>
+   *
+   * <code>string health = 1;</code>
+   */
+  String getHealth();
+  /**
+   * <pre>
+   * TorchServe health
+   * </pre>
+   *
+   * <code>string health = 1;</code>
+   */
+  com.google.protobuf.ByteString
+      getHealthBytes();
+}