mlclaw 0.1.0 → 0.2.1
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/.agents/skills/mlclaw/SKILL.md +63 -18
- package/Dockerfile +21 -4
- package/README.md +70 -24
- package/assets/hf-logo.svg +8 -0
- package/assets/hf-tooling/manifest.json +50 -0
- package/assets/hf-tooling/skills/hf-cli/SKILL.md +218 -0
- package/assets/hf-tooling/skills/hf-mem/SKILL.md +79 -0
- package/assets/hf-tooling/skills/huggingface-best/SKILL.md +134 -0
- package/assets/hf-tooling/skills/huggingface-datasets/SKILL.md +107 -0
- package/assets/hf-tooling/skills/huggingface-gradio/SKILL.md +298 -0
- package/assets/hf-tooling/skills/huggingface-gradio/examples.md +613 -0
- package/assets/hf-tooling/skills/huggingface-local-models/SKILL.md +113 -0
- package/assets/hf-tooling/skills/huggingface-local-models/references/hardware.md +38 -0
- package/assets/hf-tooling/skills/huggingface-local-models/references/hub-discovery.md +178 -0
- package/assets/hf-tooling/skills/huggingface-local-models/references/quantization.md +256 -0
- package/assets/hf-tooling/skills/huggingface-papers/SKILL.md +239 -0
- package/assets/hf-tooling/skills/huggingface-spaces/SKILL.md +239 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/buckets.md +89 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/debugging.md +236 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/gradio.md +200 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/grants.md +56 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/inference-providers.md +85 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/known-errors.md +232 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/requirements.md +169 -0
- package/assets/hf-tooling/skills/huggingface-spaces/references/zerogpu.md +349 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/SKILL.md +120 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/baseline_hf_api.py +57 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/baseline_hf_api.sh +40 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/baseline_hf_api.tsx +57 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/find_models_by_paper.sh +230 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/hf_enrich_models.sh +96 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
- package/assets/hf-tooling/skills/huggingface-tool-builder/references/hf_model_papers_auth.sh +171 -0
- package/assets/hf-tooling/skills/huggingface-zerogpu/SKILL.md +289 -0
- package/assets/hf-tooling/skills/huggingface-zerogpu/references/concurrency.md +79 -0
- package/assets/hf-tooling/skills/huggingface-zerogpu/references/cuda-and-deps.md +66 -0
- package/assets/hf-tooling/skills/huggingface-zerogpu/references/how-quota-works.md +74 -0
- package/assets/hf-tooling/skills/huggingface-zerogpu/references/how-zerogpu-works.md +50 -0
- package/assets/hf-tooling/templates/.agents/mcp/huggingface.json +11 -0
- package/assets/hf-tooling/templates/.env.example +5 -0
- package/assets/hf-tooling/templates/examples/huggingface/README.md +16 -0
- package/assets/hf-tooling/templates/examples/huggingface/bucket-sync.md +19 -0
- package/assets/hf-tooling/templates/examples/huggingface/dataset-upload.py +22 -0
- package/assets/hf-tooling/templates/examples/huggingface/hf-discover.md +13 -0
- package/assets/hf-tooling/templates/examples/huggingface/runtime-inspection.py +9 -0
- package/assets/mlclaw-control-ui/assets/index-D2TFes32.js +9 -0
- package/assets/mlclaw-control-ui/assets/index-DP72PFuv.css +1 -0
- package/assets/mlclaw-control-ui/index.html +13 -0
- package/assets/mlclaw.svg +298 -124
- package/dist/hf-tooling-seed.js +261 -0
- package/dist/mlclaw-space-runtime.js +6634 -3321
- package/dist/mlclaw.mjs +428 -178
- package/entrypoint.sh +4 -0
- package/mlclaw.ps1 +4 -2
- package/mlclaw.sh +5 -3
- package/openclaw.default.json +1 -0
- package/package.json +16 -2
- package/space/README.md +32 -2
- package/tsconfig.json +3 -2
package/entrypoint.sh
CHANGED
|
@@ -83,5 +83,9 @@ if [ -n "${TELEGRAM_BOT_TOKEN:-}" ] && [ "${OPENCLAW_TELEGRAM_CONNECTIVITY_PROBE
|
|
|
83
83
|
fi
|
|
84
84
|
fi
|
|
85
85
|
|
|
86
|
+
echo "[hf-tooling] seeding baseline Hugging Face tooling"
|
|
87
|
+
node /app/hf-tooling-seed.js
|
|
88
|
+
echo "[hf-tooling] baseline Hugging Face tooling ready"
|
|
89
|
+
|
|
86
90
|
chown -R node:node "$LIVE_DIR"
|
|
87
91
|
exec gosu node node /app/hf-state-sync.js supervise -- node /app/mlclaw-space-runtime.js
|
package/mlclaw.ps1
CHANGED
|
@@ -71,16 +71,18 @@ function Install-CachedNode {
|
|
|
71
71
|
function Invoke-MLClaw($NodeBin, [string[]]$CliArgs) {
|
|
72
72
|
$nodeDir = Split-Path $NodeBin -Parent
|
|
73
73
|
$env:PATH = "$nodeDir;$env:PATH"
|
|
74
|
+
$execPrefix = Join-Path $CacheRoot "npm-exec"
|
|
75
|
+
New-Item -ItemType Directory -Force -Path $execPrefix | Out-Null
|
|
74
76
|
$npmCli = Join-Path $nodeDir "node_modules\npm\bin\npm-cli.js"
|
|
75
77
|
if (-not (Test-Path $npmCli)) {
|
|
76
78
|
$npmCommand = Get-Command npm -ErrorAction SilentlyContinue
|
|
77
79
|
if (-not $npmCommand) {
|
|
78
80
|
throw "npm was not found for Node runtime $NodeBin"
|
|
79
81
|
}
|
|
80
|
-
& $npmCommand.Source exec --yes --package $PackageSpec -- mlclaw @CliArgs
|
|
82
|
+
& $npmCommand.Source exec --yes --prefix $execPrefix --package $PackageSpec -- mlclaw @CliArgs
|
|
81
83
|
exit $LASTEXITCODE
|
|
82
84
|
}
|
|
83
|
-
& $NodeBin $npmCli exec --yes --package $PackageSpec -- mlclaw @CliArgs
|
|
85
|
+
& $NodeBin $npmCli exec --yes --prefix $execPrefix --package $PackageSpec -- mlclaw @CliArgs
|
|
84
86
|
exit $LASTEXITCODE
|
|
85
87
|
}
|
|
86
88
|
|
package/mlclaw.sh
CHANGED
|
@@ -84,14 +84,16 @@ install_node() {
|
|
|
84
84
|
run_with_node() {
|
|
85
85
|
local node_bin="$1"
|
|
86
86
|
shift
|
|
87
|
-
local npm_cli node_path
|
|
87
|
+
local npm_cli node_path exec_prefix
|
|
88
88
|
node_path="$(dirname "$node_bin")"
|
|
89
89
|
npm_cli="$(dirname "$node_bin")/../lib/node_modules/npm/bin/npm-cli.js"
|
|
90
|
+
exec_prefix="$CACHE_ROOT/npm-exec"
|
|
91
|
+
mkdir -p "$exec_prefix"
|
|
90
92
|
if [ -f "$npm_cli" ]; then
|
|
91
|
-
PATH="$node_path:$PATH" exec "$node_bin" "$npm_cli" exec --yes --package "$PACKAGE_SPEC" -- mlclaw "$@"
|
|
93
|
+
PATH="$node_path:$PATH" exec "$node_bin" "$npm_cli" exec --yes --prefix "$exec_prefix" --package "$PACKAGE_SPEC" -- mlclaw "$@"
|
|
92
94
|
fi
|
|
93
95
|
if command -v npm >/dev/null 2>&1; then
|
|
94
|
-
PATH="$node_path:$PATH" exec npm exec --yes --package "$PACKAGE_SPEC" -- mlclaw "$@"
|
|
96
|
+
PATH="$node_path:$PATH" exec npm exec --yes --prefix "$exec_prefix" --package "$PACKAGE_SPEC" -- mlclaw "$@"
|
|
95
97
|
fi
|
|
96
98
|
die "npm was not found for Node runtime $node_bin"
|
|
97
99
|
}
|
package/openclaw.default.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mlclaw",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"config": {
|
|
6
|
+
"openclawVersion": "2026.6.11",
|
|
7
|
+
"runtimeImageRepository": "ghcr.io/osolmaz/mlclaw"
|
|
8
|
+
},
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "https://github.com/osolmaz/mlclaw"
|
|
@@ -19,6 +23,7 @@
|
|
|
19
23
|
".gitattributes",
|
|
20
24
|
"assets/",
|
|
21
25
|
"dist/hf-state-sync.js",
|
|
26
|
+
"dist/hf-tooling-seed.js",
|
|
22
27
|
"dist/mlclaw.mjs",
|
|
23
28
|
"dist/mlclaw-space-runtime.js",
|
|
24
29
|
"Dockerfile",
|
|
@@ -38,8 +43,10 @@
|
|
|
38
43
|
"tsconfig.json"
|
|
39
44
|
],
|
|
40
45
|
"scripts": {
|
|
41
|
-
"build": "npm run build:state-sync && npm run build:space-runtime && npm run build:mlclaw",
|
|
46
|
+
"build": "npm run build:control-ui && npm run build:state-sync && npm run build:hf-tooling && npm run build:space-runtime && npm run build:mlclaw",
|
|
47
|
+
"build:control-ui": "vite build --config vite.control-ui.config.ts",
|
|
42
48
|
"build:state-sync": "esbuild src/hf-state-sync/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/hf-state-sync.js --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\"",
|
|
49
|
+
"build:hf-tooling": "esbuild src/hf-tooling/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/hf-tooling-seed.js --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\"",
|
|
43
50
|
"build:space-runtime": "esbuild src/mlclaw-space-runtime/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/mlclaw-space-runtime.js --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\"",
|
|
44
51
|
"build:mlclaw": "esbuild src/mlclaw/cli.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/mlclaw.mjs --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\"",
|
|
45
52
|
"build:probe": "esbuild scripts/parity-probe.ts --bundle --platform=node --target=node22 --format=esm --outfile=dist/parity-probe.mjs --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\"",
|
|
@@ -54,13 +61,20 @@
|
|
|
54
61
|
"@huggingface/splitmix64-wasm": "^0.0.1",
|
|
55
62
|
"@huggingface/xetchunk-wasm": "^0.0.6",
|
|
56
63
|
"commander": "^14.0.3",
|
|
64
|
+
"hono": "^4.12.28",
|
|
65
|
+
"react": "^19.2.7",
|
|
66
|
+
"react-dom": "^19.2.7",
|
|
57
67
|
"skillflag": "^0.2.0",
|
|
58
68
|
"zod": "^3.24.0"
|
|
59
69
|
},
|
|
60
70
|
"devDependencies": {
|
|
61
71
|
"@types/node": "^24.0.0",
|
|
72
|
+
"@types/react": "^19.2.17",
|
|
73
|
+
"@types/react-dom": "^19.2.3",
|
|
74
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
62
75
|
"esbuild": "^0.25.0",
|
|
63
76
|
"typescript": "^5.7.0",
|
|
77
|
+
"vite": "^7.3.6",
|
|
64
78
|
"vitest": "^3.0.0"
|
|
65
79
|
}
|
|
66
80
|
}
|
package/space/README.md
CHANGED
|
@@ -21,8 +21,38 @@ secrets:
|
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
23
|
ML Claw runs OpenClaw in a Hugging Face Space with a browser gateway protected
|
|
24
|
-
by Hugging Face OAuth.
|
|
25
|
-
|
|
24
|
+
by Hugging Face OAuth.
|
|
25
|
+
|
|
26
|
+
Do not set up ML Claw by only clicking Duplicate. Run the local bootstrapper
|
|
27
|
+
instead. It creates the private Space, private Storage Bucket, OAuth settings,
|
|
28
|
+
secrets, model configuration, and local manifest for you.
|
|
29
|
+
|
|
30
|
+
With Node.js:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx mlclaw bootstrap --name mlclaw
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
On macOS or Linux without Node.js:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bash <(curl -fsSL https://raw.githubusercontent.com/osolmaz/mlclaw/main/mlclaw.sh) --name mlclaw
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
On Windows PowerShell:
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
irm https://raw.githubusercontent.com/osolmaz/mlclaw/main/mlclaw.ps1 | iex
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
After the command finishes, open the Space it created and sign in with your
|
|
49
|
+
Hugging Face account.
|
|
50
|
+
|
|
51
|
+
After sign-in, use `/mlclaw` for settings, status, credentials, and sign out.
|
|
52
|
+
The OpenClaw gateway also shows a small ML Claw control link.
|
|
53
|
+
|
|
54
|
+
Duplicating this Space manually is only useful for development or for people
|
|
55
|
+
who already know how to configure the required secrets and variables.
|
|
26
56
|
|
|
27
57
|
The public Space process is an ML Claw proxy. It authenticates the signed-in
|
|
28
58
|
Hugging Face user, then forwards browser traffic to OpenClaw on loopback using
|
package/tsconfig.json
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
"target": "ES2023",
|
|
4
4
|
"module": "NodeNext",
|
|
5
5
|
"moduleResolution": "NodeNext",
|
|
6
|
-
"lib": ["ES2023"],
|
|
6
|
+
"lib": ["ES2023", "DOM"],
|
|
7
7
|
"types": ["node"],
|
|
8
|
+
"jsx": "react-jsx",
|
|
8
9
|
"strict": true,
|
|
9
10
|
"noUncheckedIndexedAccess": true,
|
|
10
11
|
"exactOptionalPropertyTypes": true,
|
|
@@ -12,5 +13,5 @@
|
|
|
12
13
|
"noEmit": true,
|
|
13
14
|
"skipLibCheck": true
|
|
14
15
|
},
|
|
15
|
-
"include": ["src/**/*.ts", "test/**/*.ts"]
|
|
16
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "test/**/*.ts", "vite.control-ui.config.ts"]
|
|
16
17
|
}
|