Skip to content

Hugging Face Transformers.js

An 8-bit style image displays various technology icons symbolizing JavaScript, transformers, and AI. These icons are integrated into an arrangement of abstract geometric shapes that represent a browser and server environment. The image is simplified using a 5-color palette, maintaining a consistent and coherent aesthetic. No people or text are present.
Generated by 🤖 AI

🤗

Hugging Face Transformers.js is a JavaScript library that provides a simple way to run LLMs in the browser or node.js (or Bun, Deno, …).

With the latest GenAIScript, you can use Text Generation Models directly in the script configuration using the transformers model provider.

script({
model: "transformers:HuggingFaceTB/SmolLM2-1.7B-Instruct:q4f16",
})

GenAIScript will download and cache the model for you, and you can start using it right away fully locally.

There are plenty of models to choose from and you can also follow the Hugging Face documentation to fine tune your own.