Documentation
¶
Index ¶
- func UnmarshalModelFormats(b []byte) ([]v1.ModelFormat, error)
- type BaseModel
- type Model
- type ModelSpec
- type S
- func (s *S) AutoMigrate() error
- func (s *S) CreateBaseModel(modelID string, path string, formats []v1.ModelFormat, ggufModelPath string, ...) (*BaseModel, error)
- func (s *S) CreateModel(spec ModelSpec) (*Model, error)
- func (s *S) CreateStorageConfig(tenantID, pathPrefix string) (*StorageConfig, error)
- func (s *S) DeleteModel(modelID, projectID string) error
- func (s *S) GetBaseModel(modelID, tenantID string) (*BaseModel, error)
- func (s *S) GetModelByModelID(modelID string) (*Model, error)
- func (s *S) GetPublishedModelByModelIDAndProjectID(modelID, projectID string) (*Model, error)
- func (s *S) GetPublishedModelByModelIDAndTenantID(modelID, tenantID string) (*Model, error)
- func (s *S) GetStorageConfig(tenantID string) (*StorageConfig, error)
- func (s *S) ListBaseModels(tenantID string) ([]*BaseModel, error)
- func (s *S) ListModelsByProjectID(projectID string, onlyPublished bool) ([]*Model, error)
- func (s *S) UpdateModel(modelID string, tenantID string, isPublished bool) error
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalModelFormats ¶ added in v0.95.0
func UnmarshalModelFormats(b []byte) ([]v1.ModelFormat, error)
UnmarshalModelFormats unmarshals model formats.
Types ¶
type BaseModel ¶
type BaseModel struct {
gorm.Model
TenantID string `gorm:"uniqueIndex:idx_base_model_model_id_tenant_id"`
ModelID string `gorm:"uniqueIndex:idx_base_model_model_id_tenant_id"`
Path string
Formats []byte
// GGUFModelPath is the path to the GGUF model.
GGUFModelPath string
}
BaseModel represents a base model.
type Model ¶
type Model struct {
gorm.Model
// ModelID is the model ID. It is globally unique.
ModelID string `gorm:"uniqueIndex"`
TenantID string `gorm:"index"`
OrganizationID string
ProjectID string `gorm:"index"`
Path string
IsPublished bool
BaseModelID string `gorm:"index"`
Adapter string
Quantization string
}
Model represents a model.
type ModelSpec ¶
type ModelSpec struct {
ModelID string
TenantID string
OrganizationID string
ProjectID string
Path string
IsPublished bool
BaseModelID string
Adapter string
Quantization string
}
ModelSpec represents a model spec that is passed to CreateModel.
type S ¶
type S struct {
// contains filtered or unexported fields
}
S represents the data store.
func (*S) AutoMigrate ¶
AutoMigrate sets up the auto-migration task of the database.
func (*S) CreateBaseModel ¶
func (s *S) CreateBaseModel( modelID string, path string, formats []v1.ModelFormat, ggufModelPath string, tenantID string, ) (*BaseModel, error)
CreateBaseModel creates a model.
func (*S) CreateModel ¶
CreateModel creates a model.
func (*S) CreateStorageConfig ¶ added in v0.71.0
func (s *S) CreateStorageConfig(tenantID, pathPrefix string) (*StorageConfig, error)
CreateStorageConfig creates a storage configuration.
func (*S) DeleteModel ¶
DeleteModel deletes a model by model ID and tenant ID.
func (*S) GetBaseModel ¶
GetBaseModel returns a base model by model ID and tenant ID.
func (*S) GetModelByModelID ¶ added in v0.36.0
GetModelByModelID returns a model by model ID.
func (*S) GetPublishedModelByModelIDAndProjectID ¶ added in v0.53.0
GetPublishedModelByModelIDAndProjectID returns a published model by model ID and tenant ID.
func (*S) GetPublishedModelByModelIDAndTenantID ¶ added in v0.63.0
GetPublishedModelByModelIDAndTenantID returns a model by model ID.
func (*S) GetStorageConfig ¶ added in v0.71.0
func (s *S) GetStorageConfig(tenantID string) (*StorageConfig, error)
GetStorageConfig returns a storage configuration by tenant ID.
func (*S) ListBaseModels ¶
ListBaseModels returns all base models for a tenant.
func (*S) ListModelsByProjectID ¶ added in v0.53.0
ListModelsByProjectID finds models.