OpenELM is an open-source library by CarperAI, designed to enable evolutionary search with language models in both code and natural language.
The OpenELM project has the following goals:
For QDAIF: poetry domain currently implemented in main, and other experiment code with few-shot LMX domains currently in experimental branch
pip install openelm
To use the sodarace environment, you must first pip install swig.
Then:
pip install openelm[sodaracer]
See the pyproject.toml for further install options.
OpenELM supports the quality-diversity algorithms MAP-Elites, CVT-MAP-Elites, and Deep Grid MAP-Elites, as well as a simple genetic algorithm baseline.
OpenELM supports:
OpenELM’s language models are instantiated as Langchain classes by default, which means that OpenELM can support practically any existing LLM API, as well as models run on your local GPU via HuggingFace Transformers.
We also provide optional Nvidia Triton Inference Server support, intended for use cases where low latency on 8 or more GPUs is important. Finally, for code generation domains, we provide a sandbox environment, consisting of a container server backed with gVisor (a container runtime that introduces an additional barrier between the host and the container) as well as a heuristic-based safety guard.
Roughly, ELM consists of a pipeline of different components:
Environment class. This class defines the mechanics of how to initialize members of the population, mutate them with the desired operator, and how to measure the fitness (and diversity) of individuals.MAPElites class. This class describes how the evolutionary algorithm works, and can be viewed as a wrapper around the environment defining the selection algorithm for generated individuals.MutationModel class, which is responsible for running the LLM to actually generate new individuals. This functions as a wrapper around the LangChain API. The environment is expected to call the MutationModel when a new individual is needed.ELM class calls the MAPElites algorithm class and runs the search.All options for these classes are defined in configs.py, via dataclasses which are registered as a hydra config, and can be overriden via the command line when running one of the example scripts such as run_elm.py.
python run_elm.py will start an ELM evolutionary search using the defaults listed in configs.py. These can be overriden via the command line. For example, you can use run_elm.py env=image_evolution to run the Image Evolution environment.
To use the code execution sandbox, see the sandboxing readme for instructions to set it up in a Docker container with the gVisor runtime.
We also have code available to run models in Nvidia's Triton Inference Server. See the Triton Readme to get started
If you'd like to contribute or have questions, go to the #openelm channel on the CarperAI discord!
1,836 followers · starred Nov 2022
479 followers · starred Feb 2023
1,479 followers · starred Nov 2022
941 followers · starred Nov 2022
OpenELM is an open-source library by CarperAI, designed to enable evolutionary search with language models in both code and natural language.
The OpenELM project has the following goals:
For QDAIF: poetry domain currently implemented in main, and other experiment code with few-shot LMX domains currently in experimental branch
pip install openelm
To use the sodarace environment, you must first pip install swig.
Then:
pip install openelm[sodaracer]
See the pyproject.toml for further install options.
OpenELM supports the quality-diversity algorithms MAP-Elites, CVT-MAP-Elites, and Deep Grid MAP-Elites, as well as a simple genetic algorithm baseline.
OpenELM supports:
OpenELM’s language models are instantiated as Langchain classes by default, which means that OpenELM can support practically any existing LLM API, as well as models run on your local GPU via HuggingFace Transformers.
We also provide optional Nvidia Triton Inference Server support, intended for use cases where low latency on 8 or more GPUs is important. Finally, for code generation domains, we provide a sandbox environment, consisting of a container server backed with gVisor (a container runtime that introduces an additional barrier between the host and the container) as well as a heuristic-based safety guard.
Roughly, ELM consists of a pipeline of different components:
Environment class. This class defines the mechanics of how to initialize members of the population, mutate them with the desired operator, and how to measure the fitness (and diversity) of individuals.MAPElites class. This class describes how the evolutionary algorithm works, and can be viewed as a wrapper around the environment defining the selection algorithm for generated individuals.MutationModel class, which is responsible for running the LLM to actually generate new individuals. This functions as a wrapper around the LangChain API. The environment is expected to call the MutationModel when a new individual is needed.ELM class calls the MAPElites algorithm class and runs the search.All options for these classes are defined in configs.py, via dataclasses which are registered as a hydra config, and can be overriden via the command line when running one of the example scripts such as run_elm.py.
python run_elm.py will start an ELM evolutionary search using the defaults listed in configs.py. These can be overriden via the command line. For example, you can use run_elm.py env=image_evolution to run the Image Evolution environment.
To use the code execution sandbox, see the sandboxing readme for instructions to set it up in a Docker container with the gVisor runtime.
We also have code available to run models in Nvidia's Triton Inference Server. See the Triton Readme to get started
If you'd like to contribute or have questions, go to the #openelm channel on the CarperAI discord!
1,836 followers · starred Nov 2022
479 followers · starred Feb 2023
1,479 followers · starred Nov 2022
941 followers · starred Nov 2022