# tinker_cookbook.weights.download

### [**tinker_cookbook.weights.download**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/weights/_download.py#L16)( _tinker_path_, _output_dir_, _base_url_)

Download a checkpoint from Tinker storage to local disk.

Fetches a signed URL via the Tinker SDK, downloads the archive, and extracts it with security validation (rejects symlinks and path traversal).

**Parameters:**

- [**tinker_path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/weights/_download.py#L16) ( _str_) – Tinker checkpoint path, e.g. `"tinker://<run_id>/sampler_weights/final"`.
- [**output_dir**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/weights/_download.py#L16) ( _str_) – Local directory where the checkpoint will be extracted.
- [**base_url**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/weights/_download.py#L16) ( _str | None_) – Custom Tinker service URL. If `None` (default), uses the default Tinker service endpoint (or `TINKER_BASE_URL` environment variable if set).

**Returns:** Path to the extracted checkpoint directory.

**Raises:**

- WeightsDownloadError: If the archive contains unsafe entries.
- urllib.error.URLError: If the download fails.

```
from tinker_cookbook import weights
# Download from default Tinker service
adapter_dir = weights.download(
tinker_path="tinker://run-id/sampler_weights/final",
output_dir="./adapter",
)
# Download from a custom Tinker deployment
adapter_dir = weights.download(
tinker_path="tinker://run-id/sampler_weights/final",
output_dir="./adapter",
base_url="https://tinker.my-company.com",
)
```
