MEGA Documentation#
MEGA combines a model artifact runtime with a collaborative Hub. Use the same platform to publish models, datasets, and Spaces; automate repositories; run bounded compute Jobs; and load verifiable tensor artifacts from Python.
What MEGA provides#
- A binary
.megatensor shard format with aligned payloads and typed metadata. - A
model.mega.index.jsonmanifest for multi-shard releases. - Runtime helpers for lazy tensor access, PyTorch state dictionaries, model construction, and tokenizer loading.
- A Docker-like
mega jobsinterface for bounded containers and recurring compute. - Four integration surfaces: the MEGA CLI, typed Python clients, the canonical Hub Web API, and the OpenAI-compatible Inference Router.
- Optional certificate-backed signing for source and artifact verification.
.megakvsidecars for prompt or prefix cache reuse outside the model artifact.
Common workflows#
| Goal | Start here |
|---|---|
| Choose an integration surface | CLI, Python SDK, Hub API, or MCP |
| Create and version a Hub repository | Repositories |
| Reuse Hugging Face tooling | Hugging Face Compatibility |
| Publish a model release | Model Repositories |
| Publish a dataset | Dataset Repositories |
| Write a useful model or dataset card | Repository Cards |
| Propose or review a change | Discussions and Pull Requests |
| Find repositories and follow publishers | Search and Discovery |
| Curate models, datasets, Spaces, and papers | Collections |
| Link a release to verified research | Paper Pages |
| Work in a shared namespace | Organizations |
| Set up phishing-resistant browser sign-in | Passkeys |
| Secure accounts and automation | Account Security |
| Understand plans and compute credit | Billing |
| Publish an interactive application | Spaces |
| Publish large versioned artifacts | Xet |
| Synchronize mutable checkpoints and work files | Storage Buckets |
| Run a container or recurring task | Jobs |
| Choose a public integration surface | Integrations |
| Make a first routed model call | First Inference Provider Call |
| Configure routing, BYOK, and organization billing | Inference Providers |
| Browse the live HTTP contract | Hub API and OpenAPI Explorer |
Handle quotas and 429 responses |
Rate limits |
| Configure signed event delivery | Webhooks |
| Publish a first Hub repository | Quickstart |
| Convert a local safetensors directory | Conversion |
| Understand artifact files and metadata | Format |
| Load tensors or models from Python | Tensor Runtime API |
| Choose an I/O backend | Backends |
| Sign a release | Signing and Trust |
| Get help with an unavailable service | Service status and support |
Mental model#
A MEGA release normally contains:
qwen3.5-0.8b/├── config.json├── tokenizer.json├── model.mega.index.json├── model-00001-of-00002.mega└── model-00002-of-00002.megaThe index file is the stable entry point. It records shard locations, shared metadata, and tensor routing. Runtime calls can accept either a single .mega file or the .mega.index.json file.
Installation#
Install the published CLI and Python package with one of the supported Python tool runners:
uv tool install megatensors# or: pipx install megatensors# or: python -m pip install megatensorsConfirm the CLI is available:
mega versionmega --helpFor source development, clone the MEGA repository and use an editable install from its root:
python -m pip install -e ./megatensors
Authentication#
Use the browser device flow for an interactive login:
mega auth login
Automation can pass a token directly:
mega auth login --token "$MEGA_TOKEN"
The token is stored in the local MEGA config and reused by Hub download, upload, and snapshot commands.
See Authentication for device flow, automation tokens, scopes, and public-key management.
Register only public SSH or GPG keys. The CLI rejects private-key material before contacting the service:
mega auth keys add ~/.ssh/id_ed25519.pub --name "Work laptop"gpg --armor --export user@example.com > signing-key.ascmega auth keys add signing-key.asc --type gpg --name "Release signing"mega auth keys listManaging account keys through an access token requires the account:keys permission. Browser sessions and service administrators can manage their own account keys directly.
Next steps#
- Follow Quickstart to sign in, publish a small repository, and download its first revision.
- Choose Models, Datasets, or Spaces for the resource you want to publish.
- Read Authentication, Passkeys, and Account Security before creating automation credentials.
- Use Examples for focused runtime workflows or the OpenAPI Explorer for direct HTTP integration.

