all-the-public-replicate-models 1.41.0 → 1.43.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.
Files changed (3) hide show
  1. package/README.md +40 -1
  2. package/cli.js +5 -0
  3. package/package.json +6 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@ Metadata for all the public models on Replicate, bundled up into an npm package.
8
8
  npm install all-the-public-replicate-models
9
9
  ```
10
10
 
11
- ## Usage
11
+ ## Usage (as a library)
12
12
 
13
13
  Full-bodied usage (all the metadata, ~17MB)
14
14
 
@@ -35,3 +35,42 @@ import {chain} from 'lodash-es'
35
35
  const mostRun = chain(models).orderBy('run_count', 'desc').take(10).value()
36
36
  console.log({mostRun})
37
37
  ```
38
+
39
+ ## Usage (as a CLI)
40
+
41
+ The CLI dumps the model metadata to standard output as a big JSON object:
42
+
43
+ ```command
44
+ $ npx all-the-public-replicate-models
45
+ ```
46
+
47
+ The output will be:
48
+
49
+ ```
50
+ [
51
+ {...},
52
+ {...},
53
+ {...},
54
+ ]
55
+ ```
56
+
57
+ You can use [jq](https://stedolan.github.io/jq/) to filter the output. Here's an example that finds all the whisper models and sorts them by run count:
58
+
59
+ ```command
60
+ npx all-the-public-replicate-models | jq -r 'map(select(.name | contains("whisper"))) | sort_by(.run_count) | reverse | .[] | "\(.url) \(.run_count)"'
61
+ ```
62
+
63
+ - https://replicate.com/openai/whisper 3790120
64
+ - https://replicate.com/m1guelpf/whisper-subtitles 38020
65
+ - https://replicate.com/hnesk/whisper-wordtimestamps 28889
66
+ - https://replicate.com/alqasemy2020/whisper-jax 20296
67
+ - https://replicate.com/wglodell/cog-whisperx-withprompt 19326
68
+ - https://replicate.com/daanelson/whisperx 15528
69
+ ...
70
+
71
+
72
+ Or you can dump all the model data to a file:
73
+
74
+ ```command
75
+ npx all-the-public-replicate-models > models.json
76
+ ```
package/cli.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import models from './index.mjs';
4
+
5
+ process.stdout.write(JSON.stringify(models, null, 2));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "all-the-public-replicate-models",
3
3
  "description": "Metadata for all the public models on Replicate, bundled up into an npm package",
4
- "version": "1.41.0",
4
+ "version": "1.43.0",
5
5
  "devDependencies": {
6
6
  "chai": "^4.3.10",
7
7
  "lodash-es": "^4.17.21",
@@ -20,5 +20,10 @@
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=18"
23
+ },
24
+ "bin": {
25
+ "all-the-public-replicate-models": "cli.js",
26
+ "all-the-replicate-models": "cli.js",
27
+ "replicate-models": "cli.js"
23
28
  }
24
29
  }