Skip to main content
The client can push encoded .serva datasets to the Hugging Face Hub and pull them back later. The Hub support ships with serva so there is nothing extra to install.

Authentication

Set your Hugging Face token as HF_TOKEN or pass hf_token= when you build the client.

Push

Encode a file, then push the result to a dataset repo. The repo is created if it does not exist, and push returns its URL.
Passing the EncodeResult lets the dataset card show the compression savings. A plain file path works too, and the card leaves the savings out.
Pass private=True to create a private dataset repo.
Pushing writes a README.md dataset card next to the file with the encoded size, the original size, and the savings, plus a short snippet showing how to pull and decode it.

Pull

Download a .serva file from a dataset repo. pull returns the local path, which you can hand straight to decode.
Pass revision= to pull from a specific branch, tag, or commit. It defaults to main.

List

List the dataset repos owned by the authenticated user.
A failed Hub operation raises HubError, for example a missing token, a repo that does not exist, or one you cannot reach.