Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ BALROG is a novel benchmark evaluating agentic LLM and VLM capabilities on long-

## Installation

We advise using conda for the installation
We advise using [uv](https://docs.astral.sh/uv/) for the installation. First, [install uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.

```bash
conda create -n balrog python=3.10 -y
conda activate balrog

git clone https://github.com/balrog-ai/BALROG.git
cd BALROG
pip install -e .
uv sync
source .venv/bin/activate # On Windows: .venv\Scripts\activate
balrog-post-install
```

Expand Down
2 changes: 1 addition & 1 deletion balrog/environments/textworld/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ And on macOS, with

brew install libffi curl git

> **Note:** We advise our users to use virtual environments to avoid Python packages from different projects to interfere with each other. Popular choices are [Conda Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) and [Virtualenv](https://virtualenv.pypa.io/en/stable/)
> **Note:** We advise our users to use virtual environments to avoid Python packages from different projects to interfere with each other. Popular choices are [uv](https://docs.astral.sh/uv/), [Virtualenv](https://virtualenv.pypa.io/en/stable/), and [Conda Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)

### Installing TextWorld

Expand Down
25 changes: 13 additions & 12 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04

RUN apt-get update && apt-get install -y \
python3.10 \
python3.10-dev \
python3.10-venv \
python3-pip \
python3-dev \
python3-venv \
unzip \
vim \
tmux \
Expand All @@ -14,25 +15,25 @@ RUN apt-get update && apt-get install -y \
curl \
wget

ARG PYTHON_VERSION=3.10
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /opt/conda_setup
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.cargo/bin:$PATH"

RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x miniconda.sh && \
./miniconda.sh -b -p /opt/conda && \
/opt/conda/bin/conda install -y python=$PYTHON_VERSION && \
/opt/conda/bin/conda clean -ya
ENV PATH=/opt/conda/bin:$PATH
# Set python3.10 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

RUN python -m pip install --upgrade pip ipython ipdb
# Install ipython and ipdb globally with uv
RUN uv pip install --system ipython ipdb

COPY . /opt/balrog/

WORKDIR /opt/balrog

RUN pip install '.'
# Install the package with uv
RUN uv pip install --system .
RUN balrog-post-install

CMD ["/bin/bash"]
5 changes: 3 additions & 2 deletions docs/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ If you would like to work on any of the open Issues:

**do not** work on the `main` branch.

4. Set up a development environment by running the following command in a virtual (or conda) environment:
4. Set up a development environment using uv:

```bash
pip install -e '.[dev]'
uv sync --extra dev
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```

5. Develop the features on your branch.
Expand Down
11 changes: 6 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Installation

We advise using conda for the installation
```
conda create -n balrog python=3.10 -y
conda activate balrog
We advise using [uv](https://docs.astral.sh/uv/) for the installation. First, [install uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already.

```bash
git clone https://github.com/balrog-ai/BALROG.git
cd BALROG
pip install -e .
uv sync
source .venv/bin/activate # On Windows: .venv\Scripts\activate
balrog-post-install
```

**Note:** On Mac, make sure you have `wget` installed for the `balrog-post-install` script.


Test your installation by running:

Expand Down
76 changes: 75 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,79 @@
[build-system]
requires = ["setuptools>=58.0.0", "wheel"]
requires = ["setuptools>=68.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "balrog"
version = "0.1.0"
description = "Benchmark for Agentic LLM and VLM Reasoning On Games"
readme = "README.md"
requires-python = ">=3.10"
license = {text = "MIT"}
authors = [
{name = "Davide Paglieri"}
]
keywords = ["reinforcement learning", "ai", "nlp", "llm"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"openai",
"anthropic",
"google-generativeai",
"hydra-core",
"opencv-python-headless",
"wandb",
"pytest",
"scipy",
"crafter",
"gym==0.23",
"requests",
"balrog-nle",
"minihack @ git+https://github.com/balrog-ai/minihack.git",
"textworld @ git+https://github.com/balrog-ai/TextWorld.git",
"tatsu==5.8.3",
"minigrid @ git+https://github.com/BartekCupial/Minigrid.git",
"baba @ git+https://github.com/nacloos/baba-is-ai.git",
]

[project.optional-dependencies]
dev = [
"black",
"isort>=5.12",
"pytest<8.0",
"flake8",
"pre-commit",
"twine",
]

[project.scripts]
balrog-post-install = "balrog.scripts.post_install:main"

[project.urls]
Homepage = "https://github.com/DavidePaglieri/BALROG/"
Website = "https://www.balrogai.com/"

[tool.setuptools]
package-dir = {"" = "."}

[tool.setuptools.packages.find]
where = ["."]
include = ["balrog*"]

[tool.setuptools.package-data]
balrog = [
"config/config.yaml",
"environments/nle/achievements.json",
"environments/nle/Hack-Regular.ttf",
"environments/nle/tiles.pkl",
"environments/nle/Tiles16x16.png",
]

[tool.black]
line-length = 120
Expand Down
72 changes: 6 additions & 66 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,8 @@
import setuptools
"""
Minimal setup.py shim for backward compatibility.
All package configuration is now in pyproject.toml.
"""
from setuptools import setup

with open("README.md", "r") as f:
long_description = f.read()

setup(
# Information
name="balrog",
description="Benchmark for Agentic LLM and VLM Reasoning On Games",
long_description=long_description,
long_description_content_type="text/markdown",
version="0.1.0",
url="https://github.com/DavidePaglieri/BALROG/",
author="Davide Paglieri",
license="MIT",
keywords="reinforcement learning ai nlp llm",
project_urls={
"website": "https://www.balrogai.com/",
},
install_requires=[
"openai",
"anthropic",
"google-generativeai",
"hydra-core",
"opencv-python-headless",
"wandb",
"pytest",
"scipy",
"crafter",
"gym==0.23",
"requests",
"balrog-nle",
"minihack @ git+https://github.com/balrog-ai/minihack.git",
"textworld @ git+https://github.com/balrog-ai/TextWorld.git",
"tatsu==5.8.3",
"minigrid @ git+https://github.com/BartekCupial/Minigrid.git",
"baba @ git+https://github.com/nacloos/baba-is-ai.git",
],
entry_points={
"console_scripts": [
"balrog-post-install=balrog.scripts.post_install:main",
],
},
extras_require={
"dev": [
"black",
"isort>=5.12",
"pytest<8.0",
"flake8",
"pre-commit",
"twine",
]
},
package_dir={"": "./"},
packages=setuptools.find_packages(where="./", include=["balrog*"]),
package_data={
"balrog": [
"config/config.yaml",
"environments/nle/achievements.json",
"environments/nle/Hack-Regular.ttf",
"environments/nle/tiles.pkl",
"environments/nle/Tiles16x16.png",
]
},
include_package_data=True,
python_requires=">=3.8",
)
# All configuration is in pyproject.toml
setup()