# Install and license

> Install yhatmodels, accept the model license once, and run offline after the first download.

## Install

```bash
pip install yhatmodels
```

Python 3.10 or later. It installs PyTorch, NumPy, pandas, safetensors and the Hugging Face Hub client. For plots, install
`pip install "yhatmodels[plot]"`, which adds matplotlib.

The model runs on an NVIDIA GPU, an Apple GPU or the CPU, in that order of preference. Pick one with
`ChakraTS.from_pretrained("ChakraTS-OS-10M", device="cpu")` (or `"cuda"`, `"mps"`). A laptop CPU is enough; see
[Speed and devices](https://yhatlabs.com/models/docs/open-models/speed).

## Accept the license once

The weights are free for non-commercial use under the [Chakra Non-Commercial Model License](https://yhatlabs.com/models/docs/open-models/license).
The first download asks you to accept it once, with a free YHat Labs account:

- **On your computer:** your browser opens. Sign in or create an account, accept, and the download starts.
- **Over SSH:** the terminal shows a link. Open it on any device and paste back the token it shows.
- **On a server or in CI:** set `YHAT_MODELS_TOKEN`, copied from [yhatlabs.com/models/license](https://yhatlabs.com/models/license),
  or run `yhatmodels accept-license ChakraTS-OS-10M` once in a terminal.

The token is saved in `~/.cache/yhatmodels/token`, so you do this once per machine. An API key in `YHAT_API_KEY` works
too. Set `YHATMODELS_NO_BROWSER=1` to never open a browser.

## Offline and private

After the first download the weights stay in the Hugging Face cache, and later runs need no network. The model runs
entirely on your machine: the only call to YHat Labs is the license check before the first download, which sends your
token and nothing else.

## Commercial use

For production or commercial use, use ChakraTS through the [YHat Labs API](https://yhatlabs.com/models/docs/quickstart), or write to
[licensing@yhatlabs.com](mailto:licensing@yhatlabs.com) for a commercial license.
