|
| 1 | +package llm |
| 2 | + |
| 3 | +import ( |
| 4 | + "yunion.io/x/onecloud/pkg/apis" |
| 5 | +) |
| 6 | + |
| 7 | +type InstantModelListInput struct { |
| 8 | + apis.SharableVirtualResourceListInput |
| 9 | + apis.EnabledResourceBaseListInput |
| 10 | + |
| 11 | + ModelName string `json:"model_name"` |
| 12 | + Tag string `json:"tag"` |
| 13 | + ModelId string `json:"model_id"` |
| 14 | + Image string `json:"image"` |
| 15 | + |
| 16 | + Mounts string `json:"mounts"` |
| 17 | + |
| 18 | + AutoCache *bool `json:"auto_cache"` |
| 19 | +} |
| 20 | + |
| 21 | +type InstantModelCreateInput struct { |
| 22 | + apis.SharableVirtualResourceCreateInput |
| 23 | + apis.EnabledBaseResourceCreateInput |
| 24 | + |
| 25 | + LLMType LLMContainerType `json:"llm_type"` |
| 26 | + ModelName string `json:"model_name"` |
| 27 | + Tag string `json:"tag"` |
| 28 | + ImageId string `json:"image_id"` |
| 29 | + Size int64 `json:"size"` |
| 30 | + ModelId string `json:"model_id"` |
| 31 | + |
| 32 | + ActualSizeMb int32 `json:"actual_size_mb"` |
| 33 | + |
| 34 | + Mounts []string `json:"mounts"` |
| 35 | +} |
| 36 | + |
| 37 | +type InstantModelUpdateInput struct { |
| 38 | + apis.SharableVirtualResourceBaseUpdateInput |
| 39 | + |
| 40 | + ImageId string `json:"image_id"` |
| 41 | + Size int64 `json:"size"` |
| 42 | + |
| 43 | + ActualSizeMb int32 `json:"actual_size_mb"` |
| 44 | + |
| 45 | + Mounts []string `json:"mounts"` |
| 46 | +} |
| 47 | + |
| 48 | +type InstantModelDetails struct { |
| 49 | + apis.SharableVirtualResourceDetails |
| 50 | + |
| 51 | + Image string |
| 52 | + |
| 53 | + CacheCount int |
| 54 | + CachedCount int |
| 55 | + |
| 56 | + IconBase64 string `json:"icon_base64"` |
| 57 | +} |
| 58 | + |
| 59 | +type InstantModelImportInput struct { |
| 60 | + Endpoint string `json:"endpoint"` |
| 61 | + AccessKey string `json:"access_key"` |
| 62 | + SecretKey string `json:"secret_key"` |
| 63 | + Bucket string `json:"bucket"` |
| 64 | + Key string `json:"key"` |
| 65 | + SignVer string `json:"sign_ver"` |
| 66 | +} |
| 67 | + |
| 68 | +func (input InstantModelImportInput) Invalid() bool { |
| 69 | + if len(input.Endpoint) == 0 || len(input.AccessKey) == 0 || len(input.SecretKey) == 0 || len(input.Bucket) == 0 || len(input.Key) == 0 { |
| 70 | + return true |
| 71 | + } |
| 72 | + return false |
| 73 | +} |
| 74 | + |
| 75 | +type InstantModelSyncstatusInput struct { |
| 76 | +} |
| 77 | + |
| 78 | +type InstantAppCacheInput struct { |
| 79 | +} |
| 80 | + |
| 81 | +type InstantModelEnableAutoCacheInput struct { |
| 82 | + AutoCache bool `json:"auto_cache"` |
| 83 | +} |
| 84 | + |
| 85 | +type MountedModelResourceListInput struct { |
| 86 | + MountedModels []string `json:"mounted_models"` |
| 87 | +} |
| 88 | + |
| 89 | +type MountedModelResourceCreateInput struct { |
| 90 | + MountedModels []string `json:"mounted_models"` |
| 91 | +} |
| 92 | + |
| 93 | +type MountedModelResourceUpdateInput struct { |
| 94 | + MountedModels []string `json:"mounted_models"` |
| 95 | +} |
0 commit comments