@sandboxrouter/sdk 0.14.1 → 0.15.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/dist/catalog.d.ts +21 -1
- package/dist/catalog.js +24 -0
- package/dist/cli.js +4 -0
- package/dist/leaderboard.js +5 -4
- package/dist/price-index.js +6 -3
- package/dist/published.js +823 -162
- package/dist/recommend.d.ts +11 -4
- package/dist/recommend.js +3 -2
- package/package.json +1 -1
package/dist/recommend.d.ts
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
export type RecJob = "start" | "short" | "long" | "python" | "download" | "agent" | "repo";
|
|
3
3
|
/** What to rank by: lowest cost, shortest time, or both together ("value"). */
|
|
4
4
|
export type RecPriority = "cost" | "speed" | "value";
|
|
5
|
+
type BenchmarkSize = {
|
|
6
|
+
vcpu: number;
|
|
7
|
+
memoryGb: number;
|
|
8
|
+
};
|
|
5
9
|
export interface PublishedStart {
|
|
6
10
|
name: string;
|
|
11
|
+
size?: BenchmarkSize;
|
|
7
12
|
medianCreateMs: number;
|
|
8
13
|
medianReadyMs?: number;
|
|
9
14
|
successRate: number;
|
|
@@ -13,6 +18,7 @@ export interface PublishedStart {
|
|
|
13
18
|
}
|
|
14
19
|
export interface PublishedJob {
|
|
15
20
|
name: string;
|
|
21
|
+
size?: BenchmarkSize;
|
|
16
22
|
/** Time to a usable sandbox when it ran this job. */
|
|
17
23
|
createMs: number;
|
|
18
24
|
/** The job itself, once the sandbox was up. */
|
|
@@ -38,10 +44,7 @@ export interface PublishedLoadRow {
|
|
|
38
44
|
ok: number;
|
|
39
45
|
/** Of those that didn't start, how many the benchmarking account's own limit refused. */
|
|
40
46
|
limited: number;
|
|
41
|
-
size?:
|
|
42
|
-
vcpu: number;
|
|
43
|
-
memoryGb: number;
|
|
44
|
-
};
|
|
47
|
+
size?: BenchmarkSize;
|
|
45
48
|
createFailures?: number;
|
|
46
49
|
commandFailures?: number;
|
|
47
50
|
taskFailures?: number;
|
|
@@ -73,6 +76,7 @@ export interface PublishedData {
|
|
|
73
76
|
minUsd: number;
|
|
74
77
|
maxUsd: number;
|
|
75
78
|
source: string;
|
|
79
|
+
when?: string;
|
|
76
80
|
}>;
|
|
77
81
|
}
|
|
78
82
|
export interface RecommendOptions {
|
|
@@ -93,6 +97,8 @@ export interface Recommendation {
|
|
|
93
97
|
rank: number;
|
|
94
98
|
provider: string;
|
|
95
99
|
name: string;
|
|
100
|
+
/** Nominal sandbox size used for the single-run measurement. */
|
|
101
|
+
size?: BenchmarkSize;
|
|
96
102
|
/** Seconds for one job, start included unless reusing. */
|
|
97
103
|
secondsEach: number;
|
|
98
104
|
/** Cost of one job; for "start", undefined (see hourlyUsd). */
|
|
@@ -132,3 +138,4 @@ export interface RecommendResult {
|
|
|
132
138
|
* stopped them was the benchmarking account's, not theirs.
|
|
133
139
|
*/
|
|
134
140
|
export declare function recommend(data: PublishedData, opts?: RecommendOptions): RecommendResult;
|
|
141
|
+
export {};
|
package/dist/recommend.js
CHANGED
|
@@ -36,7 +36,7 @@ export function recommend(data, opts = {}) {
|
|
|
36
36
|
const paired = startRows.length > 0 && startRows.every(([, s]) => s.medianReadyMs !== undefined);
|
|
37
37
|
if (job === "start") {
|
|
38
38
|
for (const [id, s] of startRows) {
|
|
39
|
-
raw.push({ provider: id, name: s.name, secondsEach: (paired ? s.medianReadyMs : s.medianCreateMs) / 1000, hourlyUsd: s.hourlyUsd, successRate: s.successRate, runs: s.runs, notes: [], measuredAt: s.measuredAt, usdKey: s.hourlyUsd });
|
|
39
|
+
raw.push({ provider: id, name: s.name, ...(s.size ? { size: s.size } : {}), secondsEach: (paired ? s.medianReadyMs : s.medianCreateMs) / 1000, hourlyUsd: s.hourlyUsd, successRate: s.successRate, runs: s.runs, notes: [], measuredAt: s.measuredAt, usdKey: s.hourlyUsd });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
@@ -54,6 +54,7 @@ export function recommend(data, opts = {}) {
|
|
|
54
54
|
raw.push({
|
|
55
55
|
provider: id,
|
|
56
56
|
name: j.name,
|
|
57
|
+
...(j.size ? { size: j.size } : {}),
|
|
57
58
|
secondsEach: (j.taskMs + (reuse ? 0 : j.createMs)) / 1000,
|
|
58
59
|
usdEach: usd,
|
|
59
60
|
usdTotal: usd * count,
|
|
@@ -69,7 +70,7 @@ export function recommend(data, opts = {}) {
|
|
|
69
70
|
for (const r of raw) {
|
|
70
71
|
const fee = data.conditionalStartFees?.[r.provider];
|
|
71
72
|
if (!reuse && fee)
|
|
72
|
-
r.notes.push(`excludes
|
|
73
|
+
r.notes.push(`excludes ${fee.minUsd === fee.maxUsd ? `$${fee.minUsd}` : `$${fee.minUsd}–$${fee.maxUsd}`} per start ${fee.when ?? "above allowance"}`);
|
|
73
74
|
if (r.runs < mostRuns / 2)
|
|
74
75
|
r.notes.push(`only ${r.runs} runs`);
|
|
75
76
|
if (r.successRate < 1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandboxrouter/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "One API for every sandbox provider: route AI agents' code by price, speed or capability, with automatic fallback. Free and open source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|