-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
335 lines (300 loc) Β· 11.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html>
<html lang="en">
<head>
<title>Awesome SLMs</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<script src="js/htmx.min.js"></script>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
padding: 2rem;
max-width: 1200px;
margin: 0 auto;
background-color: #f5f5f5;
}
.container {
background-color: white;
border-radius: 8px;
padding: 2rem;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
h1 {
color: #2d3748;
margin-bottom: 1rem;
}
.description {
color: #4a5568;
margin-bottom: 2rem;
}
.filters {
display: flex;
gap: 1rem;
margin-bottom: 1rem;
flex-wrap: wrap;
}
.filters select, .filters input {
padding: 0.5rem;
border: 1px solid #e2e8f0;
border-radius: 4px;
background-color: white;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 1rem;
}
th, td {
padding: 0.75rem;
text-align: left;
border-bottom: 1px solid #e2e8f0;
}
th {
background-color: #f8fafc;
cursor: pointer;
}
th:hover {
background-color: #edf2f7;
}
.model-link {
color: #3182ce;
text-decoration: none;
}
.model-link:hover {
text-decoration: underline;
}
.check {
color: #48bb78;
}
.cross {
color: #f56565;
}
.stats {
background-color: #f8fafc;
padding: 1rem;
border-radius: 4px;
margin-bottom: 1rem;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
}
.stat-item {
padding: 0.5rem;
}
.header-image {
width: 100%;
max-width: 400px;
height: auto;
margin: 1rem 0 2rem 0;
border-radius: 8px;
display: block;
margin-left: auto;
margin-right: auto;
}
.header-section {
text-align: center;
margin-bottom: 2rem;
}
.nav-links {
margin: 1rem 0;
padding: 1rem;
background-color: #f8fafc;
border-radius: 8px;
}
.nav-links a {
color: #3182ce;
text-decoration: none;
font-weight: 500;
}
.nav-links a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<div class="header-section">
<h1>Awesome SLMs</h1>
<img src="female-borg.jpg" alt="AI Robot" class="header-image">
</div>
<p class="description">This is the list of the SLMs I use on my Raspberry Pi5 (8GB RAM) with Ollama</p>
<div class="nav-links">
π <a href="benchmarks.html">View Model Benchmarks</a><br>
π <a href="https://github.com/parakeet-nest/awesome-slms">Awesome SLMs on GitHub</a>
</div>
<div id="loadingState" class="loading">
Loading data...
</div>
<div id="errorState" class="error" style="display: none">
Error loading data. Please check if models.json is in the correct location.
</div>
<div id="mainContent" style="display: none">
<div class="stats">
<div class="stats-grid">
<div class="stat-item">
<strong>Total Models:</strong> <span id="totalModels">0</span>
</div>
<div class="stat-item">
<strong>Good on Pi5:</strong> <span id="goodOnPi5">0</span>
</div>
<div class="stat-item">
<strong>Usable on Pi5:</strong> <span id="usableOnPi5">0</span>
</div>
</div>
</div>
<div class="filters">
<input
id="searchInput"
type="text"
placeholder="Search models..."
hx-trigger="keyup changed delay:300ms"
hx-target="#modelsTable"
oninput="handleSearch(this.value)"
>
<select id="kindFilter" onchange="handleKindFilter(this.value)">
<option value="">All kinds</option>
<option value="chat">Chat</option>
<option value="code">Code</option>
<option value="embedding">Embedding</option>
<option value="tools">Tools</option>
<option value="math">Math</option>
<option value="conversion">Conversion</option>
<option value="safety">Safety</option>
</select>
<select id="pi5Filter" onchange="handlePi5Filter(this.value)">
<option value="">All Pi5 compatibility</option>
<option value="good">Good on Pi5</option>
<option value="usable">Usable on Pi5</option>
</select>
</div>
<table id="modelsTable">
<thead>
<tr>
<th onclick="sortTable(0)">Name</th>
<th onclick="sortTable(1)">Size</th>
<th onclick="sortTable(2)">Tag</th>
<th onclick="sortTable(3)">Remark</th>
<th onclick="sortTable(4)">Kind</th>
<th>URL</th>
<th onclick="sortTable(6)">Good on Pi5</th>
<th onclick="sortTable(7)">Usable on Pi5</th>
</tr>
</thead>
<tbody id="tableBody">
</tbody>
</table>
</div>
</div>
<script>
let smlData = { models: [] };
let currentSearchTerm = '';
let currentKindFilter = '';
let currentPi5Filter = '';
// Function to update statistics with filtered data
function updateStats(filteredModels) {
document.getElementById('totalModels').textContent = filteredModels.length;
document.getElementById('goodOnPi5').textContent = filteredModels.filter(m => m.good_on_pi5).length;
document.getElementById('usableOnPi5').textContent = filteredModels.filter(m => m.usable_on_pi5).length;
}
function updateUIState(loading, error) {
document.getElementById('loadingState').style.display = loading ? 'block' : 'none';
document.getElementById('errorState').style.display = error ? 'block' : 'none';
document.getElementById('mainContent').style.display = (!loading && !error) ? 'block' : 'none';
}
async function loadData() {
try {
updateUIState(true, false);
const response = await fetch('models.json');
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
smlData = await response.json();
applyFilters();
updateUIState(false, false);
} catch (error) {
console.error('Error loading data:', error);
updateUIState(false, true);
}
}
function renderTable(models) {
const tbody = document.getElementById('tableBody');
tbody.innerHTML = models.map(model => `
<tr>
<td>${model.name}</td>
<td>${model.size}</td>
<td>${model.tag}</td>
<td>${model.remark}</td>
<td>${model.kind}</td>
<td><a href="${model.url}" class="model-link" target="_blank">Link</a></td>
<td>${model.good_on_pi5 ? '<span class="check">β</span>' : '<span class="cross">β</span>'}</td>
<td>${model.usable_on_pi5 ? '<span class="check">β</span>' : '<span class="cross">β</span>'}</td>
</tr>
`).join('');
// Update visual state of filters
document.getElementById('kindFilter').classList.toggle('active-filter', currentKindFilter !== '');
document.getElementById('pi5Filter').classList.toggle('active-filter', currentPi5Filter !== '');
}
function applyFilters() {
let filteredModels = smlData.models;
// Apply search filter
if (currentSearchTerm) {
filteredModels = filteredModels.filter(model =>
Object.values(model).some(value =>
String(value).toLowerCase().includes(currentSearchTerm.toLowerCase())
)
);
}
// Apply kind filter
if (currentKindFilter) {
filteredModels = filteredModels.filter(model =>
model.kind.toLowerCase().includes(currentKindFilter.toLowerCase())
);
}
// Apply Pi5 filter
if (currentPi5Filter === 'good') {
filteredModels = filteredModels.filter(model => model.good_on_pi5);
} else if (currentPi5Filter === 'usable') {
filteredModels = filteredModels.filter(model => model.usable_on_pi5);
}
renderTable(filteredModels);
updateStats(filteredModels);
}
function handleSearch(value) {
currentSearchTerm = value;
applyFilters();
}
function handleKindFilter(value) {
currentKindFilter = value;
document.getElementById('pi5Filter').value = '';
currentPi5Filter = '';
applyFilters();
}
function handlePi5Filter(value) {
currentPi5Filter = value;
document.getElementById('kindFilter').value = '';
currentKindFilter = '';
applyFilters();
}
function sortTable(column) {
const tbody = document.getElementById('tableBody');
const rows = Array.from(tbody.querySelectorAll('tr'));
rows.sort((a, b) => {
const aValue = a.cells[column].textContent;
const bValue = b.cells[column].textContent;
return aValue.localeCompare(bValue);
});
tbody.innerHTML = '';
rows.forEach(row => tbody.appendChild(row));
}
// Initialize table when document is ready
document.addEventListener('DOMContentLoaded', loadData);
</script>
</body>
</html>