Documentation
¶
Index ¶
- Constants
- func BuildCatalog(runtimeCfg *factoryconfig.LoadedFactoryConfig) map[string]CatalogEntry
- func CanonicalBackendName(value string) string
- func CanonicalModelName(model string) string
- func GetModel(runtimeCfg *factoryconfig.LoadedFactoryConfig, modelName string) (factoryapi.ModelDetail, error)
- func ListModels(runtimeCfg *factoryconfig.LoadedFactoryConfig) (factoryapi.ListModelsResponse, error)
- func PullModel(puller AssetPuller, ctx context.Context, ...) (apisurface.ModelPullResult, error)
- func ResourceSummary(resource interfaces.ResourceConfig) factoryapi.ModelResourceSummary
- func RuntimeResource(factoryCfg *interfaces.FactoryConfig, workerDef *interfaces.WorkerConfig) (interfaces.ResourceConfig, string, bool)
- func SelectInvocationWorker(runtimeCfg *factoryconfig.LoadedFactoryConfig, modelName, operationName string) (*interfaces.WorkerConfig, interfaces.ModelOperation, error)
- type AssetPuller
- type CacheLayout
- type CatalogEntry
- type Handle
- type Hooks
- type InvocationRequest
- type LoadRequest
- type Manager
- type OmniVoiceInvocationPayload
- type ResourceLimiter
- type ResourceLimiterEntry
- type Runtime
Constants ¶
const ( DefaultOmniVoiceCommand = "omnivoice-llamacpp" OmniVoiceAudioContentType = "audio/wav" )
Variables ¶
This section is empty.
Functions ¶
func BuildCatalog ¶
func BuildCatalog(runtimeCfg *factoryconfig.LoadedFactoryConfig) map[string]CatalogEntry
BuildCatalog projects configured model workers into API catalog entries.
func CanonicalBackendName ¶
func CanonicalModelName ¶
CanonicalModelName normalizes model identifiers for catalog lookup.
func GetModel ¶
func GetModel(runtimeCfg *factoryconfig.LoadedFactoryConfig, modelName string) (factoryapi.ModelDetail, error)
GetModel returns model detail for a catalog model name.
func ListModels ¶
func ListModels(runtimeCfg *factoryconfig.LoadedFactoryConfig) (factoryapi.ListModelsResponse, error)
ListModels builds the list-models API response from runtime config.
func PullModel ¶
func PullModel( puller AssetPuller, ctx context.Context, runtimeCfg *factoryconfig.LoadedFactoryConfig, modelName string, ) (apisurface.ModelPullResult, error)
PullModel validates catalog locality and delegates asset pull to the injected puller.
func ResourceSummary ¶
func ResourceSummary(resource interfaces.ResourceConfig) factoryapi.ModelResourceSummary
ResourceSummary maps a factory resource config to the API model-resource summary shape.
func RuntimeResource ¶
func RuntimeResource(factoryCfg *interfaces.FactoryConfig, workerDef *interfaces.WorkerConfig) (interfaces.ResourceConfig, string, bool)
func SelectInvocationWorker ¶
func SelectInvocationWorker( runtimeCfg *factoryconfig.LoadedFactoryConfig, modelName, operationName string, ) (*interfaces.WorkerConfig, interfaces.ModelOperation, error)
SelectInvocationWorker resolves the model worker and operation for direct invocation.
Types ¶
type AssetPuller ¶
type AssetPuller interface {
PullModel(ctx context.Context, runtimeCfg *factoryconfig.LoadedFactoryConfig, modelName string) (apisurface.ModelPullResult, error)
EnsureModelAvailable(ctx context.Context, runtimeCfg *factoryconfig.LoadedFactoryConfig, worker *interfaces.WorkerConfig) error
ResolveModelCache(ctx context.Context, runtimeCfg *factoryconfig.LoadedFactoryConfig, worker *interfaces.WorkerConfig) (CacheLayout, error)
}
AssetPuller resolves managed local model assets and pull outcomes.
func NewAssetPuller ¶
func NewAssetPuller(cacheDir string) AssetPuller
NewAssetPuller constructs a managed local-model asset puller for the given cache directory.
type CacheLayout ¶
type CatalogEntry ¶
type CatalogEntry struct {
Summary factoryapi.ModelSummary
Detail factoryapi.ModelDetail
}
CatalogEntry holds API summary and detail for one discovered model.
type Handle ¶
type Handle interface {
Invoke(context.Context, InvocationRequest) (interfaces.InferenceResponse, error)
}
type InvocationRequest ¶
type InvocationRequest struct {
Resource interfaces.ResourceConfig
Worker *interfaces.WorkerConfig
Request interfaces.RunnerExecutionRequest
}
type LoadRequest ¶
type LoadRequest struct {
Resource interfaces.ResourceConfig
Worker *interfaces.WorkerConfig
ModelName string
CachePath string
Revision string
Files []string
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(assetPuller AssetPuller, runtime Runtime, hooks Hooks) *Manager
func (*Manager) WrapRunner ¶
func (m *Manager) WrapRunner( inner workers.Runner, runtimeCfg interfaces.RuntimeConfigLookup, factoryCfg *interfaces.FactoryConfig, workerDef *interfaces.WorkerConfig, ) workers.Runner
type OmniVoiceInvocationPayload ¶
type OmniVoiceInvocationPayload struct {
Operation string `json:"operation"`
ModelName string `json:"modelName"`
Revision string `json:"revision,omitempty"`
OutputFile string `json:"outputFile"`
Text string `json:"text"`
Bindings []interfaces.ResolvedModelOperationBinding `json:"bindings,omitempty"`
}
type ResourceLimiter ¶
type ResourceLimiter struct {
// contains filtered or unexported fields
}
func NewResourceLimiter ¶
func NewResourceLimiter(hooks Hooks) *ResourceLimiter
func (*ResourceLimiter) WrapRunner ¶
func (l *ResourceLimiter) WrapRunner( inner workers.Runner, factoryCfg *interfaces.FactoryConfig, workerDef *interfaces.WorkerConfig, ) workers.Runner
type ResourceLimiterEntry ¶
type ResourceLimiterEntry struct {
// contains filtered or unexported fields
}
type Runtime ¶
type Runtime interface {
Supports(resource interfaces.ResourceConfig, worker *interfaces.WorkerConfig) bool
Load(context.Context, LoadRequest) (Handle, error)
}
func NewOmniVoiceRuntime ¶
func NewOmniVoiceRuntime(runner workers.CommandRunner) Runtime