mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-23 17:44:24 +00:00
Remove model registry
This commit is contained in:
@@ -19,13 +19,11 @@ type InstanceManager interface {
|
||||
UpdateInstance(name string, options *instance.Options) (*instance.Instance, error)
|
||||
DeleteInstance(name string) error
|
||||
StartInstance(name string) (*instance.Instance, error)
|
||||
IsMaxRunningInstancesReached() bool
|
||||
AtMaxRunning() bool
|
||||
StopInstance(name string) (*instance.Instance, error)
|
||||
EvictLRUInstance() error
|
||||
RestartInstance(name string) (*instance.Instance, error)
|
||||
GetInstanceLogs(name string, numLines int) (string, error)
|
||||
ResolveInstance(modelName string) (string, error)
|
||||
RefreshModelRegistry(inst *instance.Instance) error
|
||||
Shutdown()
|
||||
}
|
||||
|
||||
@@ -36,7 +34,6 @@ type instanceManager struct {
|
||||
db database.InstanceStore
|
||||
remote *remoteManager
|
||||
lifecycle *lifecycleManager
|
||||
models *modelRegistry
|
||||
|
||||
// Configuration
|
||||
globalConfig *config.AppConfig
|
||||
@@ -63,16 +60,12 @@ func New(globalConfig *config.AppConfig, db database.InstanceStore) InstanceMana
|
||||
// Initialize remote manager
|
||||
remote := newRemoteManager(globalConfig.Nodes, 30*time.Second)
|
||||
|
||||
// Initialize model registry
|
||||
models := newModelRegistry()
|
||||
|
||||
// Create manager instance
|
||||
im := &instanceManager{
|
||||
registry: registry,
|
||||
ports: ports,
|
||||
db: db,
|
||||
remote: remote,
|
||||
models: models,
|
||||
globalConfig: globalConfig,
|
||||
}
|
||||
|
||||
@@ -149,27 +142,9 @@ func (im *instanceManager) loadInstances() error {
|
||||
// Auto-start instances that have auto-restart enabled
|
||||
go im.autoStartInstances()
|
||||
|
||||
// Discover models from all running llama.cpp instances
|
||||
go im.discoverAllModels()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// discoverAllModels discovers and registers models for all running llama.cpp instances
|
||||
func (im *instanceManager) discoverAllModels() {
|
||||
instances := im.registry.listRunning()
|
||||
|
||||
for _, inst := range instances {
|
||||
if !inst.IsLlamaCpp() {
|
||||
continue
|
||||
}
|
||||
|
||||
if err := im.RefreshModelRegistry(inst); err != nil {
|
||||
log.Printf("Failed to discover models for instance %s: %v", inst.Name, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// loadInstance loads a single persisted instance and adds it to the registry
|
||||
func (im *instanceManager) loadInstance(persistedInst *instance.Instance) error {
|
||||
name := persistedInst.Name
|
||||
|
||||
Reference in New Issue
Block a user