Skip to main content

LLAMP - Large Language Model for Planning

Project description

LLamp - Large Languge Models for Planning

This is a package that uses LLMs (closed and open-source) for planning.

Pre-requisites:

  1. Python3.9
  2. (recommended) virtualenv

Installation:

  1. pip install -r requirements.txt
  2. alfworld-download
  3. pip install -e . (this installs llamp)

Exporting API Keys:

  1. export OPENAI_API_KEY=""
  2. export CEREBRAS_API_KEY=""
  3. ... (and so on for all the providers you want to use, e.g. Anthropic, Nvidia, Cohere)

Testing everything works:

  1. Basic test:
cd test
./test.sh
  1. More advanced test:
cd root_folder
./playgrounds/run_alfworld_eval.sh test_ours

Running Evaluation

  1. Running Eval:
cd root_folder
./playgrounds/run_alfworld_eval.sh cerebras_main

Creating Conda Env: (Note this might be work in progress)

conda env create -f environment_stateact.yml -n env_name

Webshop, Run from Docker:

docker container run -p 3000:3000 ainikolai/webshop:latest

Previous README (currently being archived and refactored.)

WARNING PACKAGE IS STILL UNDER DEVELOPMENT and requirements needs cleaning up.

Installation:

  1. Textworld Game (pip install textworld)
  2. Textworld Visualisation (pip install -r requirements_textworld_visualisation.txt)
  3. (install chromedriver or firefox driver)

Playgame:

The following is accepted:

python3 playgrounds/playground_tw_gym.py {human/openai/...} --custom/--simple {PARAMS}

e.g.:

python3 playgrounds/playground_tw_gym.py human --custom 1 2 2

Or:

  1. (In terminal with browser visualiser) tw-play tw_games/first_game.z8 --viewer
  2. (as Gym environement in terminal) python3 playgrounds/playground_tw_gym.py

Generate New Textworld games using helper script

python3 generate_games.py --simple/--custom {PARAMS}

e.g.

python3 generate_games.py --custom 2 2 2 1234

Generate New Textworld games using TW

  1. tw-make custom --world-size 2 --nb-objects 10 --quest-length 5 --seed 1234 --output games/tw_games/w2_o10_l5_game.z8

  2. tw-make tw-simple --rewards dense --goal detailed --seed 1234 --output games/tw_games/simple/r_dense__g_detailed__seed_1234.z8

Rewards: (dense, balanced, sparse) Goal: (detailed, brief, none)

Reference: [https://textworld.readthedocs.io/en/stable/tw-make.html#types-of-game-to-create]

Available Commands to agent:

Available commands:
  look:                describe the current room
  goal:                print the goal of this game
  inventory:           print player's inventory
  go <dir>:            move the player north, east, south or west
  examine ...:         examine something more closely
  eat ...:             eat edible food
  open ...:            open a door or a container
  close ...:           close a door or a container
  drop ...:            drop an object on the floor
  take ...:            take an object that is on the floor
  put ... on ...:      place an object on a supporter
  take ... from ...:   take an object from a container or a supporter
  insert ... into ...: place an object into a container
  lock ... with ...:   lock a door or a container with a key
  unlock ... with ...: unlock a door or a container with a key

Running jupyter notebooks in your own environment:

  1. [https://medium.com/@WamiqRaza/how-to-create-virtual-environment-jupyter-kernel-python-6836b50f4bf4]
pip install ipython
pip install ipykernel

ipython kernel install --user --name=myenv

python -m ipykernel install --user --name=myenv

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llamp-0.0.15.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llamp-0.0.15-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file llamp-0.0.15.tar.gz.

File metadata

  • Download URL: llamp-0.0.15.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for llamp-0.0.15.tar.gz
Algorithm Hash digest
SHA256 8aa8e756dc7543643dab27210da83f07ad93fab3ef25c4f601ac93f9fa994e11
MD5 3a5e5e264eac562f43846b38610e39b5
BLAKE2b-256 ba3ecf094e4a99cab7f83844c60d96595e7e3a7e4262e2ce7d02df8ecb494f2f

See more details on using hashes here.

File details

Details for the file llamp-0.0.15-py3-none-any.whl.

File metadata

  • Download URL: llamp-0.0.15-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for llamp-0.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 41dbeb02f07e0c72e7ff9106f1bbd718f533f5c52295002268d1194e2427e698
MD5 b19c6a6fede931755a1e64c3d3bdc9b2
BLAKE2b-256 1ba4fb3d3f1a01ca824a4e4563c381a706cf31b26e9d4027bdcf074c9271806d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page