graph-bench 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +39 -2
- package/bin/gbench.cjs +60 -0
- package/bin/targets.json +37 -0
- package/package.json +36 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Teofanovic Stefan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# graph-bench
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A local development bench for LangGraph projects: watch runs, every model call, cost and cache, and experiment on calls.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx graph-bench --version
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
or install it once and run `gbench`:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install -g graph-bench
|
|
15
|
+
gbench --help
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
npm installs the main package and only the binary for your machine, from its optional dependencies; do not install with `--no-optional` or `--omit=optional`.
|
|
19
|
+
|
|
20
|
+
## Supported platforms
|
|
21
|
+
|
|
22
|
+
| OS | CPU |
|
|
23
|
+
| ------------- | ---------- |
|
|
24
|
+
| Windows | x64 |
|
|
25
|
+
| macOS | x64, arm64 |
|
|
26
|
+
| Linux (glibc) | x64, arm64 |
|
|
27
|
+
|
|
28
|
+
## First commands
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
gbench http://localhost:2024 # start this folder's bench, attach your LangGraph Agent Server, print the page's link
|
|
32
|
+
gbench doctor # check the servers and the bench
|
|
33
|
+
gbench --help # every verb
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
graph-bench is not affiliated with LangChain, LangGraph or Anthropic.
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
MIT
|
package/bin/gbench.cjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// graph-bench's npm bin: finds this machine's @graph-bench/<os>-<cpu> package and runs its binary (npm-package#D9).
|
|
3
|
+
// Plain Node, no dependency, so `npx graph-bench` runs where Bun is not installed.
|
|
4
|
+
"use strict";
|
|
5
|
+
const { spawnSync } = require("node:child_process");
|
|
6
|
+
const targets = require("./targets.json");
|
|
7
|
+
|
|
8
|
+
function fail(message) {
|
|
9
|
+
process.stderr.write(`${message}\n`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function binaryPath() {
|
|
14
|
+
if (process.env.GBENCH_BINARY) return process.env.GBENCH_BINARY;
|
|
15
|
+
const target = targets.find(
|
|
16
|
+
(row) => row.os === process.platform && row.cpu === process.arch,
|
|
17
|
+
);
|
|
18
|
+
if (!target) {
|
|
19
|
+
const supported = targets.map((row) => `${row.os}-${row.cpu}`).join(", ");
|
|
20
|
+
fail(
|
|
21
|
+
`graph-bench has no binary for ${process.platform}-${process.arch}; supported: ${supported}`,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
return require.resolve(`${target.pkg}/bin/${target.bin}`);
|
|
26
|
+
} catch {
|
|
27
|
+
fail(
|
|
28
|
+
`graph-bench: ${target.pkg} is not installed (npm skipped optional dependencies?). Reinstall without --no-optional / --omit=optional.`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function runBinary(binary) {
|
|
34
|
+
return spawnSync(binary, process.argv.slice(2), {
|
|
35
|
+
stdio: "inherit",
|
|
36
|
+
windowsHide: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const binary = binaryPath();
|
|
41
|
+
let run = runBinary(binary);
|
|
42
|
+
// A package packed on Windows carries no execute bit; give the binary its own once, as npm does for a bin.
|
|
43
|
+
if (run.error && run.error.code === "EACCES") {
|
|
44
|
+
try {
|
|
45
|
+
require("node:fs").chmodSync(binary, 0o755);
|
|
46
|
+
} catch {
|
|
47
|
+
fail(
|
|
48
|
+
`graph-bench: ${binary} is not executable and cannot be fixed by this user; reinstall graph-bench, or chmod +x it`,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
run = runBinary(binary);
|
|
52
|
+
}
|
|
53
|
+
if (run.error) {
|
|
54
|
+
const given = process.env.GBENCH_BINARY ? " (set by GBENCH_BINARY)" : "";
|
|
55
|
+
fail(
|
|
56
|
+
`graph-bench: cannot run ${binary}${given}: ${run.error.code ?? run.error.message}`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
if (run.signal) process.kill(process.pid, run.signal);
|
|
60
|
+
process.exit(run.status ?? 1);
|
package/bin/targets.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"pkg": "@graph-bench/win32-x64",
|
|
4
|
+
"os": "win32",
|
|
5
|
+
"cpu": "x64",
|
|
6
|
+
"bun": "bun-windows-x64",
|
|
7
|
+
"bin": "gbench.exe"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"pkg": "@graph-bench/darwin-x64",
|
|
11
|
+
"os": "darwin",
|
|
12
|
+
"cpu": "x64",
|
|
13
|
+
"bun": "bun-darwin-x64",
|
|
14
|
+
"bin": "gbench"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"pkg": "@graph-bench/darwin-arm64",
|
|
18
|
+
"os": "darwin",
|
|
19
|
+
"cpu": "arm64",
|
|
20
|
+
"bun": "bun-darwin-arm64",
|
|
21
|
+
"bin": "gbench"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"pkg": "@graph-bench/linux-x64",
|
|
25
|
+
"os": "linux",
|
|
26
|
+
"cpu": "x64",
|
|
27
|
+
"bun": "bun-linux-x64",
|
|
28
|
+
"bin": "gbench"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"pkg": "@graph-bench/linux-arm64",
|
|
32
|
+
"os": "linux",
|
|
33
|
+
"cpu": "arm64",
|
|
34
|
+
"bun": "bun-linux-arm64",
|
|
35
|
+
"bin": "gbench"
|
|
36
|
+
}
|
|
37
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "graph-bench",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A local development bench for LangGraph projects: watch runs, every model call, cost and cache, and experiment on calls.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"langgraph",
|
|
7
|
+
"langchain",
|
|
8
|
+
"llm",
|
|
9
|
+
"ai-agents",
|
|
10
|
+
"agent-development",
|
|
11
|
+
"developer-tools",
|
|
12
|
+
"debugging",
|
|
13
|
+
"observability",
|
|
14
|
+
"prompt-caching",
|
|
15
|
+
"anthropic",
|
|
16
|
+
"claude",
|
|
17
|
+
"cli"
|
|
18
|
+
],
|
|
19
|
+
"bin": {
|
|
20
|
+
"gbench": "bin/gbench.cjs"
|
|
21
|
+
},
|
|
22
|
+
"optionalDependencies": {
|
|
23
|
+
"@graph-bench/win32-x64": "0.1.0",
|
|
24
|
+
"@graph-bench/darwin-x64": "0.1.0",
|
|
25
|
+
"@graph-bench/darwin-arm64": "0.1.0",
|
|
26
|
+
"@graph-bench/linux-x64": "0.1.0",
|
|
27
|
+
"@graph-bench/linux-arm64": "0.1.0"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/Ovich/graph-bench.git"
|
|
36
|
+
}
|
|
37
|
+
}
|