Skip to main content

Pull open-weight AI models from the ossllms torrent network. A drop-in for huggingface_hub.

Project description

ossllms (Python SDK + CLI)

Pull open-weight AI models from the ossllms preservation network. A drop-in for huggingface_hub that resolves from the torrent layer, verifies integrity + publisher signature, and lands files in the HF-compatible cache. Full design: ../docs/SDK.md and ../docs/INTEROP-HF.md.

Install

pip install 'ossllms[torrent]' # V0 path: HTTP web-seed + libtorrent swarm/seed

CLI (simplest UI)

ossllms search minilm                 # find a useful default-catalog model
ossllms pull hf/sentence-transformers/all-MiniLM-L6-v2@0.0.1+1110a243fdf4
ossllms pull hf/sentence-transformers/all-MiniLM-L6-v2@0.0.1+1110a243fdf4 --seed
ossllms contribute                    # start/attach to the managed seed worker
ossllms pull sha256:<64-hex>          # resolve by catalog hash index
ossllms publish ./model               # TTY: prompt/infer, sign, optionally seed
ossllms publish ./model --seed --yes-public # automation: publish and seed local bytes
ossllms contribute --dry-run          # preview seed/publish candidates and caps
ossllms contribute --publish          # TTY: choose publish/seed rows, consent, then seed
ossllms contribute --publish --yes-public # automation: publish selected cache candidates, then seed
ossllms contribute                    # attach to/start managed seed handoff worker
ossllms contribute --status           # show worker metrics
ossllms contribute --stop             # stop worker
ossllms ls                            # what's cached
ossllms verify hf/sentence-transformers/all-MiniLM-L6-v2@0.0.1+1110a243fdf4

If no catalog is configured, the packaged signed default catalog is used. Set OSSLLMS_CATALOG=https://catalog.ossllms.com or pass --catalog ... for a custom directory or http(s) catalog.

Python

from ossllms import snapshot_download, hf_hub_download, pull

path = snapshot_download("hf/sentence-transformers/all-MiniLM-L6-v2@0.0.1+1110a243fdf4")
cfg  = hf_hub_download(
    "hf/sentence-transformers/all-MiniLM-L6-v2",
    "config.json",
    revision="0.0.1+1110a243fdf4",
)

res = pull("hf/sentence-transformers/all-MiniLM-L6-v2@0.0.1+1110a243fdf4")
print(res.verdict.label, res.verdict.signer)             # "Verified" / signer

import ossllms.compat   # opt-in: route huggingface_hub downloads through ossllms

What's built (v0.1)

  • pull: resolve signed manifest → download via HTTP web seeds (works today; file:// supported) → verify every file's SHA-256, v2 root, and minisign/Ed25519 signature → place in HF cache. Integrity always enforced; origin shown as Verified/Unverified (--require-signature to enforce). pull --seed starts the managed contribution worker for the pulled snapshot when the catalog has matching torrent metadata.
  • Store-qualified refs, sha256: refs, and catalog-paired magnet: refs.
  • publish: build and sign a public redistribution bundle from a local model directory; optionally update a static V0 catalog/hash index with --catalog-dir, and start the managed seed worker directly from the local directory with --seed.
  • contribute --dry-run: scans local HF cache roots, matches catalog hashes, shows seed/publish candidates, public-publish warnings, and upload caps.
  • contribute: attaches to an active managed worker or starts one for complete in-network seed matches, persisting upload caps, zero-download seed metrics, and a worker plan. In a terminal it renders the scan plan, lets the user select publish/seed rows, shows caps, and requires public redistribution consent before publish writes. When ossllms[torrent] is installed and release.torrent metadata is available beside release.json, the worker starts libtorrent seed mode from a hardlink-only view of the HF cache.
  • Worker-state, HF metadata, provenance, and seed-mode handoff primitives.
  • huggingface_hub-compatible snapshot_download / hf_hub_download + compat shim.
  • Manifest schema validation, trust store (pinned keys), selective --include.
  • libtorrent swarm engine: download scaffold plus live contribute seed adapter behind the optional torrent extra. Local two-peer E2E gates prove fixture, direct-publish, and contribute-publish no-web-seed swarms over libtorrent.
  • Bundled default MiniLM metadata includes release.torrent, so the post-pull default contribution path can start live seed mode when ossllms[torrent] is installed.

Develop / test

python -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/pytest          # or: PYTHONPATH=. .venv/bin/pytest tests

Verified = verified origin + integrity (+ a matches HF badge). It does not mean the weights are safe to run.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ossllms-0.1.0.tar.gz (109.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ossllms-0.1.0-py3-none-any.whl (107.0 kB view details)

Uploaded Python 3

File details

Details for the file ossllms-0.1.0.tar.gz.

File metadata

  • Download URL: ossllms-0.1.0.tar.gz
  • Upload date:
  • Size: 109.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ossllms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 55d518848c2dae9bbf09f45fec33bb566cea97285b47fe295f16ae41f3c9aca4
MD5 6a1a50a698969da68e34f1deee065b3f
BLAKE2b-256 e21da57cd20ec60dd4fecfc873a4e0de3f8d0bc2702e8b8074ad54132c9d93b8

See more details on using hashes here.

File details

Details for the file ossllms-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ossllms-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 107.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ossllms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b216fec12c4eec92ebd4daa9b7ad687b020f5144c7b863143555fff440818201
MD5 ca5175a20c8a4e5d425e4717b69f8e29
BLAKE2b-256 ed757be5417d2627bf3f5cdab885d71a7b282227b2e903974167b289421e6eef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page