To add microservice components to a runtime prediction graph users need to create service that respects the internal API. The API provides a default service for each type of component within the system:
A service to return predictions.
Endpoint | POST /predict |
Request | JSON representation of SeldonMessage |
Response | JSON representation of SeldonMessage |
Example request payload:
{"data":{"names":["a","b"],"tensor":{"shape":[2,2],"values":[0,0,1,1]}}}
service Model {
rpc Predict(SeldonMessage) returns (SeldonMessage) {};
}
See full proto definition.
A service to route requests to one of its children and receive feedback rewards for them.
Endpoint | POST /route |
Request | JSON representation of SeldonMessage |
Response | JSON representation of SeldonMessage |
Example request payload:
{"data":{"names":["a","b"],"tensor":{"shape":[2,2],"values":[0,0,1,1]}}}
Endpoint | POST /send-feedback |
Request | JSON representation of Feedback |
Response | JSON representation of SeldonMessage |
Example request payload:
"request": {
"data": {
"names": ["a", "b"],
"tensor": {
"shape": [1, 2],
"values": [0, 1]
}
}
},
"response": {
"data": {
"names": ["a", "b"],
"tensor": {
"shape": [1, 1],
"values": [0.9]
}
}
},
"reward": 1.0
}
service Router {
rpc Route(SeldonMessage) returns (SeldonMessage) {};
rpc SendFeedback(Feedback) returns (SeldonMessage) {};
}
See full proto definition.
A service to combine reponses from its children into a single response.
Endpoint | POST /combine |
Request | JSON representation of SeldonMessageList |
Response | JSON representation of SeldonMessage |
service Combiner {
rpc Aggregate(SeldonMessageList) returns (SeldonMessage) {};
}
See full proto definition.
A service to transform its input.
Endpoint | POST /transform-input |
Request | JSON representation of SeldonMessage |
Response | JSON representation of SeldonMessage |
Example request payload:
{"data":{"names":["a","b"],"tensor":{"shape":[2,2],"values":[0,0,1,1]}}}
service Transformer {
rpc TransformInput(SeldonMessage) returns (SeldonMessage) {};
}
See full proto definition.
A service to transform the response from its child.
Endpoint | POST /transform-output |
Request | JSON representation of SeldonMessage |
Response | JSON representation of SeldonMessage |
Example request payload:
{"data":{"names":["a","b"],"tensor":{"shape":[2,2],"values":[0,0,1,1]}}}
service OutputTransformer {
rpc TransformOutput(SeldonMessage) returns (SeldonMessage) {};
}
See full proto definition.