State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
This report summarizes scanner evidence for huggingface/transformers.js, a JavaScript project with 16,390 GitHub stars. SynthScan examined 77,416 lines of code across 710 source files, recording 93 pattern matches distributed across 9 syntactic categories. The legacy adjusted pattern signal is 2.1 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 90 finding(s).
Are imports declared and package/API names verified? 0 finding(s).
Are wrappers, guards, and repeated structures necessary? 11 finding(s).
Which changes need focused human review? 93 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 93 distinct pattern matches across 9 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 411 | // Step 1: Pre-cache config.json by downloading it | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 414 | // Step 2: Clear the cache | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 417 | // Step 3: Verify response shape | COMMENT |
| LOW | packages/transformers/tests/utils/cache.test.js | 433 | // Step 4: config.json should have been cached and deleted | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 452 | // Step 1: Pre-cache config.json by downloading it | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 455 | // Step 2: Clear the pipeline cache | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 458 | // Step 3: Verify response shape | COMMENT |
| LOW | packages/transformers/tests/utils/cache.test.js | 471 | // Step 4: Should include expected pipeline files | COMMENT |
| LOW | packages/transformers/docs/source/guides/private.md | 9 | ## Step 1: Generating a User Access Token | COMMENT |
| LOW | packages/transformers/docs/source/guides/private.md | 22 | ## Step 2: Using the access token in Transformers.js | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 17 | ## Step 1: Create the project | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 32 | ## Step 2: Configure Next.js for browser inference | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 55 | ## Step 3: Create the Web Worker | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 72 | ## Step 4: Define the model configuration | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 109 | ## Step 5: Define tools | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 166 | ## Step 6: Create the chat transport | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 288 | ## Step 7: Build the chat UI | COMMENT |
| LOW | …ages/transformers/docs/source/tutorials/next-ai-sdk.md | 420 | ## Step 8: Run the application | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/next.md | 21 | ### Step 1: Initialise the project | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/next.md | 40 | ### Step 2: Install and configure Transformers.js | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/next.md | 115 | ### Step 3: Design the user interface | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/next.md | 239 | ### Step 1: Initialise the project | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/next.md | 258 | ### Step 2: Install and configure Transformers.js | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/next.md | 351 | ### Step 3: Design the user interface | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/react.md | 17 | ## Step 1: Initialize the project | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/react.md | 43 | ## Step 2: Install and configure Transformers.js | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/react.md | 114 | ## Step 3: Design the user interface | COMMENT |
| LOW | packages/transformers/docs/source/tutorials/react.md | 405 | ## Step 4: Connecting everything together | COMMENT |
| LOW | …kages/transformers/docs/source/tutorials/vanilla-js.md | 14 | ## Step 1: HTML and CSS setup | COMMENT |
| LOW | …kages/transformers/docs/source/tutorials/vanilla-js.md | 92 | ## Step 2: JavaScript setup | COMMENT |
| LOW | …kages/transformers/docs/source/tutorials/vanilla-js.md | 129 | ## Step 3: Create an object detection pipeline | COMMENT |
| LOW | …kages/transformers/docs/source/tutorials/vanilla-js.md | 163 | ## Step 4: Create the image uploader | COMMENT |
| LOW | …kages/transformers/docs/source/tutorials/vanilla-js.md | 194 | ## Step 5: Run the model | COMMENT |
| LOW | …kages/transformers/docs/source/tutorials/vanilla-js.md | 230 | ## Step 6: Render the boxes | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | README.md | 184 | | [Zero-Shot Classification](https://huggingface.co/tasks/zero-shot-classification) | `zero-shot-classification` | Clas | CODE |
| MEDIUM⚡ | README.md | 228 | | [Zero-Shot Audio Classification](https://huggingface.co/learn/audio-course/chapter4/classification_models#zero-shot-au | CODE |
| MEDIUM⚡ | README.md | 229 | | [Zero-Shot Image Classification](https://huggingface.co/tasks/zero-shot-image-classification) | `zero-shot-image-class | CODE |
| MEDIUM⚡ | README.md | 230 | | [Zero-Shot Object Detection](https://huggingface.co/tasks/zero-shot-object-detection) | `zero-shot-object-detection` | CODE |
| MEDIUM | packages/transformers/src/tokenization_utils.js | 227 | * See the [RAG section](https://huggingface.co/docs/transformers/main/en/chat_templating#arguments-for-RAG) of the chat | COMMENT |
| MEDIUM⚡ | .ai/skills/transformers-js/SKILL.md | 46 | - [`zero-shot-classification`](references/TASKS.md#zero-shot-classification) — default model: `Xenova/distilbert-base-un | CODE |
| MEDIUM⚡ | .ai/skills/transformers-js/SKILL.md | 48 | - [`zero-shot-audio-classification`](references/TASKS.md#zero-shot-audio-classification) — default model: `Xenova/clap-h | CODE |
| MEDIUM⚡ | .ai/skills/transformers-js/SKILL.md | 55 | - [`zero-shot-image-classification`](references/TASKS.md#zero-shot-image-classification) — default model: `Xenova/clip-v | CODE |
| MEDIUM⚡ | .ai/skills/transformers-js/SKILL.md | 57 | - [`zero-shot-object-detection`](references/TASKS.md#zero-shot-object-detection) — default model: `Xenova/owlvit-base-pa | CODE |
| MEDIUM⚡ | .ai/skills/transformers-js/references/TASKS.md | 10 | **Audio** — [`audio-classification`](#audio-classification) · [`zero-shot-audio-classification`](#zero-shot-audio-classi | CODE |
| MEDIUM⚡ | .ai/skills/transformers-js/references/TASKS.md | 12 | **Vision** — [`image-to-text`](#image-to-text) · [`image-classification`](#image-classification) · [`image-segmentation` | CODE |
| MEDIUM⚡ | .ai/skills/transformers-js/references/TASKS.md | 14 | **Text** — [`text-classification`](#text-classification) · [`token-classification`](#token-classification) · [`question- | CODE |
| MEDIUM | .ai/skills/transformers-js/references/TASKS.md | 55 | ### `zero-shot-audio-classification` | COMMENT |
| MEDIUM | .ai/skills/transformers-js/references/TASKS.md | 313 | ### `zero-shot-image-classification` | COMMENT |
| MEDIUM | .ai/skills/transformers-js/references/TASKS.md | 361 | ### `zero-shot-object-detection` | COMMENT |
| MEDIUM | .ai/skills/transformers-js/references/TASKS.md | 843 | ### `zero-shot-classification` | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …ers/tests/pipelines/test_pipelines_object_detection.js | 101 | { score: 0.020360343158245087, label: "LABEL_31", box: { xmin: 56, ymin: 55, xmax: 169, ymax: 167 } }, | COMMENT |
| LOW | …mers/tests/pipelines/test_pipelines_text_generation.js | 121 | }, | COMMENT |
| LOW | …ncoder_decoder/test_modeling_vision_encoder_decoder.js | 21 | }); | COMMENT |
| LOW | …ers/tests/models/florence2/test_processor_florence2.js | 161 | }, | COMMENT |
| LOW | …ers/tests/models/florence2/test_processor_florence2.js | 181 | // target: { | COMMENT |
| LOW | packages/transformers/src/utils/audio.js | 41 | let audio; | COMMENT |
| LOW | packages/transformers/src/utils/cache/FileCache.js | 121 | } | COMMENT |
| LOW | packages/transformers/src/models/modeling_utils.js | 421 | // if (generation_config.encoder_repetition_penalty !== null && generation_config.encoder_repetition_penalty !== | COMMENT |
| LOW | packages/transformers/src/models/modeling_utils.js | 901 | COMMENT | |
| LOW | packages/transformers/src/models/modeling_utils.js | 1621 | const { input_ids, attention_mask } = model_inputs; | COMMENT |
| LOW | …ransformers/src/models/whisper/tokenization_whisper.js | 361 | for (let i = 1; i < sequences.length; ++i) { | COMMENT |
| LOW | packages/transformers/src/generation/logits_process.js | 101 | } | COMMENT |
| LOW | packages/transformers/src/generation/logits_process.js | 121 | // * | COMMENT |
| LOW | .ai/skills/transformers-js/references/TASKS.md | 101 | // { | COMMENT |
| LOW | .ai/skills/transformers-js/references/TASKS.md | 341 | **Example:** Run object-detection with `Xenova/detr-resnet-50`. | COMMENT |
| LOW | .ai/skills/transformers-js/references/TASKS.md | 381 | // }, | COMMENT |
| LOW | .ai/skills/transformers-js/references/TASKS.md | 401 | ```javascript | COMMENT |
| LOW | .ai/skills/transformers-js/references/TASKS.md | 481 | COMMENT | |
| LOW | .ai/skills/transformers-js/references/TASKS.md | 601 | const output = await classifier('My name is Sarah and I live in London'); | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 411 | // Step 1: Pre-cache config.json by downloading it | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 414 | // Step 2: Clear the cache | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 417 | // Step 3: Verify response shape | COMMENT |
| LOW | packages/transformers/tests/utils/cache.test.js | 433 | // Step 4: config.json should have been cached and deleted | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 452 | // Step 1: Pre-cache config.json by downloading it | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 455 | // Step 2: Clear the pipeline cache | COMMENT |
| LOW⚡ | packages/transformers/tests/utils/cache.test.js | 458 | // Step 3: Verify response shape | COMMENT |
| LOW | packages/transformers/tests/utils/cache.test.js | 471 | // Step 4: Should include expected pipeline files | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …/transformers/src/models/pyannote/modeling_pyannote.js | 51 | * // ┌─────────┬────────────────────┬────────────────────┬────┬─────────────────────┐ | COMMENT |
| MEDIUM | …/transformers/src/models/pyannote/modeling_pyannote.js | 53 | * // ├─────────┼────────────────────┼────────────────────┼────┼─────────────────────┤ | COMMENT |
| MEDIUM | …/transformers/src/models/pyannote/modeling_pyannote.js | 65 | * // └─────────┴────────────────────┴────────────────────┴────┴─────────────────────┘ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …ers-structured-output/src/StructuredOutputProcessor.ts | 87 | function discourageRepeatedWhitespace(logits: Tensor, tokenIds: readonly number[], count: number): void { | CODE |
| LOW | …ages/transformers-structured-output/src/engine/json.ts | 523 | function computeIntegerRestriction(schema: Record<string, unknown>): { lo: number; hi: number } | null { | CODE |
| LOW | …ages/transformers-structured-output/src/engine/json.ts | 747 | function selectedConditionalBranch( | CODE |
| LOW | packages/transformers/tests/progress_callbacks.test.js | 64 | function expectValidEventLifecycle(events, model_id, expectedFiles) { | CODE |
| LOW | packages/transformers/tests/utils/audio.test.js | 40 | function generateDeterministicWaveform(length) { | CODE |
| LOW | packages/transformers/src/backends/onnx.js | 165 | export function deviceToExecutionProviders(device = null) { | CODE |
| LOW | packages/transformers/src/utils/model-loader.js | 11 | export function resolveExternalDataFormat(config, fullName, fileName) { | CODE |
| LOW | packages/transformers/src/utils/model-loader.js | 27 | export function getExternalDataChunkNames(fullName, numChunks) { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | packages/transformers/tests/tokenizers.test.js | 694 | // TODO: Add test for token_ids once bug in transformers is fixed. | COMMENT |
| LOW | packages/transformers/src/utils/tensor.js | 517 | // TODO: implement transpose. For now (backwards compatibility), it's just an alias for permute() | COMMENT |
| LOW | …ransformers/src/models/whisper/tokenization_whisper.js | 523 | // TODO: implement offsets | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | packages/transformers/src/utils/audio.js | 56 | // to create a single mono channel. It's worth noting that this scaling factor is | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | packages/transformers/tests/tokenizers.test.js | 641 | expect(prompt).toEqual('<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|># Safety Preamble\nThe instructions in t | CODE |