MEGA Hub
Docs/Getting started

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 .mega tensor shard format with aligned payloads and typed metadata.
  • A model.mega.index.json manifest for multi-shard releases.
  • Runtime helpers for lazy tensor access, PyTorch state dictionaries, model construction, and tokenizer loading.
  • A Docker-like mega jobs interface 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.
  • .megakv sidecars 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.mega

The 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:

BASH
uv tool install megatensors# or: pipx install megatensors# or: python -m pip install megatensors

Confirm the CLI is available:

BASH
mega versionmega --help

For source development, clone the MEGA repository and use an editable install from its root:

BASH
python -m pip install -e ./megatensors

Authentication#

Use the browser device flow for an interactive login:

BASH
mega auth login

Automation can pass a token directly:

BASH
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:

BASH
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 list

Managing 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#

  1. Follow Quickstart to sign in, publish a small repository, and download its first revision.
  2. Choose Models, Datasets, or Spaces for the resource you want to publish.
  3. Read Authentication, Passkeys, and Account Security before creating automation credentials.
  4. Use Examples for focused runtime workflows or the OpenAPI Explorer for direct HTTP integration.