Initial Setup
Setting up ESBMC-AI is easy, you can install it following these steps:
Install Package
pip install esbmc-ai
Alternatively, PipX can be used to install in an isolated environment:
pipx install esbmc-ai
Now, ESBMC-AI can be invoked with the following command:
esbmc-ai ...
Setting the Environment Variables
ESBMC-AI expects the following environment variables to be set:
ESBMCAI_CONFIG_PATH
- Points to the config file that ESBMC-AI requires to run.OPENAI_API_KEY
- Assuming you want to use OpenAI servers.
By default the envoronment variables are searched in the following locations in the order presented:
- Exported env vars ie.
export ESBMCAI_CONFIG_PATH="~/.config/esbmc-ai.toml"
.env
file in the current directory, moving upwards in the directory tree.esbmc-ai.env
file in the current directory, moving upwards in the directory tree.esbmc-ai.env
file in$HOME/.config/
for Linux/macOS and%userprofile%
for Windows.
If none are found, or they don’t contain the variables required, an error will be thrown.
Creating the Config
Create a TOML file: esbmc-ai.toml
and save it in a desiarable location. You can save it to $HOME/.config/
for Linux/macOS and %userprofile%
for Windows.
ESBMC-AI provides the following command which allows you to view all the editable config fields:
esbmc-ai help-config
You can add those fields and their desired values in the config file.
Notice
A sample config file can be found here. Keep in mind that it might not work without configuring and it should be used as a template to create your own config file.
Set Environment Variables
Upon running ESBMC-AI you will notice it gives you an error that some environment variables need to be set. The following environment files need to be set.
export ESBMCAI_CONFIG_FILE="..."
export OPENAI_API_KEY="..." # If you want to use an OpenAI model
export ANTHROPIC_API_KEY="..." # If you want to use an Anthropic model
Install a Verifier
ESBMC-AI supports multiple verifiers. There is a built-in support for ESBMC. ESBMC-AI does not come with the original ESBMC binary. In order to use ESBMC-AI you must download ESBMC. Download the ESBMC executable or build from source.
Configuring ESBMC-AI
See Configuring for how to setup the config file.