Hub Repositories#
MEGA Hub repositories provide one revisioned storage model for model,
dataset, space, and mcp content. Every file mutation creates an immutable
commit, while branches and tags provide readable revision names.
Use a repository for reviewable history and pinned releases. For mutable files that are synchronized in place, use a Storage Bucket instead; Buckets do not provide commits, branches, or tags. For large working trees, prefer the CLI or HTTP upload paths before cloning the entire repository locally.
Repository identity#
A repository ID has the form owner/name:
mega/qwen-releaseresearch/evaluation-corpusalice/demo-spaceRepository type is selected at creation and is one of model, dataset,
space, or mcp. Visibility can be public or private.
Use the type-specific guides for recommended layouts and publication checks:
Clone and push with Git#
HTTPS works for public clone and bearer-backed credential helpers; SSH is the recommended interactive write transport after registering a public key:
Use
git.tensorplay.cndirectly for HTTPS Git andssh.tensorplay.cnfor SSH. Existingmega.tensorplay.cnGit remotes remain compatible through a streamed fallback, but new clones should use the dedicated Git data plane for performance.
curl -sSfL https://mega.tensorplay.cn/git-xet/install.sh | shgit clone https://git.tensorplay.cn/mega/qwen-release.gitgit clone git@ssh.tensorplay.cn:mega/qwen-release cd qwen-releasegit add .git commit -S -m "Publish signed release"git push origin mainMEGA validates repository authorization and commit integrity before publishing a new revision. A rejected push does not partially advance the branch.
Create and inspect#
mega repos create mega/qwen-release --type model --privatemega repos create mega/search-tools --type mcp --privatemega repos info mega/qwen-releasemega repos list --owner mega --type modelTyped command groups provide the common list, info, files, upload, and download workflows:
mega models listmega datasets list research/evals --revision mainmega spaces download alice/demo --local-dir ./spaceUpload and download#
Upload one file or a directory:
mega upload mega/qwen-release ./config.json config.jsonmega upload mega/qwen-release ./model --revision main --commit-message "Publish model"For large directories, use the resumable uploader:
mega upload-large-folder mega/qwen-release ./model --revision main
Both upload commands use the Hugging Face-compatible commit workflow. Use the resumable uploader for large release trees and the regular upload command for small, reviewable changes.
Download selected files or a complete snapshot:
mega download mega/qwen-release config.json tokenizer.json --local-dir ./releasemega snapshot mega/qwen-release --revision main --local-dir ./releaseCopy with MEGA URIs#
mega cp accepts local paths and typed Hub URIs:
mega cp mega://models/mega/source@main/config.json ./config.jsonmega cp ./README.md mega://models/mega/source@main/README.mdUse models, datasets, spaces, or mcps to make the
repository type explicit:
mega cp ./README.md mega://mcps/mega/search-tools@main/README.md
Branches, tags, and history#
mega repos branch list mega/qwen-releasemega repos branch create mega/qwen-release staging --revision mainmega repos tag create mega/qwen-release v1.0 --message "First release"mega repos history mega/qwen-release --limit 20mega repos commit mega/qwen-release v1.0History and commit output includes signature_status, signer_fingerprint, signer_subject, and author_email. Use JSON output for a release gate:
mega repos commit mega/qwen-release v1.0 --format json
Tags are immutable revision pointers until explicitly deleted. Use a branch for ongoing work and a tag for a release boundary.
Move, duplicate, and delete#
mega repos move mega/old-name mega/new-namemega repos duplicate mega/source research/copy --privatemega repos delete mega/obsoleteMoving can rename a repository or transfer it into an administered namespace. Duplicating copies repository history and metadata without transferring the underlying object bytes.
Discussions and pull requests#
Repository community operations use mega discussions:
mega discussions list mega/qwen-releasemega discussions create mega/qwen-release --title "Release notes" --body-file ./RELEASE.mdmega discussions comment mega/qwen-release 3 --body "Verified on CUDA 13."Fine-grained tokens need community:write for mutations. Repository discussions and pull requests share numbering, message history, attachments, reactions, and moderation boundaries.
See Discussions and Pull Requests for branch-backed proposals, diff review, fast-forward merge, and moderation commands.
Python SDK#
from megatensors.hub import MegaHubClient client = MegaHubClient()repo = client.create_repo( "mega/qwen-release", repo_type="model", private=True, exist_ok=True,) client.upload_file( "mega/qwen-release", "./config.json", path_in_repo="config.json",) for file in client.list_files("mega/qwen-release", revision="main"): print(file.path, file.size, file.sha256)Use the Python SDK for the typed method map and the live OpenAPI Explorer for direct HTTP integration.
Operational guidance#
- Pin deployments to a commit or tag instead of a mutable branch.
- Use
--dry-runand include/exclude filters before large downloads. - Keep repository type stable; create a separate repository when content semantics change.
- Prefer
mega upload-large-folderfor large release trees; see Xet for large-artifact guidance. - MCP repositories support the same native Xet upload, deduplication, download, and maintenance paths as other repositories. Marketplace runtime CPU, memory, request, and package limits remain independent of repository storage.
- Require explicit confirmation for destructive branch, tag, file, and repository deletion.
- Keep discovery metadata short and use
README.mdfor detailed release context.

