Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
1f1c645
Move adaptive retrieval demo
xenova Dec 23, 2024
363aefa
Move code completion demo
xenova Dec 23, 2024
6c96600
Move florence-2 demo
xenova Dec 23, 2024
c4b3a76
Move depth anything demo
xenova Dec 23, 2024
29bdc5b
Move tokenizer playground demo
xenova Dec 23, 2024
98958ff
Move node audio processing demo
xenova Dec 23, 2024
ac5b758
Move remove background web demo
xenova Dec 23, 2024
b3ac89e
Move webgpu whisper demo
xenova Dec 23, 2024
48b46d6
Move depth estimation video demo
xenova Dec 23, 2024
a361b38
Move vanilla js demo
xenova Dec 23, 2024
1634399
Move node demo
xenova Dec 23, 2024
4f7b7f4
Move whisper word timestamps demo
xenova Dec 23, 2024
b0ac200
Move musicgen web demo
xenova Dec 23, 2024
4ccb405
Move cross encoder demo
xenova Dec 23, 2024
bc006e5
Move text-to-speech client demo
xenova Dec 23, 2024
7cdea27
Move video object detection demo
xenova Dec 23, 2024
b053db2
Move video background removal demo
xenova Dec 23, 2024
eacdbd1
Move Segment Anything demo
xenova Dec 23, 2024
e890716
Move zero-shot classification demo
xenova Dec 23, 2024
1ee3d46
Move browser extension template
xenova Dec 23, 2024
56297b0
Move semantic image search demo
xenova Dec 23, 2024
97a3c48
Move semantic audio search demo
xenova Dec 24, 2024
0bf2fec
Move webgpu embedding benchmark demo
xenova Jan 15, 2025
c033537
Merge branch 'main' into move-examples
xenova Apr 9, 2025
e20167a
Merge branch 'main' into move-examples
xenova Apr 16, 2025
c6b7edf
Upgrade to new WebGPU EP
xenova Jul 30, 2025
140f106
Merge branch 'main' into v4
xenova Jul 30, 2025
bf12225
Upgrade sharp version
xenova Jul 30, 2025
5e2c942
Bump versions
xenova Jul 30, 2025
9f9f6f2
Delete gh-pages.yml
xenova Jul 30, 2025
ee2f0b4
Move next-server and next-client examples
xenova Jul 30, 2025
c755653
Move react-translator demo
xenova Jul 30, 2025
3913313
Remove old demo site example
xenova Jul 30, 2025
08b3391
Move webgpu-chat demo to phi-3.5-webgpu
xenova Jul 30, 2025
5ecbb85
Remove old server-side semantic image search demo
xenova Jul 30, 2025
0cfda75
Move electron example app
xenova Jul 31, 2025
18d675f
Move webgpu clip demo app
xenova Jul 31, 2025
e8151c5
Replace webgpu-vlm demo
xenova Jul 31, 2025
64a0836
Folder no longer exists
xenova Jul 31, 2025
5979250
Remove examples table, replacing with link to new examples repo
xenova Jul 31, 2025
3204661
Rename files
xenova Jul 31, 2025
32017ae
Merge branch 'main' into move-examples
xenova Jul 31, 2025
a2b00c0
Merge branch 'move-examples' into v4
xenova Jul 31, 2025
0c76a03
Update .prettierrc
xenova Jul 31, 2025
05df971
Apply to js, mjs, and cjs
xenova Jul 31, 2025
2a32dc0
Format source code
xenova Jul 31, 2025
276f3e7
Update .prettierrc
xenova Jul 31, 2025
3c7cf47
Formatting
xenova Jul 31, 2025
3b4f4c4
Fix type issues
xenova Jul 31, 2025
f9ca642
Bump onnxruntime versions
xenova Aug 4, 2025
90dccb2
Bump onnxruntime versions
xenova Aug 11, 2025
9f20bd5
Bump versions again
xenova Aug 11, 2025
719a6f8
Bump versions again again
xenova Aug 19, 2025
129a2a2
Update versions
xenova Aug 23, 2025
e585ff9
Allow config to disable kv_cache inputs
xenova Aug 24, 2025
682772d
fix
xenova Aug 25, 2025
fd9f523
Bump onnxruntime versions
xenova Sep 2, 2025
56d59ab
Bump onnxruntime versions
xenova Sep 8, 2025
97e59ba
Merge branch 'main' into v4
xenova Sep 15, 2025
23e98d9
Fix typo
xenova Sep 19, 2025
4afdd4c
Improve typing for `TemplateProcessing` post processor
xenova Sep 24, 2025
da893aa
Update hub types
xenova Sep 24, 2025
0252d88
Update tokenizers
xenova Sep 29, 2025
3f30425
Add support for Chatterbox
xenova Oct 11, 2025
ec3d845
Fix types
xenova Oct 11, 2025
a5d6f0f
Support voice caching
xenova Oct 12, 2025
fc244df
Update GenerationFunctionParameters type
xenova Oct 12, 2025
e7fe55b
Use init chain instead of single wasmInitPromise
xenova Oct 12, 2025
abe14cd
Merge branch 'main' into v4
xenova Oct 19, 2025
2598fde
Split pipelines into separate files
xenova Oct 29, 2025
c1a1484
Formatting
xenova Oct 29, 2025
0b2ff3f
More formatting
xenova Oct 29, 2025
0ae4e7f
Update onnxruntime versions
xenova Nov 5, 2025
6c68428
Add support for mamba layers
xenova Nov 10, 2025
c2d92d5
Update DepthEstimationPipeline pipeline types and default
xenova Nov 10, 2025
e53841f
Update ImageFeatureExtractionPipeline types and default
xenova Nov 11, 2025
256b964
Update TextGenerationPipeline types and default
xenova Nov 11, 2025
59ef9a6
Add support for tokenizer encode kwargs in text-generation pipeline
xenova Nov 11, 2025
9556591
Update FeatureExtractionPipeline types and default
xenova Nov 11, 2025
117d2bb
Use maximum precision for image-feature-extraction pipeline
xenova Nov 11, 2025
4f1f920
Merge branch 'main' into v4
xenova Nov 14, 2025
e118639
Post-merge fix
xenova Nov 14, 2025
125a8fd
Formatting
xenova Nov 14, 2025
e47b59b
Merge branch 'main' into v4
xenova Nov 20, 2025
46c8320
Merge text-to-audio pipeline
xenova Nov 20, 2025
ad12891
Add import to sample code
xenova Nov 20, 2025
4770830
Bump versions
xenova Nov 22, 2025
7f04cd0
Ensure generation/parameters.js is treated as a module
xenova Nov 22, 2025
d4a2281
Fix backend loading path (#1464)
nico-martin Nov 23, 2025
bf73184
Merge branch 'v4' of https://github.com/huggingface/transformers.js i…
xenova Nov 23, 2025
b4040dd
Fix ts-ignore
xenova Nov 23, 2025
7b8a6f7
Formatting
xenova Nov 23, 2025
67ff765
Formatting
xenova Nov 23, 2025
1610ab1
Optimize blob and wav file saving
xenova Nov 24, 2025
41d618b
Fix type error
xenova Nov 25, 2025
11a6bfc
Add support for Apertus (#1465)
nico-martin Nov 27, 2025
497441f
Update TextToAudioPipeline types and default
xenova Dec 4, 2025
342853d
Make TextToAudioPipeline parameters optional
xenova Dec 4, 2025
98a5201
[v4] Fix various TypeScript errors (#1477)
nico-martin Dec 5, 2025
fe04d97
Merge branch 'v4' of https://github.com/huggingface/transformers.js i…
xenova Dec 5, 2025
47f2d77
Define TokenizersBackend
xenova Dec 7, 2025
e60e9da
Update FillMaskPipeline types and default
xenova Dec 7, 2025
8f50b04
Formatting
xenova Dec 7, 2025
91b44eb
Add support for Olmo3
xenova Dec 8, 2025
cb6c8b1
Add support for GPT OSS
xenova Dec 8, 2025
61f391f
[v4] suppress console.error while creating InferenceSession (#1468)
nico-martin Dec 9, 2025
45c83eb
Default logging logic improvements
xenova Dec 15, 2025
aab2326
Add support for Chatterbox Turbo
xenova Dec 15, 2025
0082c20
[v4] Cache wasm files to enable fully offline usage after initial loa…
nico-martin Dec 16, 2025
b4a44aa
Cache wasm file blob fix (#1489)
nico-martin Dec 21, 2025
760cc66
[v4] Switch build system to esbuild (#1466)
nico-martin Dec 23, 2025
e599470
[v4] Refactor models.js into separate per-model modeling files (#1498)
nico-martin Jan 13, 2026
698dbd2
Add support for HunYuanDenseV1
xenova Jan 14, 2026
66cf69c
[v4] Tokenizers.js migration (#1501)
xenova Jan 21, 2026
2ee1ed0
[v4] Add support for FalconH1 (#1502)
xenova Jan 21, 2026
3c64b72
[v4] Finalize pipeline types (#1505)
xenova Jan 23, 2026
4e1b4b6
[v4] Restructure repo to use pnpm workspaces (#1504)
nico-martin Jan 29, 2026
b9d0d4a
Merge branch 'main' into v4
xenova Jan 29, 2026
906c43f
Post-merge fixes
xenova Jan 29, 2026
49c378f
Formatting
xenova Jan 29, 2026
644376f
Remove duplicate pnpm versions
xenova Jan 29, 2026
6a38ad5
Set ONNXRUNTIME_NODE_INSTALL env var in actions
xenova Jan 29, 2026
87f5682
Use inline ONNXRUNTIME_NODE_INSTALL for PR workflows
xenova Jan 29, 2026
3ae83a8
Set padding_side if set in tokenizer config
xenova Jan 29, 2026
841401d
Bump tokenizers.js to v0.1.1
xenova Jan 30, 2026
34f7777
Add support for Youtu-LLM
xenova Jan 30, 2026
c4d35bb
Add support for LFM2-MoE
xenova Feb 1, 2026
7a03906
Bump jinja.js
xenova Feb 2, 2026
a856d55
docs: add Vercel AI SDK integration with browser-ai/transformers-js p…
jakobhoeg Feb 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/1_bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🐛 Bug Report"
description: Submit a bug report to help us improve transformers.js
labels: [ "bug" ]
labels: ["bug"]
body:
- type: textarea
id: system-info
Expand Down Expand Up @@ -47,4 +47,3 @@ body:
1.
2.
3.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/2_new_model.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🌟 New model addition"
description: Submit a proposal/request to implement a new model
labels: [ "new model" ]
labels: ["new model"]

body:
- type: textarea
Expand All @@ -17,7 +17,7 @@ body:
attributes:
label: Prerequisites
description: |
Please note that Transformers.js relies on the model first being supported in [🤗 Transformers](https://github.com/huggingface/transformers) and [🤗 Optimum](https://github.com/huggingface/optimum). If the model you are requesting is not yet supported by either of them, feel free to open up a model request there too.
Please note that Transformers.js relies on the model first being supported in [🤗 Transformers](https://github.com/huggingface/transformers) and [🤗 Optimum](https://github.com/huggingface/optimum). If the model you are requesting is not yet supported by either of them, feel free to open up a model request there too.
options:
- label: "The model is supported in Transformers (i.e., listed [here](https://huggingface.co/docs/transformers/index#supported-models-and-frameworks))"
- label: "The model can be exported to ONNX with Optimum (i.e., listed [here](https://huggingface.co/docs/optimum/main/en/exporters/onnx/overview))"
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/3_new_pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🔧 New pipeline addition"
description: Submit a proposal/request to implement a new pipeline
labels: [ "new pipeline" ]
labels: ["new pipeline"]

body:
- type: textarea
Expand All @@ -17,7 +17,7 @@ body:
attributes:
label: Prerequisites
description: |
Please note that Transformers.js relies on the pipeline first being supported in [🤗 Transformers](https://github.com/huggingface/transformers). If the pipeline you are requesting is not yet supported by Transformers, feel free to open up a feature request for it there too.
Please note that Transformers.js relies on the pipeline first being supported in [🤗 Transformers](https://github.com/huggingface/transformers). If the pipeline you are requesting is not yet supported by Transformers, feel free to open up a feature request for it there too.
options:
- label: "The pipeline is supported in Transformers (i.e., listed [here](https://huggingface.co/docs/transformers/main_classes/pipelines))"
- label: "The task is listed [here](https://huggingface.co/tasks)"
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/4_feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🚀 Feature request"
description: Submit a proposal/request for a new transformers.js feature
labels: [ "enhancement" ]
labels: ["enhancement"]
body:
- type: textarea
id: feature-request
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/5_question.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "🙋 Question"
description: Ask a question about the library
labels: [ "question" ]
labels: ["question"]

body:
- type: textarea
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
with:
commit_sha: ${{ github.sha }}
package: transformers.js
path_to_docs: transformers.js/docs/source
pre_command: cd transformers.js && npm install && npm run docs-api
path_to_docs: transformers.js/packages/transformers/docs/source
pre_command: cd transformers.js && corepack enable && ONNXRUNTIME_NODE_INSTALL=skip pnpm install --frozen-lockfile && pnpm --filter @huggingface/transformers docs-api
additional_args: --not_python_module
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
60 changes: 0 additions & 60 deletions .github/workflows/gh-pages.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/pr-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
commit_sha: ${{ github.sha }}
pr_number: ${{ github.event.number }}
package: transformers.js
path_to_docs: transformers.js/docs/source
pre_command: cd transformers.js && npm install && npm run docs-api
path_to_docs: transformers.js/packages/transformers/docs/source
pre_command: cd transformers.js && corepack enable && ONNXRUNTIME_NODE_INSTALL=skip pnpm install --frozen-lockfile && pnpm --filter @huggingface/transformers docs-api
additional_args: --not_python_module
19 changes: 14 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
name: Publish Package to npmjs

on:
release:
types: [published]

env:
ONNXRUNTIME_NODE_INSTALL: skip

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '24.10.0'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish
node-version: "24.10.0"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm build
- name: Publish to npm
run: pnpm --filter @huggingface/transformers publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

env:
TESTING_REMOTELY: true
ONNXRUNTIME_NODE_INSTALL: skip

jobs:
build:
Expand All @@ -27,15 +28,18 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build

cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm build

# Setup the testing environment
- run: git lfs install && GIT_CLONE_PROTECTION_ACTIVE=false git clone https://huggingface.co/hf-internal-testing/tiny-random-T5ForConditionalGeneration ./models/hf-internal-testing/tiny-random-T5ForConditionalGeneration
- run: git lfs install && GIT_CLONE_PROTECTION_ACTIVE=false git clone https://huggingface.co/hf-internal-testing/tiny-random-T5ForConditionalGeneration ./packages/transformers/models/hf-internal-testing/tiny-random-T5ForConditionalGeneration

# Actually run tests
- run: npm run test
- run: pnpm test
2 changes: 1 addition & 1 deletion .github/workflows/upload-pr-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
package_name: transformers.js
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
__pycache__
.vscode
node_modules
.cache
.DS_STORE
deno.lock
.idea
node_modules
deno.lock

# Do not track build artifacts/generated files
/dist
/types
/models
packages/**/dist
packages/**/types
*.tsbuildinfo

# Do not track coverage reports
/coverage
packages/**/coverage
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public-hoist-pattern[]=onnxruntime-common
20 changes: 14 additions & 6 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Ignore artifacts:
# Ignore artifacts and non-source files
.github
dist
docs
examples
scripts
types
*.py
*.md

# Build outputs & caches
**/dist
**/types
**/node_modules
**/coverage
**/.cache
**/docs/build
*.tsbuildinfo

# Lock files
pnpm-lock.yaml
10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

Loading