@llmtrim/cli 0.1.4

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.
Files changed (2) hide show
  1. package/bin/llmtrim.js +16 -0
  2. package/package.json +19 -0
package/bin/llmtrim.js ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ // Resolve the platform package's prebuilt binary and exec it with our args.
3
+ const { spawnSync } = require("child_process");
4
+ const path = require("path");
5
+ const pkg = `@llmtrim/${process.platform}-${process.arch}`;
6
+ const bin = process.platform === "win32" ? "llmtrim.exe" : "llmtrim";
7
+ let exe;
8
+ try {
9
+ exe = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", bin);
10
+ } catch {
11
+ console.error(`llmtrim: no prebuilt binary for ${process.platform}-${process.arch}.`);
12
+ console.error("Install alternatives: https://github.com/fkiene/llmtrim#install");
13
+ process.exit(1);
14
+ }
15
+ const r = spawnSync(exe, process.argv.slice(2), { stdio: "inherit" });
16
+ process.exit(r.status === null ? 1 : r.status);
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@llmtrim/cli",
3
+ "version": "0.1.4",
4
+ "description": "Cut your LLM bill: drop-in proxy that compresses input, output, and cache. Any provider, answers unchanged.",
5
+ "repository": "https://github.com/fkiene/llmtrim",
6
+ "homepage": "https://github.com/fkiene/llmtrim#readme",
7
+ "license": "AGPL-3.0-only",
8
+ "keywords": ["llm", "tokens", "compression", "proxy", "openai", "anthropic", "claude"],
9
+ "bin": { "llmtrim": "bin/llmtrim.js" },
10
+ "files": ["bin"],
11
+ "optionalDependencies": {
12
+ "@llmtrim/linux-x64": "0.1.4",
13
+ "@llmtrim/linux-arm64": "0.1.4",
14
+ "@llmtrim/darwin-x64": "0.1.4",
15
+ "@llmtrim/darwin-arm64": "0.1.4",
16
+ "@llmtrim/win32-x64": "0.1.4",
17
+ "@llmtrim/win32-arm64": "0.1.4"
18
+ }
19
+ }