@inference/fast 0.0.7
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 +55 -0
- package/bin/fast.cjs +62 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# `@inference/fast`
|
|
2
|
+
|
|
3
|
+
Connect Claude Code, Codex, OpenCode, and Pi to fast models on Inference.net.
|
|
4
|
+
The CLI signs in through the Concentrate dashboard, selects the personal
|
|
5
|
+
workspace's first project, and creates one machine-scoped project API key.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @inference/fast
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Use
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
fast login
|
|
17
|
+
fast claude on
|
|
18
|
+
fast codex on --model glm-5.2
|
|
19
|
+
fast opencode status
|
|
20
|
+
fast pi off
|
|
21
|
+
fast status
|
|
22
|
+
fast logout
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Calling a coding agent without `on` is equivalent to `on`, so `fast claude`
|
|
26
|
+
is enough. Every `on` snapshots the agent's original config before changing it.
|
|
27
|
+
`off` restores that snapshot byte-for-byte. `logout` restores every connected
|
|
28
|
+
agent and disables the API key created for this machine. The inference gateway
|
|
29
|
+
can retain an already-used key in its authentication cache for up to three
|
|
30
|
+
minutes before it starts returning unauthorized responses.
|
|
31
|
+
|
|
32
|
+
## Files
|
|
33
|
+
|
|
34
|
+
- Owner-private CLI state and transport credentials: `~/.inference-fast`
|
|
35
|
+
- Claude Code: `~/.claude/settings.json`
|
|
36
|
+
- Codex: `~/.codex/config.toml`
|
|
37
|
+
- OpenCode: `~/.config/opencode/opencode.json`
|
|
38
|
+
- Pi: `~/.pi/agent/{settings,models,auth}.json`
|
|
39
|
+
|
|
40
|
+
All CLI and harness files that can contain a credential are written with owner-
|
|
41
|
+
only permissions. Harness backups live under `~/.inference-fast/backups`.
|
|
42
|
+
|
|
43
|
+
## Local development
|
|
44
|
+
|
|
45
|
+
With relay, the inference gateway, and `fast-web` running locally:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
INFERENCE_FAST_RELAY_URL=http://localhost:8888 \
|
|
49
|
+
INFERENCE_FAST_DASHBOARD_URL=http://localhost:3001 \
|
|
50
|
+
INFERENCE_FAST_API_URL=http://localhost:8788 \
|
|
51
|
+
bun run dev -- login
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The dashboard and inference URLs are derived automatically from a localhost
|
|
55
|
+
relay unless explicitly overridden.
|
package/bin/fast.cjs
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { execFileSync } = require("child_process");
|
|
6
|
+
const { existsSync } = require("fs");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
|
|
9
|
+
const PLATFORM_PACKAGES = {
|
|
10
|
+
darwin_arm64: "@inference/fast-darwin-arm64",
|
|
11
|
+
darwin_x64: "@inference/fast-darwin-x64",
|
|
12
|
+
linux_x64: "@inference/fast-linux-x64",
|
|
13
|
+
linux_arm64: "@inference/fast-linux-arm64",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function getBinaryPath() {
|
|
17
|
+
const platformKey = `${process.platform}_${process.arch}`;
|
|
18
|
+
const packageName = PLATFORM_PACKAGES[platformKey];
|
|
19
|
+
|
|
20
|
+
if (!packageName) {
|
|
21
|
+
console.error(
|
|
22
|
+
`Unsupported platform: ${process.platform} ${process.arch}\n` +
|
|
23
|
+
"@inference/fast supports macOS and Linux on arm64 and x64.",
|
|
24
|
+
);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
return require.resolve(`${packageName}/bin/fast`);
|
|
30
|
+
} catch {}
|
|
31
|
+
|
|
32
|
+
let directory = __dirname;
|
|
33
|
+
for (let depth = 0; depth < 5; depth += 1) {
|
|
34
|
+
const candidate = path.join(
|
|
35
|
+
directory,
|
|
36
|
+
"node_modules",
|
|
37
|
+
packageName,
|
|
38
|
+
"bin",
|
|
39
|
+
"fast",
|
|
40
|
+
);
|
|
41
|
+
if (existsSync(candidate)) return candidate;
|
|
42
|
+
directory = path.dirname(directory);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.error(
|
|
46
|
+
`Could not find the @inference/fast binary for ${process.platform} ${process.arch}.\n\n` +
|
|
47
|
+
"Try reinstalling with: npm install -g @inference/fast",
|
|
48
|
+
);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
execFileSync(getBinaryPath(), process.argv.slice(2), {
|
|
54
|
+
stdio: "inherit",
|
|
55
|
+
env: process.env,
|
|
56
|
+
});
|
|
57
|
+
} catch (error) {
|
|
58
|
+
if (error && typeof error.status === "number") {
|
|
59
|
+
process.exit(error.status);
|
|
60
|
+
}
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inference/fast",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "Connect coding agents to fast Inference.net models",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bin": {
|
|
8
|
+
"fast": "bin/fast.cjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/fast.cjs",
|
|
12
|
+
"package.json",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"inference",
|
|
20
|
+
"coding-agent",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"codex",
|
|
23
|
+
"opencode",
|
|
24
|
+
"pi"
|
|
25
|
+
],
|
|
26
|
+
"optionalDependencies": {
|
|
27
|
+
"@inference/fast-darwin-arm64": "0.0.7",
|
|
28
|
+
"@inference/fast-darwin-x64": "0.0.7",
|
|
29
|
+
"@inference/fast-linux-x64": "0.0.7",
|
|
30
|
+
"@inference/fast-linux-arm64": "0.0.7"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "bun run clean:bin && bun run build:cli",
|
|
34
|
+
"build:cli": "bun build src/index.ts --compile --minify --env=INFERENCE_FAST_* --outfile bin/fast",
|
|
35
|
+
"build:cli:local": "bun build src/index.ts --compile --env=INFERENCE_FAST_* --outfile bin/fast",
|
|
36
|
+
"prepare:npm:manifests": "bun scripts/sync-versions.ts",
|
|
37
|
+
"build:npm:darwin-arm64": "bun build src/index.ts --bundle --compile --minify --env=INFERENCE_FAST_* --target=bun-darwin-arm64 --outfile npm/fast-darwin-arm64/bin/fast",
|
|
38
|
+
"build:npm:darwin-x64": "bun build src/index.ts --bundle --compile --minify --env=INFERENCE_FAST_* --target=bun-darwin-x64 --outfile npm/fast-darwin-x64/bin/fast",
|
|
39
|
+
"build:npm:linux-x64": "bun build src/index.ts --bundle --compile --minify --env=INFERENCE_FAST_* --target=bun-linux-x64 --outfile npm/fast-linux-x64/bin/fast",
|
|
40
|
+
"build:npm:linux-arm64": "bun build src/index.ts --bundle --compile --minify --env=INFERENCE_FAST_* --target=bun-linux-arm64 --outfile npm/fast-linux-arm64/bin/fast",
|
|
41
|
+
"build:npm:all": "bun run clean:npm && bun run build && bun run build:npm:darwin-arm64 && bun run build:npm:darwin-x64 && bun run build:npm:linux-x64 && bun run build:npm:linux-arm64",
|
|
42
|
+
"ci:build-and-verify": "bash scripts/ci-build-and-verify.sh",
|
|
43
|
+
"clean:bin": "rm -f bin/fast",
|
|
44
|
+
"clean:npm": "rm -f npm/fast-darwin-arm64/bin/fast npm/fast-darwin-x64/bin/fast npm/fast-linux-x64/bin/fast npm/fast-linux-arm64/bin/fast",
|
|
45
|
+
"dev": "bun src/index.ts",
|
|
46
|
+
"format": "oxfmt --check .",
|
|
47
|
+
"format:fix": "oxfmt --write .",
|
|
48
|
+
"lint": "cd ../.. && ./node_modules/.bin/oxlint --type-aware --config oxlint.config.mjs apps/fast-cli",
|
|
49
|
+
"lint:fix": "cd ../.. && ./node_modules/.bin/oxlint --type-aware --fix --config oxlint.config.mjs apps/fast-cli",
|
|
50
|
+
"tsc": "../../node_modules/typescript-7/bin/tsc --build",
|
|
51
|
+
"test": "vitest run --config vitest.config.ts",
|
|
52
|
+
"test:unit": "vitest run --config vitest.config.ts"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@inference-net/auth": "workspace:*",
|
|
56
|
+
"@inference-net/relay": "workspace:*",
|
|
57
|
+
"@trpc/client": "11.4.0",
|
|
58
|
+
"@types/bun": "1.3.14",
|
|
59
|
+
"bun-types": "1.3.14",
|
|
60
|
+
"chalk": "5.4.1",
|
|
61
|
+
"commander": "13.1.0",
|
|
62
|
+
"open": "10.1.0",
|
|
63
|
+
"vitest": "4.1.10"
|
|
64
|
+
}
|
|
65
|
+
}
|