MCPcopy
hub / github.com/sammcj/gollama / ParamSizeStyle

Function ParamSizeStyle

styles/styles.go:107–152  ·  view source on GitHub ↗

Parameter size styles

(paramSize string)

Source from the content-addressed store, hash-verified

105
106// Parameter size styles
107func ParamSizeStyle(paramSize string) lipgloss.Style {
108 theme := GetTheme()
109
110 // If parameter size is empty, use default color
111 if paramSize == "" {
112 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.ItemId))
113 }
114
115 // Use the same color scheme as size ranges
116 // Extract the numeric part from parameter size strings like "7.6B", "32B", etc.
117 numStr := paramSize
118 if len(paramSize) > 0 && paramSize[len(paramSize)-1] == 'B' {
119 numStr = paramSize[:len(paramSize)-1]
120 }
121
122 // Parse the numeric part
123 size, err := strconv.ParseFloat(numStr, 64)
124 if err != nil {
125 // Default to first color if parsing fails
126 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.ItemId))
127 }
128
129 // Use more prominent colors for parameter sizes
130 // For very large models (>100B)
131 if size > 100 {
132 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.Error)).Bold(true)
133 }
134 // For large models (48-100B)
135 if size > 48 {
136 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.Error)).Bold(true)
137 }
138 // For medium models (24-48B)
139 if size > 24 {
140 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.Warning)).Bold(true)
141 }
142 // For medium-small models (14-24B)
143 if size > 14 {
144 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.Warning)).Bold(true)
145 }
146 // For small models (7-14B)
147 if size > 7 {
148 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.HeaderBorder)).Bold(true)
149 }
150 // For very small models (<7B)
151 return lipgloss.NewStyle().Foreground(theme.GetColour(theme.Colours.HeaderBorder))
152}
153
154// Quantization styles
155func QuantStyle(level string) lipgloss.Style {

Callers 1

RenderMethod · 0.92

Calls 2

GetThemeFunction · 0.85
GetColourMethod · 0.80

Tested by

no test coverage detected