opencode-skills-antigravity 1.0.39 → 1.0.41

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 (91) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +10 -1
  2. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  3. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  4. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  5. package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.csv +34 -0
  6. package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.md +2 -0
  7. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  8. package/bundled-skills/docs/sources/sources.md +2 -2
  9. package/bundled-skills/docs/users/bundles.md +1 -1
  10. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  11. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  12. package/bundled-skills/docs/users/getting-started.md +1 -1
  13. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  14. package/bundled-skills/docs/users/usage.md +4 -4
  15. package/bundled-skills/docs/users/visual-guide.md +4 -4
  16. package/bundled-skills/hugging-face-cli/SKILL.md +192 -195
  17. package/bundled-skills/hugging-face-community-evals/SKILL.md +213 -0
  18. package/bundled-skills/hugging-face-community-evals/examples/.env.example +3 -0
  19. package/bundled-skills/hugging-face-community-evals/examples/USAGE_EXAMPLES.md +101 -0
  20. package/bundled-skills/hugging-face-community-evals/scripts/inspect_eval_uv.py +104 -0
  21. package/bundled-skills/hugging-face-community-evals/scripts/inspect_vllm_uv.py +306 -0
  22. package/bundled-skills/hugging-face-community-evals/scripts/lighteval_vllm_uv.py +297 -0
  23. package/bundled-skills/hugging-face-dataset-viewer/SKILL.md +120 -120
  24. package/bundled-skills/hugging-face-gradio/SKILL.md +304 -0
  25. package/bundled-skills/hugging-face-gradio/examples.md +613 -0
  26. package/bundled-skills/hugging-face-jobs/SKILL.md +25 -18
  27. package/bundled-skills/hugging-face-jobs/index.html +216 -0
  28. package/bundled-skills/hugging-face-jobs/references/hardware_guide.md +336 -0
  29. package/bundled-skills/hugging-face-jobs/references/hub_saving.md +352 -0
  30. package/bundled-skills/hugging-face-jobs/references/token_usage.md +570 -0
  31. package/bundled-skills/hugging-face-jobs/references/troubleshooting.md +475 -0
  32. package/bundled-skills/hugging-face-jobs/scripts/cot-self-instruct.py +718 -0
  33. package/bundled-skills/hugging-face-jobs/scripts/finepdfs-stats.py +546 -0
  34. package/bundled-skills/hugging-face-jobs/scripts/generate-responses.py +587 -0
  35. package/bundled-skills/hugging-face-model-trainer/SKILL.md +11 -12
  36. package/bundled-skills/hugging-face-model-trainer/references/gguf_conversion.md +296 -0
  37. package/bundled-skills/hugging-face-model-trainer/references/hardware_guide.md +283 -0
  38. package/bundled-skills/hugging-face-model-trainer/references/hub_saving.md +364 -0
  39. package/bundled-skills/hugging-face-model-trainer/references/local_training_macos.md +231 -0
  40. package/bundled-skills/hugging-face-model-trainer/references/reliability_principles.md +371 -0
  41. package/bundled-skills/hugging-face-model-trainer/references/trackio_guide.md +189 -0
  42. package/bundled-skills/hugging-face-model-trainer/references/training_methods.md +150 -0
  43. package/bundled-skills/hugging-face-model-trainer/references/training_patterns.md +203 -0
  44. package/bundled-skills/hugging-face-model-trainer/references/troubleshooting.md +282 -0
  45. package/bundled-skills/hugging-face-model-trainer/references/unsloth.md +313 -0
  46. package/bundled-skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +424 -0
  47. package/bundled-skills/hugging-face-model-trainer/scripts/dataset_inspector.py +417 -0
  48. package/bundled-skills/hugging-face-model-trainer/scripts/estimate_cost.py +150 -0
  49. package/bundled-skills/hugging-face-model-trainer/scripts/train_dpo_example.py +106 -0
  50. package/bundled-skills/hugging-face-model-trainer/scripts/train_grpo_example.py +89 -0
  51. package/bundled-skills/hugging-face-model-trainer/scripts/train_sft_example.py +122 -0
  52. package/bundled-skills/hugging-face-model-trainer/scripts/unsloth_sft_example.py +512 -0
  53. package/bundled-skills/hugging-face-paper-publisher/SKILL.md +11 -4
  54. package/bundled-skills/hugging-face-paper-publisher/examples/example_usage.md +326 -0
  55. package/bundled-skills/hugging-face-paper-publisher/references/quick_reference.md +216 -0
  56. package/bundled-skills/hugging-face-paper-publisher/scripts/paper_manager.py +606 -0
  57. package/bundled-skills/hugging-face-paper-publisher/templates/arxiv.md +299 -0
  58. package/bundled-skills/hugging-face-paper-publisher/templates/ml-report.md +358 -0
  59. package/bundled-skills/hugging-face-paper-publisher/templates/modern.md +319 -0
  60. package/bundled-skills/hugging-face-paper-publisher/templates/standard.md +201 -0
  61. package/bundled-skills/hugging-face-papers/SKILL.md +241 -0
  62. package/bundled-skills/hugging-face-trackio/.claude-plugin/plugin.json +19 -0
  63. package/bundled-skills/hugging-face-trackio/SKILL.md +117 -0
  64. package/bundled-skills/hugging-face-trackio/references/alerts.md +196 -0
  65. package/bundled-skills/hugging-face-trackio/references/logging_metrics.md +206 -0
  66. package/bundled-skills/hugging-face-trackio/references/retrieving_metrics.md +251 -0
  67. package/bundled-skills/hugging-face-vision-trainer/SKILL.md +595 -0
  68. package/bundled-skills/hugging-face-vision-trainer/references/finetune_sam2_trainer.md +254 -0
  69. package/bundled-skills/hugging-face-vision-trainer/references/hub_saving.md +618 -0
  70. package/bundled-skills/hugging-face-vision-trainer/references/image_classification_training_notebook.md +279 -0
  71. package/bundled-skills/hugging-face-vision-trainer/references/object_detection_training_notebook.md +700 -0
  72. package/bundled-skills/hugging-face-vision-trainer/references/reliability_principles.md +310 -0
  73. package/bundled-skills/hugging-face-vision-trainer/references/timm_trainer.md +91 -0
  74. package/bundled-skills/hugging-face-vision-trainer/scripts/dataset_inspector.py +814 -0
  75. package/bundled-skills/hugging-face-vision-trainer/scripts/estimate_cost.py +217 -0
  76. package/bundled-skills/hugging-face-vision-trainer/scripts/image_classification_training.py +383 -0
  77. package/bundled-skills/hugging-face-vision-trainer/scripts/object_detection_training.py +710 -0
  78. package/bundled-skills/hugging-face-vision-trainer/scripts/sam_segmentation_training.py +382 -0
  79. package/bundled-skills/jq/SKILL.md +273 -0
  80. package/bundled-skills/odoo-edi-connector/SKILL.md +32 -10
  81. package/bundled-skills/odoo-woocommerce-bridge/SKILL.md +9 -5
  82. package/bundled-skills/tmux/SKILL.md +370 -0
  83. package/bundled-skills/transformers-js/SKILL.md +639 -0
  84. package/bundled-skills/transformers-js/references/CACHE.md +339 -0
  85. package/bundled-skills/transformers-js/references/CONFIGURATION.md +390 -0
  86. package/bundled-skills/transformers-js/references/EXAMPLES.md +605 -0
  87. package/bundled-skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
  88. package/bundled-skills/transformers-js/references/PIPELINE_OPTIONS.md +545 -0
  89. package/bundled-skills/transformers-js/references/TEXT_GENERATION.md +315 -0
  90. package/bundled-skills/viboscope/SKILL.md +64 -0
  91. package/package.json +1 -1
