HuggingFace.js
Utilities to use the Hugging Face hub API
README
Hugging Face JS libraries
This is a collection of JS libraries to interact with the Hugging Face API, with TS types included.
- @huggingface/hub: Interact with huggingface.co to create or delete repos and commit / download files
- @huggingface/inference: Use the Inference API to make calls to 100,000+ Machine Learning models!
With more to come, like @huggingface/endpoints to manage your HF Endpoints!
We use modern features to avoid polyfills and dependencies, so the libraries will only work on modern browsers / Node.js >= 18 / Bun / Deno.
The libraries are still very young, please help us by opening issues!
Installation
From NPM
To install via NPM, you can download the libraries as needed:
- ```bash
- npm install @huggingface/hub
- npm install @huggingface/inference
- ```
Then import the libraries in your code:
- ```ts
- import { createRepo, commit, deleteRepo, listFiles } from "@huggingface/hub";
- import { HfInference } from "@huggingface/inference";
- import type { RepoId, Credentials } from "@huggingface/hub";
- ```