> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Install and update from mainland China

> Understand how Linger picks China download mirrors on its own, and force or reset that choice when it guesses wrong.

Linger downloads a lot on first setup: a Node.js runtime, packages, the local model kit, model weights, and agent runtimes. Most of these live on hosts that are slow or unreachable from mainland China, such as Hugging Face, the npm registry, and GitHub.

Linger handles this with one setting, the **download region**. It is either `global` or `cn`. In `cn`, every download tries a China mirror first, such as ModelScope, npmmirror, or the Aliyun mirrors. In `global`, it tries the original host first. You do not need to configure anything; Linger measures your network the first time it downloads.

The region only changes the order Linger tries sources in. Every source stays in the list, and every file must match the checksum Linger pinned for it, so a mirror can make a download faster or slower but cannot change what you install.

This page covers how Linger picks the region, which mirrors it uses, and how to force or reset the choice. It applies to the desktop app and the installer.

## How Linger picks the region

Linger races two copies of the same small file and keeps the faster one. It fetches the start of one pinned package from `registry.npmjs.org` and from `cdn.npmmirror.com` at the same time. If the China mirror delivers more within four seconds, the region is `cn`; otherwise it is `global`. If neither answers, Linger uses `global` for that run and tries again next time.

Linger saves the result in `region.json` under the installation home and reuses it for seven days:

```json theme={null}
{
  "schema": "simplex.region/v1",
  "region": "cn",
  "resolved_at": "2026-11-18T08:00:00.000Z",
  "method": "probe"
}
```

The installation home is `~/.simplexai` unless you set `LINGER_HOME`, so the file is usually `~/.simplexai/runtime/region.json`. Linger passes the region to the local model tools it starts, so they do not measure again.

If every source in your region fails and the other region works, Linger switches. It rewrites `region.json` with `"method": "fallback"`, and later downloads start in the region that worked.

A VPN or proxy changes the result. Linger measures the network it actually has, so a computer in mainland China with a fast proxy may get `global`. That is usually the faster choice for that computer.

## See which mirrors each download uses

Each download has a China source and an original source:

| Download | `cn` tries first | `global` tries first |
| - | - | - |
| Model weights | ModelScope, then `hf-mirror.com` | Hugging Face |
| Model metadata lookups | `hf-mirror.com` | `huggingface.co` |
| Node.js runtime | `cdn.npmmirror.com` | `nodejs.org` |
| npm packages, pnpm, voice models | `registry.npmmirror.com` | `registry.npmjs.org` |
| Local model kit | `cdn.npmmirror.com` | CloudFront |
| Agent runtimes (Codex, Pi) | `registry.npmmirror.com` | `registry.npmjs.org` |
| Inference engines (llama.cpp, whisper.cpp) | `registry.npmmirror.com` | GitHub Releases |
| Python packages | `mirrors.aliyun.com/pypi` | PyPI |
| Go toolchain and modules | `mirrors.aliyun.com`, `goproxy.cn` | `dl.google.com`, `proxy.golang.org` |
| Desktop app updates | `cdn.npmmirror.com`, then GitHub Releases | GitHub Releases |

Some downloads have no China copy yet. ModelScope does not host every model Linger recommends, so those weights come from `hf-mirror.com`. Large GPU runtime archives, such as the CUDA runtime, still come from GitHub, and the Claude Code runtime comes from Anthropic. Expect those steps to be slower in mainland China.

Desktop updates are signed. Whichever host serves an update, Linger installs it only when the signature matches the key built into the app and every piece matches its checksum. If the China mirror has not caught up with a new release yet, Linger checks GitHub Releases too, so a slow mirror delays an update but does not hide it.

For agent runtimes, package versions and checksums always come from the official npm registry. A mirror's version is trusted only when npm's registry signature on it checks out.

Your own settings win. If you set `npm_config_registry`, `GOPROXY`, `PIP_INDEX_URL`, `UV_DEFAULT_INDEX`, or `HF_ENDPOINT`, Linger uses yours and does not add its mirror in front.

## Force a region

Set `SIMPLEX_REGION` before you start Linger. A forced region is never rewritten by a fallback.

| Value | Effect |
| - | - |
| `cn` | Always try China mirrors first. |
| `global` | Always try the original hosts first. |
| `auto` or not set | Measure the network and reuse the saved result. |

For example, on macOS or Linux:

```bash theme={null}
SIMPLEX_REGION=cn open -a Linger
```

Any other value stops the installer with an error, so a typo does not go unnoticed.

## Reset the saved region

Delete `region.json` when you move a laptop between networks and downloads become slow:

```bash theme={null}
rm ~/.simplexai/runtime/region.json
```

Linger measures again on its next download. You do not lose anything else.

## Keep learning

> [card] [Install the desktop app](/docs/install/desktop-app.md)
>
> Download Linger and finish first setup.

> [card] [Fix common problems](/docs/admin/troubleshooting.md)
>
> Find what to check when setup or a download stalls.

> [card] [Run models locally](/docs/models/local-inference.md)
>
> See what Linger downloads for local models, and why.

> [card] [Upgrade and back up](/docs/admin/upgrade-and-backup.md)
>
> Keep Linger current and your data safe.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.