spaces
Utilities for Hugging Face Spaces
What it is and what it does
Spaces is a utilities package for interacting with the Hugging Face Hub platform. It provides functions to download pre-trained models and datasets, upload files and folders to repositories, manage repositories, run inference on deployed models, and execute jobs on Hugging Face infrastructure. The package wraps HTTP communication to the Hub's API and is designed for both human developers and AI agents, with a CLI that adapts output based on context.
The package depends on requests and httpx for network communication, pydantic for data validation, and gradio for UI integration. Installation is straightforward with pip, and the core functionality requires Python 3.10 or later with no external system dependencies beyond the runtime dependencies listed.
Use it for:
- Download pre-trained models or datasets from the Hub for use in local machine learning projects.
- Upload trained models, datasets, or applications to the Hub for sharing with the community.
- Programmatically manage model repositories, including creating repos and updating metadata.
- Run inference on models deployed to the Hub without hosting your own infrastructure.
- Automate model versioning and file management as part of a training or deployment pipeline.
- Integrate Hub access into agent workflows via CLI with context-aware output formatting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides utilities for working with Hugging Face Spaces, including downloading files, uploading content, and managing repositories on the Hugging Face Hub platform.
Yes. The package is actively maintained, has low install friction, carries a permissive Apache-2.0 license, and provides essential utilities for anyone working with Hugging Face models and datasets. No known vulnerabilities. Install it if you need to programmatically interact with the Hub.
Install
spaces on PyPI
pip
pip install spacesuv
uv add spacespoetry
poetry add spacesInstalling spaces
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release 24 days ago and 3801 repository stars. Depends on well-established packages: packaging, typing-extensions, requests, gradio, pydantic, and httpx.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install spaces
from spaces import download_file
download_file(repo_id="model/repo", filename="config.json")
Requires Python 3.10 or later (supports current versions, <3.15).
Verify before relying
- Specific API functions available in the spaces package beyond what the description excerpt covers.
- Performance characteristics and rate-limiting behavior when downloading large models.
- Whether optional dependencies are needed for typical workflows.
- Actual runtime behavior and caching mechanisms for downloaded files.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — packaging, typing-extensions, requests, gradio, pydantic, httpx |
| Maintenance | actively maintained — 24 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 372,618/month — #7,159 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spaces-0.51.1-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
hfA command-line interface for interacting with…
permissive · top 15,000 on PyPI
hf-gradioA CLI tool for discovering endpoints and…
permissive · top 5,000 on PyPI
hf-transferAccelerates file transfers to and from the…
unclear · top 5,000 on PyPI
text-generationProvides a Python client to query text…
permissive · top 15,000 on PyPI
kernels-datakernels-data provides Python bindings for…
unclear · top 5,000 on PyPI
truss-transferDownloads and resolves Baseten Pointers (bptr)…
unclear · top 15,000 on PyPI
modelscope-hubDownload, upload, and manage AI models,…
permissive · top 5,000 on PyPI
gradio-clientCalls any Gradio app as a Python API with a…
permissive · top 5,000 on PyPI