dsh-model-arena 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/arena-view.d.ts +4 -2
- package/lib/arena-view.js +4 -12
- package/lib/arena.d.ts +11 -21
- package/lib/arena.js +66 -10
- package/lib/arena.web.js +261 -35
- package/lib/arena.web.js.map +3 -3
- package/lib/client/index.d.ts +21 -10
- package/lib/client/index.js +13 -54
- package/lib/client/locales.d.ts +42 -0
- package/lib/client/locales.js +69 -0
- package/lib/client/view.d.ts +23 -1
- package/lib/client/view.js +116 -8
- package/lib/index.d.ts +3 -0
- package/lib/index.js +3 -0
- package/lib/routes.d.ts +2 -2
- package/lib/routes.js +51 -7
- package/lib/scoring.d.ts +6 -1
- package/lib/scoring.js +98 -0
- package/lib/store.d.ts +1 -0
- package/lib/store.js +8 -1
- package/lib/types.d.ts +50 -6
- package/package.json +4 -3
package/lib/store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeFileSync, readFileSync, existsSync, mkdirSync, readdirSync } from 'node:fs';
|
|
1
|
+
import { writeFileSync, readFileSync, existsSync, mkdirSync, readdirSync, unlinkSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { createHash } from 'node:crypto';
|
|
4
4
|
export class ArenaStore {
|
|
@@ -40,6 +40,13 @@ export class ArenaStore {
|
|
|
40
40
|
return null;
|
|
41
41
|
return JSON.parse(readFileSync(path, 'utf8'));
|
|
42
42
|
}
|
|
43
|
+
deleteRun(id) {
|
|
44
|
+
const path = join(this.arenaDir, `${id}.json`);
|
|
45
|
+
if (!existsSync(path))
|
|
46
|
+
return false;
|
|
47
|
+
unlinkSync(path);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
43
50
|
static generateId(prompt, models) {
|
|
44
51
|
const hash = createHash('sha256');
|
|
45
52
|
hash.update(prompt);
|
package/lib/types.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface ModelResult {
|
|
|
5
5
|
completionTokens: number;
|
|
6
6
|
latencyMs: number;
|
|
7
7
|
error?: string;
|
|
8
|
+
rating?: number;
|
|
8
9
|
}
|
|
9
10
|
export interface Score {
|
|
10
11
|
userRating?: number;
|
|
@@ -18,6 +19,7 @@ export interface ArenaRun {
|
|
|
18
19
|
timestamp: number;
|
|
19
20
|
results: ModelResult[];
|
|
20
21
|
scores: Record<string, Score>;
|
|
22
|
+
reference?: string | undefined;
|
|
21
23
|
}
|
|
22
24
|
export interface Suite {
|
|
23
25
|
name: string;
|
|
@@ -36,11 +38,53 @@ export interface RegressionReport {
|
|
|
36
38
|
currentOutput: string;
|
|
37
39
|
}[];
|
|
38
40
|
}
|
|
39
|
-
export interface
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
export interface LeaderboardEntry {
|
|
42
|
+
model: string;
|
|
43
|
+
elo: number;
|
|
44
|
+
wins: number;
|
|
45
|
+
losses: number;
|
|
46
|
+
draws: number;
|
|
47
|
+
games: number;
|
|
48
|
+
totalRuns: number;
|
|
49
|
+
avgRating: number;
|
|
50
|
+
avgLatencyMs: number;
|
|
51
|
+
avgTokens: number;
|
|
52
|
+
}
|
|
53
|
+
export interface RunSummary {
|
|
54
|
+
id: string;
|
|
55
|
+
prompt: string;
|
|
56
|
+
timestamp: number;
|
|
57
|
+
modelCount: number;
|
|
58
|
+
winner?: string | undefined;
|
|
59
|
+
}
|
|
60
|
+
export interface ComparePayload {
|
|
61
|
+
runId: string;
|
|
62
|
+
modelA: string;
|
|
63
|
+
modelB: string;
|
|
64
|
+
outputA: string;
|
|
65
|
+
outputB: string;
|
|
66
|
+
diff: {
|
|
67
|
+
type: 'same' | 'added' | 'removed';
|
|
68
|
+
text: string;
|
|
45
69
|
}[];
|
|
70
|
+
summary: {
|
|
71
|
+
added: number;
|
|
72
|
+
removed: number;
|
|
73
|
+
changed: number;
|
|
74
|
+
};
|
|
75
|
+
scoreA: Score;
|
|
76
|
+
scoreB: Score;
|
|
77
|
+
}
|
|
78
|
+
export interface ArenaStats {
|
|
79
|
+
totalRuns: number;
|
|
80
|
+
totalModels: number;
|
|
81
|
+
uniqueModels: number;
|
|
82
|
+
uniquePrompts: number;
|
|
83
|
+
totalRatings: number;
|
|
84
|
+
avgModelsPerRun: number;
|
|
85
|
+
}
|
|
86
|
+
export interface PanelPayload {
|
|
87
|
+
recentRuns: RunSummary[];
|
|
88
|
+
leaderboard: LeaderboardEntry[];
|
|
89
|
+
stats: ArenaStats;
|
|
46
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-model-arena",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Run the same prompt through every model you have, and see the difference without squinting.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
"client": {
|
|
42
42
|
"platform": "web",
|
|
43
43
|
"inject": [
|
|
44
|
-
"
|
|
45
|
-
"
|
|
44
|
+
"@deepseek-ai/dsh-client-ui-renderer",
|
|
45
|
+
"@deepseek-ai/dsh-client-locale",
|
|
46
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
46
47
|
]
|
|
47
48
|
}
|
|
48
49
|
},
|