Skip to main content

A simple, portable bundle format for ML models and their metadata

Project description

🌱 SEED

A portable bundle format for machine learning models.

SEED packages a model's weights, config, tokenizer, and any other artifacts into a single .seed file — a self-contained zip with a structured manifest. Built with language models in mind, generic enough for anything.

No more juggling separate .pth, .json, and custom pickle files. One file, everything inside.


Author

Artheme Gauthier-Villars (agauthier@ethz.ch)

Install

pip install seedfile

Quickstart

from seedfile import sd

# Save everything in one shot
sd.save("my_model.seed", {
    "model":     model.state_dict(),   # PyTorch state dict
    "config":    CONFIG,               # dict, dataclass, or custom object
    "tokenizer": tokenizer,            # any Python object
})

# Load it back anywhere
data = sd.load("my_model.seed")

model.load_state_dict(data.get("model"))
CONFIG    = data.get("config")
tokenizer = data.get("tokenizer")

The bundle knows what it contains:

print(data)
# SeedBundle(version=v1.0.0, components=['model', 'config', 'tokenizer'])

"model" in data   # True
len(data)         # 3

Why SEED?

Training a language model produces a lot of artifacts that belong together:

Artifact Typical format Problem
Model weights .pth Detached from the config it was trained with
Tokenizer custom class / HF files Separate directory, easy to lose
Generation config .json No guarantee it matches the weights
Training history dict / CSV Usually just forgotten

SEED bundles all of it. When you share or archive a .seed file, everything travels together.


Serialisation

SEED picks the right format automatically — no configuration needed:

Object type Saved as
PyTorch state_dict .pth via torch.save
torch.Tensor .pth
numpy.ndarray .npy via np.save
dict, list, primitives .json
Custom objects .json (via __dict__) → pickle fallback

Custom serialisers

For objects that need special handling, pass a serializers dict:

def save_tokenizer(obj, tmp_dir):
    path = tmp_dir / "tokenizer.model"
    obj.save(str(path))
    return "tokenizer.model"

sd.save("my_model.seed", {"model": model.state_dict(), "tokenizer": tokenizer},
        serializers={"tokenizer": save_tokenizer})

Updating a single component

sd.update("my_model.seed", "config", new_config)

Manifest

Every .seed file contains a manifest.json:

{
  "format_version": "v1.0.0",
  "metadata": {
    "created_at": "2026-05-12T10:30:00+00:00",
    "python_version": "3.10.4"
  },
  "components": {
    "model":     "model.pth",
    "config":    "config.json",
    "tokenizer": "tokenizer.pkl"
  }
}

SEED warns on load if the format version or Python version differs from what was used at save time.


Zero hard dependencies

SEED has no required dependencies. torch and numpy are used only if already present in your environment.


License

MIT

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

seedfile-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

seedfile-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file seedfile-1.0.0.tar.gz.

File metadata

  • Download URL: seedfile-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for seedfile-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6821d4e18e5ad6bda6e3b92db6bf147ec275026d9c162aca2425260ed5916bce
MD5 9c9375b9f64bbfd37667fabad5cda3f1
BLAKE2b-256 0eb2004b89e11696fddaed9cf01f5ab7b983debcd59947dd9e42b979cf479412

See more details on using hashes here.

File details

Details for the file seedfile-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: seedfile-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for seedfile-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7045058e8988cd1df4b5f164a3519527c2c895d57c8175b8988e6315892ecbfc
MD5 c4161191fbfa7c6e032756ec97bbdce1
BLAKE2b-256 e1400712b9db2bd5434334ecf920c2f97fb3e04063b1a7f41a0e2a1bf1a420e2

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