Skip to content

comflife/alpamayo

 
 

Repository files navigation

🏔️ Alpamayo-R1

Bridging Reasoning and Action Prediction for Generalizable Autonomous Driving

HuggingFace arXiv License

1. Install uv (if not already installed)

curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"

2. Set up the environment

uv venv ar1_venv
source ar1_venv/bin/activate
uv sync --active

3. Authenticate with HuggingFace

The model requires access to gated resources. Request access here:

Then authenticate:

hf auth login

Get your token at: https://huggingface.co/settings/tokens

Running Inference

Test script

NOTE: This script will download both some example data (relatively small) and the model weights (22 GB). The latter can be particularly slow depending on network bandwidth. For reference, it takes around 2.5 minutes on a 100 MB/s wired connection.

python src/alpamayo_r1/test_inference.py

In case you would like to obtain more trajectories and reasoning traces, please feel free to change the num_traj_samples=1 argument to a higher number (Line 60).

Interactive notebook

We provide a notebook with similar inference code at notebook/inference.ipynb.

Project Structure

alpamayo_r1_release/
├── notebook/
│   └── inference.ipynb                  # Example notebook
├── src/
│   └── alpamayo_r1/
│       ├── action_space/
│       │   └── ...                      # Action space definitions
│       ├── diffusion/
│       │   └── ...                      # Diffusion model components
│       ├── geometry/
│       │   └── ...                      # Geometry utilities and modules
│       ├── models/
│       │   ├── ...                      # Model components and utils functions
│       ├── __init__.py                  # Package marker
│       ├── config.py                    # Model and experiment configuration
│       ├── helper.py                    # Utility functions
│       ├── load_physical_aiavdataset.py # Dataset loader
│       ├── test_inference.py            # Inference test script
├── pyproject.toml                       # Project dependencies
└── uv.lock                              # Locked dependency versions

Troubleshooting

Flash Attention issues

The model uses Flash Attention 2 by default. If you encounter compatibility issues:

# Use PyTorch's scaled dot-product attention instead
config.attn_implementation = "sdpa"

License

Apache License 2.0 - see LICENSE for details.

Disclaimer

Alpamayo-R1 is a pre-trained reasoning model designed to accelerate research and development in the autonomous vehicle (AV) domain. It is intended to serve as a foundation for a range of AV-related use cases-from instantiating an end-to-end backbone for autonomous driving to enabling reasoning-based auto-labeling tools. In short, it should be viewed as a building block for developing customized AV applications.

Important notes:

  • Alpamayo-R1 is provided solely for research, experimentation, and evaluation purposes.
  • Alpamayo-R1 is not a fully fledged driving stack. Among other limitations, it lacks access to critical real-world sensor inputs, does not incorporate required diverse and redundant safety mechanisms, and has not undergone automotive-grade validation for deployment.

By using this model, you acknowledge that it is a research tool intended to support scientific inquiry, benchmarking, and exploration—not a substitute for a certified AV stack. The developers and contributors disclaim any responsibility or liability for the use of the model or its outputs.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 97.6%
  • Shell 1.3%
  • Jupyter Notebook 1.1%