hugpy-resources
Hugpy Resources is the shared function library used by Discovery, Wrapper, Core and other Hugpy packages. It supplies the vocabulary and calculations that let a model record, a memory estimate and a placement decision use the same units and definitions.
Installation
Install the base distribution for the shared functions. The inspection extra adds tokenizer inspection dependencies. The yaml extra adds YAML support.
python -m pip install hugpy-resources
Quick start
Calculate the stored payload of a dense tensor from its shape and element width.
from hugpy_resources.imports import tensor_bytes
payload = tensor_bytes((32, 128), 2)
print(payload) # 8192 bytes
Working with resource evidence
| Task | What the library supplies |
|---|---|
| Inspect a model directory | Readers for GGUF and safetensors headers, model configuration, tensor shapes and stored types |
| Estimate a placement | Tensor and KV-cache sizing, device budgets, layer allocation and resource bounds |
| Read or publish state | Filesystem, hashing, SQLite, settings and HTTP functions shared by the services |
| Interpret a record | Typed terms, units, domain settings and human-readable definitions |
A tensor payload accounts for stored elements. A runtime peak also depends on context, representation, allocator overhead and backend workspaces. Keep missing bounds explicit when deciding whether a model fits.
Integration
Import individual names from hugpy_resources.imports. In a Hugpy service, expose the names once in the service’s imports/module_imports.py. Consumers can then use the same implementation through their package’s import boundary. Source contributors can find the term definitions under src/hugpy_resources/imports/TERMS/.
Shared imports
Service packages expose the functions they use through their own imports module. This keeps model inspection, hashing and placement calculations consistent across producers and consumers. For example, Discovery records evidence from model files, Wrapper uses those facts when selecting a placement, and Core reads the worker’s published results. Callers that need to distinguish a missing measurement from a measured zero should preserve that distinction throughout.
Metadata
Release files for hugpy-resources 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hugpy_resources-0.1.18.tar.gz | 271.3 kB | Without provenance | Details for hugpy_resources-0.1.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hugpy_resources-0.1.18-py3-none-any.whl | Python 3 | none | any | Details for hugpy_resources-0.1.18-py3-none-any.whl |
Total release size: 605.0 kB
Release files / hugpy_resources-0.1.18.tar.gz
| Download URL | hugpy_resources-0.1.18.tar.gz |
|---|---|
| Size | 271.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1bae6ff42cbcbd3a84b3887e30446c03751ecfac510cfbe749a2b7d07b9ddc1
|
|
BLAKE2b-256 checksum How to use checksums |
bdb43f8ae6ae6db99eb6a7a2ea95f2c6918c0318ab14d4d26adf8936cec624aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / hugpy_resources-0.1.18-py3-none-any.whl
| Download URL | hugpy_resources-0.1.18-py3-none-any.whl |
|---|---|
| Size | 333.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
913a90ac1991285f6452d64c8348733c3b24560eb3f44780d900877b2bbbd914
|
|
BLAKE2b-256 checksum How to use checksums |
f3a1842262e7ac38a9c1b0ca31639901811373f96a3c68520dfda3aff1a2ad49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for hugpy-resources 0.1.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.