You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

inference.api 5.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. syntax = "v1"
  2. type (
  3. /******************image inference*************************/
  4. DeployInstance {
  5. Id string `json:"id"`
  6. DeployTaskId string `json:"deployTaskId"`
  7. InstanceId string `json:"instanceId"`
  8. InstanceName string `json:"instanceName"`
  9. AdapterId string `json:"adapterId"`
  10. AdapterName string `json:"adapterName"`
  11. ClusterId string `json:"clusterId"`
  12. ClusterName string `json:"clusterName"`
  13. ModelName string `json:"modelName"`
  14. ModelType string `json:"modelType"`
  15. InferCard string `json:"inferCard"`
  16. Status string `json:"status"`
  17. CreateTime string `json:"createTime"`
  18. UpdateTime string `json:"updateTime"`
  19. ClusterType string `json:"clusterType"`
  20. }
  21. /******************image inference*************************/
  22. ModelTypesResp {
  23. ModelTypes []string `json:"types"`
  24. }
  25. ModelNamesReq {
  26. Type string `form:"type"`
  27. }
  28. ModelNamesResp {
  29. ModelNames []string `json:"models"`
  30. }
  31. /******************image inference*************************/
  32. ImageInferenceReq {
  33. TaskName string `form:"taskName"`
  34. TaskDesc string `form:"taskDesc"`
  35. ModelType string `form:"modelType"`
  36. InstanceIds []int64 `form:"instanceIds"`
  37. Strategy string `form:"strategy,,optional"`
  38. StaticWeightMap map[string]map[string]int32 `form:"staticWeightMap,optional"`
  39. Replica int32 `form:"replicas,optional"`
  40. }
  41. ImageInferenceResp {
  42. InferResults []*ImageResult `json:"result"`
  43. }
  44. ImageResult {
  45. ClusterId string `json:"clusterId"`
  46. ClusterName string `json:"clusterName"`
  47. ImageName string `json:"imageName"`
  48. Card string `json:"card"`
  49. ImageResult string `json:"imageResult"`
  50. }
  51. InferenceTaskDetailReq{
  52. taskId int64 `form:"taskId"`
  53. }
  54. InferenceTaskDetailResp{
  55. InferenceResults []InferenceResult `json:"data"`
  56. Code int32 `json:"code,omitempty"`
  57. Msg string `json:"msg,omitempty"`
  58. }
  59. InferenceResult{
  60. imageName string `json:"imageName"`
  61. TaskName string `json:"taskName"`
  62. TaskAiName string `json:"taskAiName"`
  63. result string `json:"result"`
  64. card string `json:"card"`
  65. clusterName string `json:"clusterName"`
  66. }
  67. /******************TextToText inference*************************/
  68. TextToTextInferenceReq{
  69. TaskName string `form:"taskName"`
  70. TaskDesc string `form:"taskDesc"`
  71. ModelName string `form:"modelName"`
  72. ModelType string `form:"modelType"`
  73. AdapterId string `form:"adapterId"`
  74. AiClusterIds []string `form:"aiClusterIds"`
  75. }
  76. TextToTextInferenceResp{
  77. }
  78. /******************TextToImage inference*************************/
  79. TextToImageInferenceReq{
  80. TaskName string `form:"taskName"`
  81. TaskDesc string `form:"taskDesc"`
  82. ModelName string `form:"modelName"`
  83. ModelType string `form:"modelType"`
  84. AiClusterIds []string `form:"aiClusterIds"`
  85. }
  86. TextToImageInferenceResp{
  87. Result []byte `json:"result"`
  88. }
  89. /******************Deploy instance*************************/
  90. DeployInstanceListReq{
  91. PageInfo
  92. }
  93. DeployInstanceListResp {
  94. PageResult
  95. }
  96. StartDeployInstanceReq {
  97. AdapterId string `form:"adapterId"`
  98. ClusterId string `form:"clusterId"`
  99. Id string `form:"id"`
  100. InstanceId string `form:"instanceId"`
  101. }
  102. StartDeployInstanceResp {
  103. }
  104. StopDeployInstanceReq {
  105. AdapterId string `form:"adapterId"`
  106. ClusterId string `form:"clusterId"`
  107. Id string `form:"id"`
  108. InstanceId string `form:"instanceId"`
  109. }
  110. StopDeployInstanceResp {
  111. }
  112. DeployInstanceStatReq {
  113. }
  114. DeployInstanceStatResp {
  115. Running int32 `json:"running"`
  116. Total int32 `json:"total"`
  117. }
  118. InferenceTaskStatReq {}
  119. InferenceTaskStatResp {
  120. Running int32 `json:"running"`
  121. Total int32 `json:"total"`
  122. }
  123. StartAllByDeployTaskIdReq {
  124. Id string `json:"deployTaskId"`
  125. }
  126. StartAllByDeployTaskIdResp {
  127. }
  128. StopAllByDeployTaskIdReq {
  129. Id string `json:"deployTaskId"`
  130. }
  131. StopAllByDeployTaskIdResp {
  132. }
  133. GetRunningInstanceReq {
  134. Id string `form:"deployTaskId"`
  135. AdapterId string `form:"adapterId"`
  136. }
  137. GetRunningInstanceResp {
  138. List interface{} `json:"list"`
  139. }
  140. GetDeployTasksByTypeReq {
  141. ModelType string `form:"modelType"`
  142. }
  143. GetDeployTasksByTypeResp {
  144. List interface{} `json:"list"`
  145. }
  146. CreateDeployTaskReq {
  147. TaskName string `form:"taskName"`
  148. TaskDesc string `form:"taskDesc"`
  149. ModelName string `form:"modelName"`
  150. ModelType string `form:"modelType"`
  151. AdapterClusterMap map[string]string `form:"adapterClusterMap"`
  152. }
  153. CreateDeployTaskResp {
  154. }
  155. GetAdaptersByModelReq {
  156. ModelName string `form:"modelName"`
  157. ModelType string `form:"modelType"`
  158. }
  159. GetAdaptersByModelResp {
  160. Adapters []AdapterAvail `json:"adapters"`
  161. }
  162. AdapterAvail {
  163. AdapterId string `json:"adapterId"`
  164. AdapterName string `json:"taskName"`
  165. Clusters []ClusterAvail `json:"clusters"`
  166. }
  167. ClusterAvail {
  168. ClusterId string `json:"clusterId"`
  169. ClusterName string `json:"clusterName"`
  170. }
  171. )

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.