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.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. ModelType string `form:"modelType"`
  72. InstanceId int64 `form:"instanceId"`
  73. }
  74. TextToTextInferenceResp{
  75. }
  76. /******************TextToImage inference*************************/
  77. TextToImageInferenceReq{
  78. TaskName string `form:"taskName"`
  79. TaskDesc string `form:"taskDesc"`
  80. ModelName string `form:"modelName"`
  81. ModelType string `form:"modelType"`
  82. AiClusterIds []string `form:"aiClusterIds"`
  83. }
  84. TextToImageInferenceResp{
  85. Result []byte `json:"result"`
  86. }
  87. /******************Deploy instance*************************/
  88. DeployInstanceListReq{
  89. PageInfo
  90. }
  91. DeployInstanceListResp {
  92. PageResult
  93. }
  94. StartDeployInstanceReq {
  95. AdapterId string `form:"adapterId"`
  96. ClusterId string `form:"clusterId"`
  97. Id string `form:"id"`
  98. InstanceId string `form:"instanceId"`
  99. }
  100. StartDeployInstanceResp {
  101. }
  102. StopDeployInstanceReq {
  103. AdapterId string `form:"adapterId"`
  104. ClusterId string `form:"clusterId"`
  105. Id string `form:"id"`
  106. InstanceId string `form:"instanceId"`
  107. }
  108. StopDeployInstanceResp {
  109. }
  110. DeployInstanceStatReq {
  111. }
  112. DeployInstanceStatResp {
  113. Running int32 `json:"running"`
  114. Total int32 `json:"total"`
  115. }
  116. InferenceTaskStatReq {}
  117. InferenceTaskStatResp {
  118. Running int32 `json:"running"`
  119. Total int32 `json:"total"`
  120. }
  121. StartAllByDeployTaskIdReq {
  122. Id string `json:"deployTaskId"`
  123. }
  124. StartAllByDeployTaskIdResp {
  125. }
  126. StopAllByDeployTaskIdReq {
  127. Id string `json:"deployTaskId"`
  128. }
  129. StopAllByDeployTaskIdResp {
  130. }
  131. GetRunningInstanceReq {
  132. Id string `form:"deployTaskId"`
  133. AdapterId string `form:"adapterId"`
  134. }
  135. GetRunningInstanceResp {
  136. List interface{} `json:"list"`
  137. }
  138. GetDeployTasksByTypeReq {
  139. ModelType string `form:"modelType"`
  140. }
  141. GetDeployTasksByTypeResp {
  142. List interface{} `json:"list"`
  143. }
  144. CreateDeployTaskReq {
  145. TaskName string `form:"taskName"`
  146. TaskDesc string `form:"taskDesc"`
  147. ModelName string `form:"modelName"`
  148. ModelType string `form:"modelType"`
  149. AdapterClusterMap map[string][]string `form:"adapterClusterMap"`
  150. }
  151. CreateDeployTaskResp {
  152. }
  153. GetAdaptersByModelReq {
  154. ModelName string `form:"modelName"`
  155. ModelType string `form:"modelType"`
  156. }
  157. GetAdaptersByModelResp {
  158. Adapters []*AdapterAvail `json:"adapters"`
  159. }
  160. AdapterAvail {
  161. AdapterId string `json:"adapterId"`
  162. AdapterName string `json:"adapterName"`
  163. Clusters []*ClusterAvail `json:"clusters"`
  164. }
  165. ClusterAvail {
  166. ClusterId string `json:"clusterId"`
  167. ClusterName string `json:"clusterName"`
  168. }
  169. )

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.