Documentation
¶
Overview ¶
Package matrix provides dynamic capability matrix building for the intelligence system. It auto-assigns optimal models to capability slots based on discovered model capabilities.
Index ¶
- type Builder
- func (b *Builder) Build(models []*ModelWithCapability) *DynamicMatrix
- func (b *Builder) GetCurrentMatrix() *DynamicMatrix
- func (b *Builder) GetCurrentMatrixAsMap() map[string]interface{}
- func (b *Builder) SetCostOptimization(costOptimization bool)
- func (b *Builder) SetOverrides(overrides map[string]string)
- func (b *Builder) SetPreferLocal(preferLocal bool)
- type CapabilitySlot
- type DynamicMatrix
- type MatrixAssignment
- type ModelWithCapability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds dynamic capability matrices from discovered models.
func NewBuilder ¶
NewBuilder creates a new DynamicMatrixBuilder instance.
Parameters:
- preferLocal: Whether to prefer local models for the secure slot
- costOptimization: Whether to optimize for cost
- overrides: Manual overrides for specific slots
Returns:
- *Builder: A new matrix builder instance
func (*Builder) Build ¶
func (b *Builder) Build(models []*ModelWithCapability) *DynamicMatrix
Build generates a dynamic matrix from the provided models with capabilities. It scores and ranks models for each capability slot and assigns primary models with fallback chains.
Parameters:
- models: List of models with their analyzed capabilities
Returns:
- *DynamicMatrix: The generated capability matrix
func (*Builder) GetCurrentMatrix ¶
func (b *Builder) GetCurrentMatrix() *DynamicMatrix
GetCurrentMatrix returns the most recently built matrix. Returns nil if no matrix has been built yet.
Returns:
- *DynamicMatrix: The current matrix, or nil
func (*Builder) GetCurrentMatrixAsMap ¶
GetCurrentMatrixAsMap returns the current matrix as a map for Lua interop.
Returns:
- map[string]interface{}: The matrix as a map, or nil
func (*Builder) SetCostOptimization ¶
SetCostOptimization updates the cost optimization setting.
Parameters:
- costOptimization: Whether to optimize for cost
func (*Builder) SetOverrides ¶
SetOverrides updates the manual overrides.
Parameters:
- overrides: New override mappings
func (*Builder) SetPreferLocal ¶
SetPreferLocal updates the prefer local setting.
Parameters:
- preferLocal: Whether to prefer local models
type CapabilitySlot ¶
type CapabilitySlot string
CapabilitySlot represents a capability slot in the routing matrix.
const ( SlotCoding CapabilitySlot = "coding" SlotReasoning CapabilitySlot = "reasoning" SlotCreative CapabilitySlot = "creative" SlotFast CapabilitySlot = "fast" SlotSecure CapabilitySlot = "secure" SlotVision CapabilitySlot = "vision" )
type DynamicMatrix ¶
type DynamicMatrix struct {
Assignments map[CapabilitySlot]*MatrixAssignment `json:"assignments"`
GeneratedAt time.Time `json:"generated_at"`
}
DynamicMatrix represents the complete capability-to-model mapping.
type MatrixAssignment ¶
type MatrixAssignment struct {
Primary string `json:"primary"`
Fallbacks []string `json:"fallbacks"`
Score float64 `json:"score"`
Reason string `json:"reason"`
}
MatrixAssignment represents a model assignment for a capability slot.
type ModelWithCapability ¶
type ModelWithCapability struct {
ID string
Provider string
DisplayName string
Capabilities *capability.ModelCapability
}
ModelWithCapability combines a model ID with its analyzed capabilities.