Documentation
¶
Index ¶
- Variables
- func CancelPipeline(model string, id string)
- func RemoveModel(model string) error
- func ResetLocalAddress(address string) error
- func StopPull(model string)
- type AsyncExecutor
- func (e *AsyncExecutor) CloseModelPipeline(model string)
- func (e *AsyncExecutor) ClosePipeline(model string, id string)
- func (e *AsyncExecutor) DistributeToModelPipelines(model string, msg PullMessage)
- func (e *AsyncExecutor) GetModelPipeline(model string) (*modelPipeline, bool)
- func (e *AsyncExecutor) SetModelPipeline(model string, mp *modelPipeline)
- func (e *AsyncExecutor) StartMessageDistributor()
- type Model
- type ModelConfig
- type ModelDetail
- type ModelDetails
- type Pipeline
- type PullCallback
- type PullMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocalConfig = "{\n \"temperature\": \"\",\n \"top_p\": \"\",\n \"max_tokens\": \"\"\n}" LocalSvg = `` /* 2446-byte string literal not displayed */ )
View Source
var (
ProviderLocal = "LocalModel"
)
Functions ¶
func CancelPipeline ¶
func RemoveModel ¶
func ResetLocalAddress ¶
Types ¶
type AsyncExecutor ¶
type AsyncExecutor struct {
// contains filtered or unexported fields
}
AsyncExecutor 结构体,管理不同模型的管道和任务队列
func NewAsyncExecutor ¶
func NewAsyncExecutor(queueSize int) *AsyncExecutor
NewAsyncExecutor 创建一个新的异步任务执行器
func (*AsyncExecutor) CloseModelPipeline ¶
func (e *AsyncExecutor) CloseModelPipeline(model string)
CloseModelPipeline 关闭当前模型所有管道
func (*AsyncExecutor) ClosePipeline ¶
func (e *AsyncExecutor) ClosePipeline(model string, id string)
ClosePipeline 关闭管道并移除
func (*AsyncExecutor) DistributeToModelPipelines ¶
func (e *AsyncExecutor) DistributeToModelPipelines(model string, msg PullMessage)
DistributeToModelPipelines 仅将消息分发给指定模型的管道
func (*AsyncExecutor) GetModelPipeline ¶
func (e *AsyncExecutor) GetModelPipeline(model string) (*modelPipeline, bool)
func (*AsyncExecutor) SetModelPipeline ¶
func (e *AsyncExecutor) SetModelPipeline(model string, mp *modelPipeline)
func (*AsyncExecutor) StartMessageDistributor ¶
func (e *AsyncExecutor) StartMessageDistributor()
StartMessageDistributor 启动消息分发器
type Model ¶
type Model struct {
Name string `json:"name"`
Model string `json:"model"`
ModifiedAt time.Time `json:"modified_at"`
Size int64 `json:"size"`
Digest string `json:"digest"`
Details ModelDetails `json:"details,omitempty"`
}
func ModelsInstalled ¶
type ModelConfig ¶
type ModelConfig struct {
Models []ModelDetail `json:"models"`
Version string `json:"version"`
}
type ModelDetail ¶
type ModelDetail struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Size string `json:"size"`
Digest string `json:"digest"`
Provider string `json:"provider"`
IsPopular bool `json:"is_popular"`
Latest bool `json:"latest"`
}
func ModelsCanInstall ¶
func ModelsCanInstall() ([]ModelDetail, string)
func ModelsCanInstallById ¶
func ModelsCanInstallById(id string) []ModelDetail
type ModelDetails ¶
type ModelDetails struct {
ParentModel string `json:"parent_model"`
Format string `json:"format"`
Family string `json:"family"`
Families []string `json:"families"`
ParameterSize string `json:"parameter_size"`
QuantizationLevel string `json:"quantization_level"`
}
ModelDetails provides details about a model.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline 结构体,表示每个用户的管道
func (*Pipeline) Message ¶
func (p *Pipeline) Message() <-chan PullMessage
type PullCallback ¶
type PullCallback func(msg PullMessage) error
Click to show internal directories.
Click to hide internal directories.