@@ -0,0 +1,339 @@
1
+ # Caching Reference
2
+
3
+ Complete guide to caching strategies for Transformers.js models across different environments.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Overview](#overview)
8
+ 2. [Browser Caching](#browser-caching)
9
+ 3. [Node.js Caching](#nodejs-caching)
10
+ 4. [Custom Cache Implementation](#custom-cache-implementation)
11
+ 5. [Cache Configuration](#cache-configuration)
12
+
13
+ ## Overview
14
+
15
+ Transformers.js models can be large (from a few MB to several GB), so caching is critical for performance. The caching strategy differs based on the environment:
16
+
17
+ - **Browser**: Uses the Cache API (browser cache storage)
18
+ - **Node.js**: Uses filesystem cache in `~/.cache/huggingface/`
19
+ - **Custom**: Implement your own cache (database, cloud storage, etc.)
20
+
21
+ ### Default Behavior
22
+
23
+ ```javascript
24
+ import { pipeline } from '@huggingface/transformers';
25
+
26
+ // First load: downloads model
27
+ const pipe = await pipeline('sentiment-analysis');
28
+
29
+ // Subsequent loads: uses cached model
30
+ const pipe2 = await pipeline('sentiment-analysis'); // Fast!
31
+ ```
32
+
33
+ Caching is **automatic** and enabled by default. Models are cached after the first download.
34
+
35
+ ## Browser Caching
36
+
37
+ ### Using the Cache API
38
+
39
+ In browser environments, Transformers.js uses the [Cache API](https://developer.mozilla.org/en-US/docs/Web/API/Cache) to store models:
40
+
41
+ ```javascript
42
+ import { env, pipeline } from '@huggingface/transformers';
43
+
44
+ // Browser cache is enabled by default
45
+ console.log(env.useBrowserCache); // true
46
+
47
+ // Load model (cached automatically)
48
+ const classifier = await pipeline('sentiment-analysis');
49
+ ```
50
+
51
+ **How it works:**
52
+
53
+ 1. Model files are downloaded from Hugging Face Hub
54
+ 2. Files are stored in the browser's Cache Storage
55
+ 3. Subsequent loads retrieve from cache (no network request)
56
+ 4. Cache persists across page reloads and browser sessions
57
+
58
+ ### Cache Location
59
+
60
+ Browser caches are stored in:
61
+ - **Chrome/Edge**: `Cache Storage` in DevTools → Application tab → Cache storage
62
+ - **Firefox**: `about:cache` → Storage
63
+ - **Safari**: Web Inspector → Storage tab
64
+
65
+ ### Disable Browser Cache
66
+
67
+ ```javascript
68
+ import { env } from '@huggingface/transformers';
69
+
70
+ // Disable browser caching (not recommended)
71
+ env.useBrowserCache = false;
72
+
73
+ // Models will be re-downloaded on every page load
74
+ ```
75
+
76
+ **Use case:** Testing, development, or debugging cache issues.
77
+
78
+ ### Browser Storage Limits
79
+
80
+ Browsers impose storage quotas:
81
+
82
+ - **Chrome**: ~60% of available disk space (but can evict data)
83
+ - **Firefox**: ~50% of available disk space
84
+ - **Safari**: ~1GB per origin (prompt for more)
85
+
86
+ **Tip:** Monitor storage usage with the [Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Storage_API):
87
+
88
+ ```javascript
89
+ if ('storage' in navigator && 'estimate' in navigator.storage) {
90
+ const estimate = await navigator.storage.estimate();
91
+ const percentUsed = (estimate.usage / estimate.quota) * 100;
92
+ console.log(`Storage: ${percentUsed.toFixed(2)}% used`);
93
+ console.log(`Available: ${((estimate.quota - estimate.usage) / 1024 / 1024).toFixed(2)} MB`);
94
+ }
95
+ ```
96
+
97
+ ## Node.js Caching
98
+
99
+ ### Filesystem Cache
100
+
101
+ In Node.js, models are cached to the filesystem:
102
+
103
+ ```javascript
104
+ import { env, pipeline } from '@huggingface/transformers';
105
+
106
+ // Default cache directory (Node.js)
107
+ console.log(env.cacheDir); // './.cache' (relative to current directory)
108
+
109
+ // Filesystem cache is enabled by default
110
+ console.log(env.useFSCache); // true
111
+
112
+ // Load model (cached to disk)
113
+ const classifier = await pipeline('sentiment-analysis');
114
+ ```
115
+
116
+ ### Default Cache Location
117
+
118
+ **Default behavior:**
119
+ - Cache directory: `./.cache` (relative to where Node.js process runs)
120
+ - Full default path: `~/.cache/huggingface/` when using Hugging Face tools
121
+
122
+ **Note:** The statement "Models are cached automatically in `~/.cache/huggingface/`" from performance tips is specific to Hugging Face's Python tooling convention. In Transformers.js for Node.js, the default is `./.cache` unless configured otherwise.
123
+
124
+ ### Custom Cache Directory
125
+
126
+ ```javascript
127
+ import { env, pipeline } from '@huggingface/transformers';
128
+
129
+ // Set custom cache directory
130
+ env.cacheDir = '/var/cache/transformers';
131
+
132
+ // Or use environment variable (Node.js convention)
133
+ env.cacheDir = process.env.HF_HOME || '~/.cache/huggingface';
134
+
135
+ // Now load model
136
+ const classifier = await pipeline('sentiment-analysis');
137
+ // Cached to: /var/cache/transformers/models--Xenova--distilbert-base-uncased-finetuned-sst-2-english/
138
+ ```
139
+
140
+ **Pattern:** `models--{organization}--{model-name}/`
141
+
142
+ ### Disable Filesystem Cache
143
+
144
+ ```javascript
145
+ import { env } from '@huggingface/transformers';
146
+
147
+ // Disable filesystem caching (not recommended)
148
+ env.useFSCache = false;
149
+
150
+ // Models will be re-downloaded on every load
151
+ ```
152
+
153
+ **Use case:** Testing, CI/CD environments, or containers with ephemeral storage.
154
+
155
+ ## Custom Cache Implementation
156
+
157
+ Implement your own cache for specialized storage backends.
158
+
159
+ ### Custom Cache Interface
160
+
161
+ ```typescript
162
+ interface CacheInterface {
163
+ /**
164
+ * Check if a URL is cached
165
+ */
166
+ match(url: string): Promise<Response | undefined>;
167
+
168
+ /**
169
+ * Store a URL and its response
170
+ */
171
+ put(url: string, response: Response): Promise<void>;
172
+ }
173
+ ```
174
+
175
+ ### Example: Cloud Storage Cache (S3)
176
+
177
+ ```javascript
178
+ import { env, pipeline } from '@huggingface/transformers';
179
+ import { S3Client, GetObjectCommand, PutObjectCommand } from '@aws-sdk/client-s3';
180
+ import { Readable } from 'stream';
181
+
182
+ class S3Cache {
183
+ constructor(bucket, region = 'us-east-1') {
184
+ this.bucket = bucket;
185
+ this.s3 = new S3Client({ region });
186
+ }
187
+
188
+ async match(url) {
189
+ const key = this.urlToKey(url);
190
+
191
+ try {
192
+ const command = new GetObjectCommand({
193
+ Bucket: this.bucket,
194
+ Key: key
195
+ });
196
+ const response = await this.s3.send(command);
197
+
198
+ // Convert stream to buffer
199
+ const chunks = [];
200
+ for await (const chunk of response.Body) {
201
+ chunks.push(chunk);
202
+ }
203
+ const body = Buffer.concat(chunks);
204
+
205
+ return new Response(body, {
206
+ status: 200,
207
+ headers: JSON.parse(response.Metadata.headers || '{}')
208
+ });
209
+ } catch (error) {
210
+ if (error.name === 'NoSuchKey') return undefined;
211
+ throw error;
212
+ }
213
+ }
214
+
215
+ async put(url, response) {
216
+ const key = this.urlToKey(url);
217
+ const clonedResponse = response.clone();
218
+ const body = Buffer.from(await clonedResponse.arrayBuffer());
219
+ const headers = JSON.stringify(Object.fromEntries(response.headers.entries()));
220
+
221
+ const command = new PutObjectCommand({
222
+ Bucket: this.bucket,
223
+ Key: key,
224
+ Body: body,
225
+ Metadata: { headers }
226
+ });
227
+
228
+ await this.s3.send(command);
229
+ }
230
+
231
+ urlToKey(url) {
232
+ // Convert URL to S3 key (remove protocol, replace slashes)
233
+ return url.replace(/^https?:\/\//, '').replace(/\//g, '_');
234
+ }
235
+ }
236
+
237
+ // Configure S3 cache
238
+ env.useCustomCache = true;
239
+ env.customCache = new S3Cache('my-transformers-cache', 'us-east-1');
240
+ env.useFSCache = false;
241
+
242
+ // Use S3 cache
243
+ const classifier = await pipeline('sentiment-analysis');
244
+ ```
245
+
246
+ ## Cache Configuration
247
+
248
+ ### Environment Variables
249
+
250
+ Use environment variables to configure caching:
251
+
252
+ ```javascript
253
+ import { env } from '@huggingface/transformers';
254
+
255
+ // Configure cache directory from environment
256
+ env.cacheDir = process.env.TRANSFORMERS_CACHE || './.cache';
257
+
258
+ // Disable caching in CI/CD
259
+ if (process.env.CI === 'true') {
260
+ env.useFSCache = false;
261
+ env.useBrowserCache = false;
262
+ }
263
+
264
+ // Production: use pre-cached models
265
+ if (process.env.NODE_ENV === 'production') {
266
+ env.allowRemoteModels = false;
267
+ env.allowLocalModels = true;
268
+ env.localModelPath = process.env.MODEL_PATH || '/app/models';
269
+ }
270
+ ```
271
+
272
+ ### Configuration Patterns
273
+
274
+ #### Development: Enable All Caching
275
+
276
+ ```javascript
277
+ import { env } from '@huggingface/transformers';
278
+
279
+ env.allowRemoteModels = true;
280
+ env.useFSCache = true; // Node.js
281
+ env.useBrowserCache = true; // Browser
282
+ env.cacheDir = './.cache';
283
+ ```
284
+
285
+ #### Production: Local Models Only
286
+
287
+ ```javascript
288
+ import { env } from '@huggingface/transformers';
289
+
290
+ env.allowRemoteModels = false;
291
+ env.allowLocalModels = true;
292
+ env.localModelPath = '/app/models';
293
+ env.useFSCache = true;
294
+ ```
295
+
296
+ #### Testing: Disable Caching
297
+
298
+ ```javascript
299
+ import { env } from '@huggingface/transformers';
300
+
301
+ env.useFSCache = false;
302
+ env.useBrowserCache = false;
303
+ env.allowRemoteModels = true; // Download every time
304
+ ```
305
+
306
+ #### Hybrid: Cache + Remote Fallback
307
+
308
+ ```javascript
309
+ import { env } from '@huggingface/transformers';
310
+
311
+ // Try local cache first, fall back to remote
312
+ env.allowRemoteModels = true;
313
+ env.allowLocalModels = true;
314
+ env.useFSCache = true;
315
+ env.localModelPath = './models';
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Summary
321
+
322
+ Transformers.js provides flexible caching options:
323
+
324
+ - **Browser**: Cache API (automatic, persistent)
325
+ - **Node.js**: Filesystem cache (default `./.cache`, configurable)
326
+ - **Custom**: Implement your own (database, cloud storage, etc.)
327
+
328
+ **Key takeaways:**
329
+
330
+ 1. Caching is enabled by default and automatic
331
+ 2. Configure cache **before** loading models
332
+ 3. Browser uses Cache API, Node.js uses filesystem
333
+ 4. Custom caches enable advanced storage backends
334
+ 5. Monitor cache size and implement cleanup strategies
335
+ 6. Pre-download models for production deployments
336
+
337
+ For more configuration options, see:
338
+ - [Configuration Reference](./CONFIGURATION.md)
339
+ - [Pipeline Options](./PIPELINE_OPTIONS.md)