> For the complete documentation index, see [llms.txt](https://world-models-from-scratch.gitbook.io/wmfs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://world-models-from-scratch.gitbook.io/wmfs/chapters/chapter_02/02-choose-a-setup.md).

# 2.2 Choose a Setup

You can read this chapter and use the included figures and rollout explorer without installing anything.

To run the Python examples with the included videos, use the basic setup below. To generate new rollouts, complete the basic setup and the optional GPU setup.

## Basic Setup

Clone the repository, create a virtual environment, and install the project:

```bash
git clone https://github.com/nahidalam/world_model_from_scratch
cd world_model_from_scratch
python -m venv wm_env
source wm_env/bin/activate
pip install -r requirements.txt
pip install -e .
```

This environment can load and analyze the included videos. It does not install the Cosmos inference stack.

## Generate New Rollouts (Optional)

Generation requires Linux and an NVIDIA GPU visible to PyTorch. The verified configuration used about 33 GB of memory on an NVIDIA A40; plan for a GPU with at least 40 GB of memory.

On Ubuntu, install the system libraries and the verified Cosmos dependencies:

```bash
sudo apt-get install -y libxcb1 libgl1 libglib2.0-0
pip install -r requirements-chapter-02-gpu.txt
pip install torch==2.6.0 torchvision==0.21.0 \
  --index-url https://download.pytorch.org/whl/cu124
```

The Cosmos-Predict checkpoint is gated. Accept its license on the [model page](https://huggingface.co/nvidia/Cosmos-Predict2.5-2B), then sign in:

```bash
hf auth login
```

If the default Hugging Face cache does not have enough space, choose another location before loading the model:

```bash
export HF_HOME=/path/with/space
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://world-models-from-scratch.gitbook.io/wmfs/chapters/chapter_02/02-choose-a-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
