Documentation
¶
Index ¶
- Constants
- Variables
- func CopyModel(src, dst model.Name) error
- func GetModelInfo(req api.ShowRequest) (*api.ShowResponse, error)
- func GetSHA256Digest(r io.Reader) (string, int64)
- func NormalizeMediaType(mediaType string) string
- func PruneLayers() error
- func PullModel(ctx context.Context, name string, regOpts *registryOptions, ...) error
- func Serve(ln net.Listener) error
- type ByDurationAndName
- type LlmRequest
- type Model
- type ModelCapabilities
- type Scheduler
- type Server
- func (s *Server) ChatHandler(c *gin.Context)
- func (s *Server) CopyHandler(c *gin.Context)
- func (s *Server) CreateBlobHandler(c *gin.Context)
- func (s *Server) CreateHandler(c *gin.Context)
- func (s *Server) DeleteHandler(c *gin.Context)
- func (s *Server) GenerateRoutes() (http.Handler, error)
- func (s *Server) HeadBlobHandler(c *gin.Context)
- func (s *Server) ListHandler(c *gin.Context)
- func (s *Server) LoadedModelsHandler(c *gin.Context)
- func (s *Server) PullHandler(c *gin.Context)
- func (s *Server) ShowHandler(c *gin.Context)
- func (s *Server) StopAllModelsHandler(c *gin.Context)
- func (s *Server) StopModelHandler(c *gin.Context)
- type StopRequest
Constants ¶
View Source
const ( MediaTypeYollamaModel = "application/vnd.yollama.image.model" MediaTypeYollamaProjector = "application/vnd.yollama.image.projector" MediaTypeYollamaTemplate = "application/vnd.yollama.image.template" MediaTypeYollamaSystem = "application/vnd.yollama.image.system" MediaTypeYollamaAdapter = "application/vnd.yollama.image.adapter" )
Clean Yollama OCI Media Types
Variables ¶
View Source
var ErrMaxQueue = errors.New("[YOLLAMA] | Error: Maximum pending requests exceeded!")
Functions ¶
func GetModelInfo ¶
func GetModelInfo(req api.ShowRequest) (*api.ShowResponse, error)
func GetSHA256Digest ¶
GetSHA256Digest returns the SHA256 hash of a given buffer and returns it, and the size of buffer
func NormalizeMediaType ¶
NormalizeMediaType intercepts legacy media types and translates them into the Yollama schema in-memory
func PruneLayers ¶
func PruneLayers() error
Types ¶
type ByDurationAndName ¶
type ByDurationAndName []*runnerRef
func (ByDurationAndName) Len ¶
func (a ByDurationAndName) Len() int
func (ByDurationAndName) Less ¶
func (a ByDurationAndName) Less(i, j int) bool
func (ByDurationAndName) Swap ¶
func (a ByDurationAndName) Swap(i, j int)
type LlmRequest ¶
type LlmRequest struct {
// contains filtered or unexported fields
}
type Model ¶
type Model struct {
Name string `json:"name"`
Config model.ConfigV2
ShortName string
ModelPath string
ParentModel string
HasChatTemplate bool
ProjectorPaths []string
System string
License []string
Digest string
Options map[string]any
Messages []api.Message
Template *template.Template
// contains filtered or unexported fields
}
func CheckForModel ¶
func (*Model) Capabilities ¶
func (m *Model) Capabilities() []model.Capability
Capabilities returns the capabilities that the model supports
func (*Model) CheckCapabilities ¶
func (m *Model) CheckCapabilities(want ...model.Capability) error
CheckCapabilities checks if the model has the specified capabilities returning an error describing any missing or unknown capabilities
type ModelCapabilities ¶
type ModelCapabilities struct {
HasModel bool
HasProjector bool // For vision models
HasTemplate bool
}
ModelCapabilities tracks what features the underlying GGUF layers support
func EvaluateCapabilities ¶
func EvaluateCapabilities(layers []struct{ MediaType string }) ModelCapabilities
EvaluateCapabilities scans a manifest's layers and determines model features using normalized types
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func InitScheduler ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ChatHandler ¶
func (*Server) CopyHandler ¶
func (*Server) CreateBlobHandler ¶
func (*Server) CreateHandler ¶
func (*Server) DeleteHandler ¶
func (*Server) HeadBlobHandler ¶
func (*Server) ListHandler ¶
func (*Server) LoadedModelsHandler ¶
func (*Server) PullHandler ¶
func (*Server) ShowHandler ¶
func (*Server) StopAllModelsHandler ¶
Flush all active runners out of VRAM
func (*Server) StopModelHandler ¶
type StopRequest ¶
type StopRequest struct {
Model string `json:"model"`
}
Source Files
¶
- auth.go
- capabilities.go
- cloud_proxy.go
- create.go
- download.go
- fixblobs.go
- images.go
- inference_request_log.go
- logprob.go
- model.go
- model_caches.go
- model_inference_cache.go
- model_list_cache.go
- model_recommendations.go
- model_resolver.go
- model_show_cache.go
- model_stop.go
- prompt.go
- quantization.go
- renderer_resolution.go
- routes.go
- sched.go
- sparse_common.go
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
cache/blob
Package blob implements a content-addressable disk cache for blobs and manifests.
|
Package blob implements a content-addressable disk cache for blobs and manifests. |
|
internal/stringsx
Package stringsx provides additional string manipulation functions that aren't in the standard library's strings package or go4.org/mem.
|
Package stringsx provides additional string manipulation functions that aren't in the standard library's strings package or go4.org/mem. |
|
internal/syncs
Package syncs provides synchronization primitives.
|
Package syncs provides synchronization primitives. |
|
manifest
Package manifest provides documentation for the Yollama manifest format.
|
Package manifest provides documentation for the Yollama manifest format. |
Click to show internal directories.
Click to hide internal directories.