evals 2.0.0 → 2.1.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/README.md +28 -1
- package/cli.js +176 -199
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -2,10 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
An npm package for Arize evals functionality.
|
|
4
4
|
|
|
5
|
+
## About Arize AI
|
|
6
|
+
|
|
7
|
+
Arize AI is a leading company in AI observability and evaluation, dedicated to ensuring that artificial intelligence systems operate reliably in real-world applications. Founded in 2019, Arize provides tools that help machine learning teams monitor, troubleshoot, and improve model performance across various domains, including structured data, computer vision, and large language models (LLMs).
|
|
8
|
+
|
|
9
|
+
## Arize Phoenix
|
|
10
|
+
|
|
11
|
+
**Arize Phoenix** is an open-source library designed for LLM tracing and evaluation. It enables developers to evaluate, experiment, and optimize AI products in real time. Key features include:
|
|
12
|
+
|
|
13
|
+
- **Application Tracing**: Collects LLM application data with automatic instrumentation, providing comprehensive visibility into model operations
|
|
14
|
+
- **Interactive Prompt Playground**: Offers a flexible environment for prompt and model iteration, allowing users to compare prompts, visualize outputs, and debug failures within their workflow
|
|
15
|
+
- **Streamlined Evaluations and Annotations**: Facilitates efficient assessment and documentation of model performance
|
|
16
|
+
|
|
17
|
+
Phoenix is built on OpenTelemetry, ensuring seamless setup, full transparency, and no vendor lock-in. It's perfect for teams who want to get started with LLM observability and evaluation in a fully local, open-source environment.
|
|
18
|
+
|
|
19
|
+
## Arize AX
|
|
20
|
+
|
|
21
|
+
**Arize AX** is the enterprise AI engineering platform that extends the capabilities of Phoenix, offering a comprehensive suite for development, evaluation, and observability. Key features include:
|
|
22
|
+
|
|
23
|
+
- **Prompts**: Tools for prompt engineering, including a prompt playground, prompt hub for management and versioning, and a prompt builder powered by AI
|
|
24
|
+
- **Experiments**: Systematic A/B testing of prompts against large datasets to optimize model performance
|
|
25
|
+
- **Tracing**: Detailed tracing capabilities to monitor and debug AI applications effectively
|
|
26
|
+
- **Evaluation**: Comprehensive evaluation metrics and tools to assess model outputs and performance
|
|
27
|
+
- **Alyx**: An AI engineering agent embedded within the platform to assist with various tasks
|
|
28
|
+
|
|
29
|
+
Arize AX is designed to support teams and organizations with larger data needs, providing robust support, collaboration features, and multiple deployment options including SaaS, Virtual Private Cloud (VPC), and Arize Private Connect.
|
|
30
|
+
|
|
31
|
+
|
|
5
32
|
## Installation
|
|
6
33
|
|
|
7
34
|
```bash
|
|
8
|
-
npm install
|
|
35
|
+
npm install evals
|
|
9
36
|
```
|
|
10
37
|
|
|
11
38
|
The post-install script will automatically launch the CLI interface.
|
package/cli.js
CHANGED
|
@@ -1,88 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
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
|
-
const
|
|
36
|
-
|
|
37
|
-
{#FF008C-fg} **** {/#FF008C-fg}
|
|
38
|
-
{#FF008C-fg} ****** {black-fg} @@@@@@@@ @@@@@ @@ @@@@@@@ @@@@@@ {/black-fg}{/#FF008C-fg}
|
|
39
|
-
{#FF008C-fg} **** **** {black-fg}@@ @@@ @@ @@ @@@ @@@@ @@@{/black-fg}{/#FF008C-fg}
|
|
40
|
-
{#FF008C-fg}**** *** {black-fg}@@ @@@ @@ @@ @@@ @@ {/black-fg}{/#FF008C-fg}
|
|
41
|
-
{#FF008C-fg}** * *** {black-fg}@@@@@@@@ @@ @@ @@@@@@@ @@@@@@@{/black-fg}{/#FF008C-fg}
|
|
42
|
-
{#FF008C-fg} *** {/#FF008C-fg}
|
|
43
|
-
`
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
|
+
import { render, Box, Text, useInput, useApp, Static } from 'ink';
|
|
5
|
+
import Gradient from 'ink-gradient';
|
|
6
|
+
import { exec } from 'child_process';
|
|
7
|
+
|
|
8
|
+
const e = React.createElement;
|
|
9
|
+
|
|
10
|
+
// "ARIZE EVALS" - EXACTLY matched width (both 44 chars)
|
|
11
|
+
const largeLogo = `
|
|
12
|
+
█████╗ ██████╗ ██╗ ███████╗ ███████╗
|
|
13
|
+
██╔══██╗ ██╔══██╗ ██║ ╚══███╔╝ ██╔════╝
|
|
14
|
+
███████║ ██████╔╝ ██║ ███╔╝ █████╗
|
|
15
|
+
██╔══██║ ██╔══██╗ ██║ ███╔╝ ██╔══╝
|
|
16
|
+
██║ ██║ ██║ ██║ ██║ ███████╗ ███████╗
|
|
17
|
+
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝
|
|
18
|
+
███████╗ ██╗ ██╗ █████╗ ██╗ ███████╗
|
|
19
|
+
██╔════╝ ██║ ██║ ██╔══██╗ ██║ ██╔════╝
|
|
20
|
+
█████╗ ██║ ██║ ███████║ ██║ ███████╗
|
|
21
|
+
██╔══╝ ╚██╗ ██╔╝ ██╔══██║ ██║ ╚════██║
|
|
22
|
+
███████╗ ╚████╔╝ ██║ ██║ ███████╗███████║
|
|
23
|
+
╚══════╝ ╚═══╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝`;
|
|
24
|
+
|
|
25
|
+
const mediumLogo = `
|
|
26
|
+
█████╗ ██████╗ ██╗ ███████╗ ███████╗
|
|
27
|
+
██╔══██╗ ██╔══██╗ ██║ ╚══███╔╝ ██╔════╝
|
|
28
|
+
███████║ ██████╔╝ ██║ ███╔╝ █████╗
|
|
29
|
+
██╔══██║ ██╔══██╗ ██║ ███╔╝ ██╔══╝
|
|
30
|
+
██║ ██║ ██║ ██║ ██║ ███████╗ ███████╗
|
|
31
|
+
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚══════╝
|
|
32
|
+
█▀▀ █ █ ▄▀█ █ █▀
|
|
33
|
+
██▄ ▀▄▀ █▀█ █▄▄ ▄█`;
|
|
34
|
+
|
|
35
|
+
const smallLogo = `ARIZE
|
|
36
|
+
EVALS`;
|
|
44
37
|
|
|
45
38
|
const OPTIONS = [
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
{
|
|
40
|
+
name: 'Evals Primer',
|
|
41
|
+
subtext: 'Learn the Craft',
|
|
42
|
+
url: 'https://arize.com/llm-evaluation/?utm_source=npmevals'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Arize AX SaaS',
|
|
46
|
+
subtext: 'Enterprise Agent Evaluation, Best in Class',
|
|
47
|
+
url: 'https://arize.com/docs/ax?utm_source=npmevals'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Arize Phoenix',
|
|
51
|
+
subtext: 'OSS Agent Evals & Traces, Fully Local',
|
|
52
|
+
url: 'https://arize.com/docs/phoenix?utm_source=npmevals'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Book an Eval Assessment',
|
|
56
|
+
subtext: 'Improve Your Agent Today',
|
|
57
|
+
url: 'https://arize.com/get-an-eval-assessment?utm_source=npmevals'
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
const parts = colorfgbg.split(';');
|
|
61
|
-
if (parts.length < 2) {
|
|
62
|
-
return 'dark';
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const bgColor = parseInt(parts[parts.length - 1], 10);
|
|
66
|
-
|
|
67
|
-
// Background colors: 0 = black (dark), 7 = white (light), 15 = bright white (light)
|
|
68
|
-
// Also consider 8-15 as potentially light colors
|
|
69
|
-
if (bgColor === 0 || (bgColor >= 1 && bgColor <= 6)) {
|
|
70
|
-
return 'dark';
|
|
71
|
-
} else {
|
|
72
|
-
return 'light';
|
|
73
|
-
}
|
|
74
|
-
}
|
|
59
|
+
];
|
|
75
60
|
|
|
76
61
|
function openUrlInBrowser(url) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
? `start ${url}`
|
|
82
|
-
: process.platform === 'darwin'
|
|
83
|
-
? `open "${url}"`
|
|
62
|
+
const command = process.platform === 'win32'
|
|
63
|
+
? `start ${url}`
|
|
64
|
+
: process.platform === 'darwin'
|
|
65
|
+
? `open "${url}"`
|
|
84
66
|
: `xdg-open "${url}"`;
|
|
85
|
-
|
|
67
|
+
|
|
86
68
|
exec(command, (error) => {
|
|
87
69
|
if (error) {
|
|
88
70
|
console.error(`Failed to open browser: ${error.message}`);
|
|
@@ -91,142 +73,137 @@ function openUrlInBrowser(url) {
|
|
|
91
73
|
});
|
|
92
74
|
}
|
|
93
75
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
smartCSR: true,
|
|
98
|
-
title: 'Arize Evals'
|
|
99
|
-
});
|
|
76
|
+
// Header with hot pink to dark blue gradient
|
|
77
|
+
function Header() {
|
|
78
|
+
const terminalWidth = process.stdout.columns || 80;
|
|
100
79
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
const width = process.stdout.columns;
|
|
107
|
-
let selectedLogo;
|
|
108
|
-
let logoHeight;
|
|
109
|
-
let leftMargin;
|
|
110
|
-
if (width >= 105) {
|
|
111
|
-
selectedLogo = LOGO_105;
|
|
112
|
-
logoHeight = 16
|
|
113
|
-
leftMargin = 4
|
|
114
|
-
} else if (width >= 75) {
|
|
115
|
-
selectedLogo = LOGO_75;
|
|
116
|
-
logoHeight = 11
|
|
117
|
-
leftMargin = 2
|
|
80
|
+
let logo;
|
|
81
|
+
if (terminalWidth >= 45) {
|
|
82
|
+
logo = largeLogo;
|
|
83
|
+
} else if (terminalWidth >= 35) {
|
|
84
|
+
logo = mediumLogo;
|
|
118
85
|
} else {
|
|
119
|
-
|
|
120
|
-
logoHeight = 9
|
|
121
|
-
leftMargin = 0
|
|
86
|
+
logo = smallLogo;
|
|
122
87
|
}
|
|
123
88
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
tags: true,
|
|
132
|
-
style: {
|
|
133
|
-
bg: '#fff'
|
|
134
|
-
}
|
|
135
|
-
});
|
|
89
|
+
return e(Box, { flexDirection: 'column', marginBottom: 1 },
|
|
90
|
+
e(Gradient, { colors: ['#FF008C', '#FF1493', '#8B5CF6', '#1E3A8A'] },
|
|
91
|
+
e(Text, null, logo)
|
|
92
|
+
),
|
|
93
|
+
e(Text, { color: 'gray', italic: true }, 'Evals and Observability for Agentic AI')
|
|
94
|
+
);
|
|
95
|
+
}
|
|
136
96
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
height: 1,
|
|
143
|
-
content: 'Select an option:',
|
|
144
|
-
tags: true,
|
|
145
|
-
style: {
|
|
146
|
-
fg: isLightMode ? 'black' : 'white',
|
|
147
|
-
bold: true
|
|
148
|
-
}
|
|
149
|
-
});
|
|
97
|
+
// Character-by-character shimmer component
|
|
98
|
+
function ShimmerText({ text, shimmerPos }) {
|
|
99
|
+
const baseColor = '#FF1493';
|
|
100
|
+
const shimmerColors = ['#FF5AA7', '#FF85C0', '#FFB8D9', '#FFE0EE', '#FFB8D9', '#FF85C0', '#FF5AA7'];
|
|
101
|
+
const shimmerWidth = shimmerColors.length;
|
|
150
102
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
keys: true,
|
|
158
|
-
mouse: true,
|
|
159
|
-
vi: true,
|
|
160
|
-
items: OPTIONS.map(opt => opt.name),
|
|
161
|
-
style: {
|
|
162
|
-
selected: {
|
|
163
|
-
bg: 'blue',
|
|
164
|
-
fg: 'white',
|
|
165
|
-
bold: true
|
|
166
|
-
},
|
|
167
|
-
item: {
|
|
168
|
-
fg: isLightMode ? 'black' : 'white',
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
border: {
|
|
172
|
-
type: 'line'
|
|
103
|
+
const chars = text.split('').map((char, i) => {
|
|
104
|
+
const distanceFromShimmer = i - shimmerPos;
|
|
105
|
+
|
|
106
|
+
let color = baseColor;
|
|
107
|
+
if (distanceFromShimmer >= 0 && distanceFromShimmer < shimmerWidth) {
|
|
108
|
+
color = shimmerColors[distanceFromShimmer];
|
|
173
109
|
}
|
|
174
|
-
});
|
|
175
110
|
|
|
176
|
-
|
|
177
|
-
list.on('select', (item) => {
|
|
178
|
-
const selectedIndex = list.selected;
|
|
179
|
-
const selectedOption = OPTIONS[selectedIndex];
|
|
180
|
-
handleOption(selectedOption.value, screen);
|
|
111
|
+
return e(Text, { key: i, color, bold: true }, char);
|
|
181
112
|
});
|
|
182
113
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const selectedIndex = list.selected;
|
|
186
|
-
const selectedOption = OPTIONS[selectedIndex];
|
|
187
|
-
handleOption(selectedOption.value, screen);
|
|
188
|
-
});
|
|
114
|
+
return e(Box, null, ...chars);
|
|
115
|
+
}
|
|
189
116
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
117
|
+
// Menu item component - single line, hot pink selected with character shimmer
|
|
118
|
+
function MenuItem({ name, subtext, isSelected, shimmerPos }) {
|
|
119
|
+
if (isSelected) {
|
|
120
|
+
return e(Box, null,
|
|
121
|
+
e(Text, { bold: true, color: '#FF1493' }, '❯ '),
|
|
122
|
+
e(ShimmerText, { text: name, shimmerPos }),
|
|
123
|
+
e(Text, { color: 'gray' }, ' — ' + subtext)
|
|
124
|
+
);
|
|
125
|
+
}
|
|
194
126
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
127
|
+
return e(Box, null,
|
|
128
|
+
e(Text, { color: 'white' }, ' ' + name),
|
|
129
|
+
e(Text, { color: 'gray' }, ' — ' + subtext)
|
|
130
|
+
);
|
|
131
|
+
}
|
|
199
132
|
|
|
200
|
-
|
|
201
|
-
|
|
133
|
+
// Main App component
|
|
134
|
+
function App() {
|
|
135
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
136
|
+
const [shimmerPos, setShimmerPos] = useState(-7); // Start off-screen
|
|
137
|
+
const { exit } = useApp();
|
|
138
|
+
|
|
139
|
+
const selectedName = OPTIONS[selectedIndex].name;
|
|
140
|
+
|
|
141
|
+
// Character-by-character shimmer animation
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
const textLength = selectedName.length;
|
|
144
|
+
const shimmerWidth = 7;
|
|
145
|
+
const totalPositions = textLength + shimmerWidth + 5; // Extra padding for smooth loop
|
|
146
|
+
|
|
147
|
+
const timer = setInterval(() => {
|
|
148
|
+
setShimmerPos(prev => {
|
|
149
|
+
const next = prev + 1;
|
|
150
|
+
return next > totalPositions ? -shimmerWidth : next;
|
|
151
|
+
});
|
|
152
|
+
}, 120); // Speed of shimmer movement
|
|
153
|
+
|
|
154
|
+
return () => clearInterval(timer);
|
|
155
|
+
}, [selectedName]);
|
|
156
|
+
|
|
157
|
+
// Reset shimmer position when selection changes
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
setShimmerPos(-7);
|
|
160
|
+
}, [selectedIndex]);
|
|
161
|
+
|
|
162
|
+
useInput((input, key) => {
|
|
163
|
+
if (input === 'q' || key.escape) {
|
|
164
|
+
exit();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
202
167
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
168
|
+
if (key.upArrow || input === 'k') {
|
|
169
|
+
setSelectedIndex(prev => (prev > 0 ? prev - 1 : OPTIONS.length - 1));
|
|
170
|
+
}
|
|
206
171
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (option === 'option1') {
|
|
212
|
-
openUrlInBrowser('https://arize.com/docs/ax/evaluate/evaluators');
|
|
213
|
-
} else if (option === 'option2') {
|
|
214
|
-
openUrlInBrowser('https://arize.com/docs/ax/observe/tracing/setup');
|
|
215
|
-
} else if (option === 'option3') {
|
|
216
|
-
openUrlInBrowser('https://www.youtube.com/watch?v=QPMwpX8uzUI');
|
|
217
|
-
} else if (option === 'option4') {
|
|
218
|
-
openUrlInBrowser('?')
|
|
219
|
-
} else {
|
|
220
|
-
console.log(`\nYou selected: ${option}`);
|
|
221
|
-
console.log('(Implementation coming soon)\n');
|
|
222
|
-
process.exit(0);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
172
|
+
if (key.downArrow || input === 'j') {
|
|
173
|
+
setSelectedIndex(prev => (prev < OPTIONS.length - 1 ? prev + 1 : 0));
|
|
174
|
+
}
|
|
225
175
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
176
|
+
if (key.return) {
|
|
177
|
+
const selected = OPTIONS[selectedIndex];
|
|
178
|
+
exit();
|
|
179
|
+
setTimeout(() => {
|
|
180
|
+
console.log(`\nOpening ${selected.url} in your browser...\n`);
|
|
181
|
+
openUrlInBrowser(selected.url);
|
|
182
|
+
}, 100);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
return e(Box, { flexDirection: 'column', padding: 1 },
|
|
187
|
+
e(Static, { items: ['header'] }, () => e(Header)),
|
|
188
|
+
e(Box, { marginBottom: 1 },
|
|
189
|
+
e(Text, { bold: true, color: 'white' }, 'Select an option:')
|
|
190
|
+
),
|
|
191
|
+
e(Box, { flexDirection: 'column', paddingX: 1 },
|
|
192
|
+
...OPTIONS.map((option, index) =>
|
|
193
|
+
e(MenuItem, {
|
|
194
|
+
key: index.toString(),
|
|
195
|
+
name: option.name,
|
|
196
|
+
subtext: option.subtext,
|
|
197
|
+
isSelected: index === selectedIndex,
|
|
198
|
+
shimmerPos: shimmerPos
|
|
199
|
+
})
|
|
200
|
+
)
|
|
201
|
+
),
|
|
202
|
+
e(Box, { marginTop: 1 },
|
|
203
|
+
e(Text, { dimColor: true }, 'Enter to select · ↑↓ to navigate · Esc to cancel')
|
|
204
|
+
)
|
|
205
|
+
);
|
|
232
206
|
}
|
|
207
|
+
|
|
208
|
+
// Run the app
|
|
209
|
+
render(e(App), { patchConsole: false });
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "evals",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Arize evals package",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "cli.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"postinstall": "node cli.js",
|
|
8
9
|
"start": "node cli.js"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"@arizeai/phoenix-otel": "*",
|
|
12
|
-
"
|
|
13
|
+
"ink": "^6.0.0",
|
|
14
|
+
"ink-gradient": "^3.0.0",
|
|
15
|
+
"react": "^19.0.0"
|
|
13
16
|
},
|
|
14
17
|
"bin": {
|
|
15
18
|
"evals": "./cli.js"
|
|
@@ -21,4 +24,3 @@
|
|
|
21
24
|
"author": "",
|
|
22
25
|
"license": "ISC"
|
|
23
26
|
}
|
|
24
|
-
|