{
  "video_id": "KnhppkY4gHs",
  "channel_slug": "huggingface",
  "channel_handle": "huggingface",
  "title": "Transformers.js v4: State-of-the-art machine learning for the web",
  "duration_seconds": 484.0,
  "url": "https://www.youtube.com/watch?v=KnhppkY4gHs",
  "upload_date": "",
  "transcript": "We just released Transformers.js version\n4 and it is huge. I don't think there's a\nsingle line untouched in the core library. Our\nbrand new C++ WebGPU backend brings unmatched\nperformance to your web applications as well\nas serverside JavaScript. This new backend\nalso enables you to run much larger\nmodels like GP-OSS 20B in JavaScript.\nKeeping up with the latest research and trends.\nWe've added support for many new architectural\ncomponents. We have exciting new features like the\nModelRegistry and improved login controls. And the\ncode base has been completely restructured. It's\nmore modular, more maintainable with faster builds\nand smaller bundles thanks to our new build\nsystem. Hi, I'm Nico and together with Joshua,\nwe develop Transformers.js. Let's dive\nin and see what's new in version 4.\n[music]\nThe biggest change is the new WebGPU runtime\ncompletely rewritten in C++. We worked closely\nwith the ONNX runtime team to test it across all\nsupported models and the results are incredible.\nOur previous WebGPU backend was JavaScript only\naccessing the browser's WebGPU API directly.\nthat worked but locked us into the browser.\nThe new C++ backend changes everything.\nWebGPU operations can now run in any language,\nPython, C++, C#, JavaScript, and all platforms,\nwhich means the same Transformers.js\ncode now runs across browsers, node,\nbun, and deno. WebGPU acceleration is\nno longer browser only. Besides that,\nit also provides better operator coverage,\nbetter performance, and better accuracy.\nWe've proven that it is possible to run\nstate-of-the-art AI models in the browser, and\nnow we're making them fast, even on constrained\ndevices. We rethought our entire export strategy.\nFor large language models, we reimplemented\narchitectures operation by operation and\nleveraged fused kernels to maximize performance.\nOne great example is the LFM 2.5 thinking,\na 1.2 billion parameter LLM from LiquidAI that can\nnow run in the browser at impressive token speeds.\nTransformers.js version 4 now supports\nover 200 different architectures,\nmany exclusive to version 4. There are almost\n3,000 compatible models on the Hugging Face hub,\nand that number grows every day. Here are\nsome V4 exclusive models you should know\nabout. TranslateGemma enables multilingual\ntranslations across 55 different languages.\nLFM2VL brings real-time video captioning to your\nbrowser. Quen 3.5 is a multimodal model that\nperforms at the same level as GPT-4o from a couple\nof years ago. Voxtral realtime delivers streaming\nautomatic speech recognition \"running 100% locally\nin my browser powered by Voxtral Realtime and\nTransformers.js\". And Chatterbox Turbo enables\nvoice cloning with just 5 seconds of reference\naudio. You can even use paralinguistic tags like\n[chuckle] or [gasp] to enhance the realism of your\ngenerations. \"It was over long before you realized\nyou were playing my game.\" Behind the scenes,\ngetting these models working in ONNX was\na challenge. Take mamba layers. We had to\nreimplement them operation by operation. You\ncan see this in action with Granite 4.0-H,\nIBM's hybrid models that use interleaved mamba and\nattention layers or multi head latent attention\nwhich uses low rank latent representations\nto cut memory use and speed up attention.\nYou will see that in models like the Youtu LLM,\nDeepSeek V3 and Mistral 4. And to close it out,\nwe have a wild one. 8B plus parameter models\nin the browser are now real. Here's GPT-OSS,\na 20B parameter model that runs at 40 tokens\nper second in the browser. The reason this is\neven possible is mixture of experts. Each\ntoken only activates a subset of expert\nnetworks instead of the entire model. That keeps\ninference fast enough to be practical powered by\ncustom MoE and QMoE ops in ONNX runtime. It's\nalso the same idea behind LFM2 MoE which shows\nhow models this large can stay efficient enough\n[clears throat] for real ondevice inference.\nBeyond the new model architectures, we've added\na brand new model registry and this one is a\nbig deal for anyone building production apps.\n[snorts] ModelRegistry gives you full visibility\nand control over the required files. You can\ndiscover exactly which files a model needs,\ncalculate the total download size, check whether\nthe model is already cached, and also clear the\ncache when needed. Thanks to Steven Roussey, a\nvery active member of our community, you can also\ncheck which precision types are available for\nany given model ID. Based on the ModelRegistry,\nwe can now expose a new \"progress_total\"\ncallback. It gives you overall loading\nprogress while a model downloads. So you can show\naccurate loading bars without tracking individual\nfiles yourself. Two new environment settings\ngive you more control over how Transformers.js\nloads models. First env.useWasmCache. WASM\nruntime files are now cached by default. So\nonce a model is loaded, your app can work fully\noffline on later visits. You can still opt out,\nbut it's enabled automatically\nwhenever a cache is available.\nSecond, env.fetch. You can now pass your own\nfetch function with custom headers, auth tokens,\nor abort signals. And Transformers.js will\nuse it for all network requests. This is\ngreat for authenticated model access or for\nintegrating with your own request pipeline.\nLast but not least, here's a quick rundown of the\ntooling improvements. The entire codebase has been\nrestructured, refactoring the monolithic models\nfile into separate per model files. Projectwide\nformatting with prettier migration to PNPM\nworkspaces. TypeScript users get improved\ntypes with dynamic pipeline output types.\nSo, TypeScript now knows the exact return\ntype based on the task you're using. And a switch\nto esbuild. Build times dropped from two seconds\nto 200 milliseconds and file sizes are slightly\nsmaller. The Tokenizer is now its own standalone\npackage. So @huggingface/tokenizers is an 8.3\nkilobytes zero dependency library that works\neverywhere. Of course, there is plenty more.\nCountless bug fixes and by far the most stable\nrelease we've ever shipped. All the details,\nincluding links, docs, and specs, are in the\nrelease notes. Hit the subscribe button so you\ndon't miss future Transformers.js updates. And\nthank you so much for watching. We're excited to\nsee what you build with Transformers.js version 4.\n[music]",
  "transcript_chars": 6272,
  "ingested_at": "2026-05-15T10:39:40.210844+00:00",
  "source": "channel",
  "yt_meta": {
    "view_count": 6286,
    "like_count": 320,
    "channel_id": "UCHlNU7kIZhRgSbhHvFoy72w",
    "categories": [
      "Science & Technology"
    ],
    "tags": []
  }
}