syntax = "proto3";

package narsil.inference.v1;

service Inference {
  rpc Predict(PredictRequest) returns (PredictResponse);
}

message PredictRequest {
  string model_name = 1;
  repeated Tensor inputs = 2;
  map<string, string> parameters = 3;
}

message PredictResponse {
  repeated Tensor outputs = 1;
  map<string, string> metadata = 2;
}

message Tensor {
  string name = 1;
  DataType dtype = 2;
  repeated uint64 shape = 3;
  bytes data = 4;
}

enum DataType {
  DATA_TYPE_UNSPECIFIED = 0;
  DATA_TYPE_F32 = 1;
  DATA_TYPE_F64 = 2;
  DATA_TYPE_I64 = 3;
  DATA_TYPE_I32 = 4;
  DATA_TYPE_U8 = 5;
  DATA_TYPE_BOOL = 6;
}
