rightsizing

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultModels = []ModelCapability{
	{Name: "gpt-4o-mini", MaxComplexity: ComplexityIntermediate, CostPer1KInput: 0.00015, CostPer1KOutput: 0.0006},
	{Name: "claude-3-haiku", MaxComplexity: ComplexityIntermediate, CostPer1KInput: 0.00025, CostPer1KOutput: 0.00125},
	{Name: "gpt-4o", MaxComplexity: ComplexityExpert, CostPer1KInput: 0.0025, CostPer1KOutput: 0.01},
	{Name: "claude-3-5-sonnet", MaxComplexity: ComplexitySpecialist, CostPer1KInput: 0.003, CostPer1KOutput: 0.015},
	{Name: "claude-3-opus", MaxComplexity: ComplexityFrontier, CostPer1KInput: 0.015, CostPer1KOutput: 0.075},
	{Name: "gemini-1.5-flash", MaxComplexity: ComplexityModerate, CostPer1KInput: 0.000075, CostPer1KOutput: 0.0003},
	{Name: "gemini-1.5-pro", MaxComplexity: ComplexityExpert, CostPer1KInput: 0.00125, CostPer1KOutput: 0.005},
}

Functions

This section is empty.

Types

type ComplexityFactors

type ComplexityFactors struct {
	CodeDepth         float64
	DomainSpecificity float64
	ReasoningDepth    float64
	ContextSize       float64
	ToolUsage         float64
	Ambiguity         float64
}

type ComplexityLevel

type ComplexityLevel int
const (
	ComplexityTrivial      ComplexityLevel = 0
	ComplexitySimple       ComplexityLevel = 1
	ComplexityModerate     ComplexityLevel = 2
	ComplexityIntermediate ComplexityLevel = 3
	ComplexityComplex      ComplexityLevel = 4
	ComplexityAdvanced     ComplexityLevel = 5
	ComplexityExpert       ComplexityLevel = 6
	ComplexitySpecialist   ComplexityLevel = 7
	ComplexityResearch     ComplexityLevel = 8
	ComplexityFrontier     ComplexityLevel = 9
)

type ComplexityScorer

type ComplexityScorer struct{}

func NewComplexityScorer

func NewComplexityScorer() *ComplexityScorer

func (*ComplexityScorer) Score

func (*ComplexityScorer) ScoreFromText

func (s *ComplexityScorer) ScoreFromText(text string) ComplexityLevel

type ModelCapability

type ModelCapability struct {
	Name            string
	MaxComplexity   ComplexityLevel
	CostPer1KInput  float64
	CostPer1KOutput float64
	Strengths       []string
}

type ModelRecommendationEngine

type ModelRecommendationEngine struct {
	// contains filtered or unexported fields
}

func NewModelRecommendationEngine

func NewModelRecommendationEngine() *ModelRecommendationEngine

func (*ModelRecommendationEngine) GetAllModels

func (e *ModelRecommendationEngine) GetAllModels() []ModelCapability

func (*ModelRecommendationEngine) Recommend

func (e *ModelRecommendationEngine) Recommend(complexity ComplexityLevel, currentModel string) *Recommendation

type Recommendation

type Recommendation struct {
	CurrentModel     string
	RecommendedModel string
	ComplexityScore  ComplexityLevel
	EstimatedSavings float64
	Confidence       float64
	Reasoning        string
}

type RightSizingRecord

type RightSizingRecord struct {
	ID               int64     `json:"id"`
	Command          string    `json:"command"`
	CurrentModel     string    `json:"current_model"`
	RecommendedModel string    `json:"recommended_model"`
	ComplexityScore  int       `json:"complexity_score"`
	EstimatedSavings float64   `json:"estimated_savings"`
	Accepted         bool      `json:"accepted"`
	CreatedAt        time.Time `json:"created_at"`
}

type RightSizingStore

type RightSizingStore struct {
	// contains filtered or unexported fields
}

func NewRightSizingStore

func NewRightSizingStore(db *sql.DB) *RightSizingStore

func (*RightSizingStore) AcceptRecommendation

func (s *RightSizingStore) AcceptRecommendation(id int64) error

func (*RightSizingStore) GetAccuracy

func (s *RightSizingStore) GetAccuracy() (float64, error)

func (*RightSizingStore) GetRecent

func (s *RightSizingStore) GetRecent(limit int) ([]RightSizingRecord, error)

func (*RightSizingStore) Init

func (s *RightSizingStore) Init() error

func (*RightSizingStore) Record

func (s *RightSizingStore) Record(rec *RightSizingRecord) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL