Mirror Download Skill for Openclaw

A smart download accelerator that dynamically routes HuggingFace and GitHub traffic through regional mirror servers for fast and resilient AI model and repository downloads.

yazuibi
v1.0.0
Jun 4, 2026
0
483
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install download-mirror

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install download-mirror using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Mirror Download Skill?

The mirror-download capability, available through Openclaw Skills, is a robust technical solution designed for developers operating under restricted network environments. Directly fetching multi-gigabyte AI models or cloning massive repositories from standard sources like HuggingFace and GitHub often results in network timeouts, SSL errors, and wasted developer hours. This skill acts as an intelligent failover layer, adhering to a strict "fail once, switch immediately" protocol to prevent repetitive token-draining download retries.

By executing rapid latency probes, this skill dynamically evaluates available mirrors (such as hf-mirror, ModelScope, GitCode, and ghfast.top). Once it detects a highly responsive node, the skill shifts download tasks or library routines automatically, redirecting environmental configs or swapping Git clone links to ensure downloads finish without manual reconfiguration.

Mirror Download Skill Use Cases

  • Accelerating the download of massive LLM weights, configuration schemas, and tokenizer dictionaries in restricted-connectivity regions.
  • Bypassing recurrent connection timeouts (HTTPSConnectionPool) and SSL verification errors during repository clone events.
  • Automating model loading and fallback pathways in local development environments and CI/CD pipelines.
  • Seamlessly executing single-file or large-chunk model downloads via highly optimized parallel engines like aria2c.
  • Standardizing downstream workflows by auto-mapping owner IDs between HuggingFace and domestic alternatives like ModelScope.

How Mirror Download Skill Works

  1. Request Interception: The skill triggers as soon as a repository clone, model pull, or network-related connection timeout is detected.
  2. Active Ping Probe: Runs a fast, non-blocking check to evaluate connectivity against HuggingFace, hf-mirror, ModelScope, GitHub, and GitCode within a strict 4-second timeout limit.
  3. Optimal Mirror Routing: Based on the diagnostics, it dynamically determines the most reachable domestic target.
  4. Execution Redirection: Changes environment variables like HF_ENDPOINT to direct commands like huggingface-cli or snapshot_download to the mirror site.
  5. Post-Download Validation: Iterates through the output directory to compute final file counts, verify overall size, and ensure critical metadata files exist intact.

Mirror Download Skill Setup

To deploy the mirror-download helper, install the required interface packages in your active Python environment:

# Install the Hugging Face Hub CLI and library
pip install huggingface_hub -q

# Install the ModelScope SDK for domestic model routing
pip install modelscope -q

# Optional: Install aria2 tool for multi-threaded chunk downloads
sudo apt-get update && sudo apt-get install aria2 -y

To diagnose your local server connection issues and verify mirror responsiveness, run the diagnostic script:

python3 -c "
import subprocess
def ping(host):
    try:
        r = subprocess.run(['curl', '-s', '-o', '/dev/null', '-w', '%{http_code}', '--connect-timeout', '3', f'https://{host}'], capture_output=True, text=True)
        return r.stdout.strip() not in ['000', '']
    except:
        return False
print('hf-mirror:', 'Available' if ping('hf-mirror.com') else 'Unavailable')
print('modelscope:', 'Available' if ping('modelscope.cn') else 'Unavailable')
"

Mirror Download Skill Data Schema & Taxonomy

This Openclaw Skills configuration maps download directories, variables, and mapping protocols according to the following schema:

Component Type Description
HF_ENDPOINT Env Variable Set to https://hf-mirror.com to override original HF endpoints natively.
scripts/diagnose.py Python Script Analyzes host performance and proposes optimal download paths dynamically.
scripts/mirror_download.py Python Script Contains wrappers to coordinate download strategies and CLI arguments.
references/modelscope_id_map.md Mapping Catalog Maps canonical HuggingFace repository IDs directly to equivalent ModelScope IDs.
check_download() Python Function Confirms directory structural validity, checks total downloaded GBs, and scans for critical configs.

Mirror Download Skill Advanced Features

  • Immediate Failover Mechanism: Shifts workloads to the mirror site on the first trace of timeout or ConnectionError without retrying the dead host.
  • Smart Model ID Translator: Translates repository owner namespaces natively, seamlessly converting identifiers like THUDM/chatglm3-6b into ZhipuAI/chatglm3-6b.
  • Integrated Aria2 Multi-threading: Leverages parallel downlinks (using aria2c -x 16 -s 16) to speed up heavy model file downloads.
  • Model Configuration Sanity Checks: Validates configuration frameworks (like config.json and tokenizer_config.json) after writing to disk to protect against incomplete downloads.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*