Hugging Face JS packages let TypeScript and JavaScript apps manage Hub repos, call inference providers, and parse ML file formats from browsers or Node.
Overview
Hugging Face JS libraries are a family of npm packages for working with Hugging Face services from JavaScript or TypeScript, with types included. They target modern browsers and Node.js 18 or newer, plus Bun and Deno, without legacy polyfills.
The @huggingface/hub package creates, updates, and deletes repositories and uploads or downloads files on huggingface.co. @huggingface/inference wraps serverless inference providers and dedicated inference endpoints for chat, image, translation, and related model tasks.
Additional packages cover MCP clients and tiny agents, GGUF and DDUF parsers for remote files, LeRobot dataset layouts, OpenUSD web viewing, Hub task definitions, a minimal Jinja engine for chat templates, Space header embedding, Ollama compatibility helpers, and tool-using agent utilities.
You install only the packages you need from npm, import them in bundled apps, or load them as ES modules from a CDN. Examples in the docs use access tokens from Hugging Face account settings for authenticated Hub and inference calls.
Key features
- @huggingface/hub repo file operations
- @huggingface/inference multi-provider calls
- MCP client and tiny agents package
- GGUF DDUF and LeRobot parsers
- USD web viewer with three.js
- Jinja templates for chat models
- CDN and npm installation paths
- TypeScript types included
Use cases
- Manage Hub models from a web app
- Call hosted LLMs in Node or browser
- Build agents with MCP tool servers
- Parse remote GGUF metadata in JS