Prototype of a system that answers questions about climate change impacts on planned human activities.
You should have Docker installed. Then execute:
docker pull koldunovn/climsight:stable
docker run -p 8501:8501 -e OPENAI_API_KEY=$OPENAI_API_KEY climsight
Then open http://localhost:8501/
in your browser.
You should have the following packages installed:
- git
- wget
- docker
As long as you have them, do:
git clone https://github.com/koldunovn/climsight.git
cd climsight
./download_data.sh
docker build -t climsight .
docker run -p 8501:8501 climsight
Then open http://localhost:8501/
in your browser. If you don't want to add OpenAI key every time, you can expose it through:
docker run -p 8501:8501 -e OPENAI_API_KEY=$OPENAI_API_KEY climsight
where $OPENAI_API_KEY
not necessarily should be environment variable, you can insert the key directly.
If you do not have an OpenAI key but want to test Climsight without sending requests to OpenAI, you can run Climsight with the skipLLMCall
argument:
docker run -p 8501:8501 -e STREAMLIT_ARGS="skipLLMCall" climsight
The easiest way is to install it through conda or mamba. We recommend mamba, as it's faster.
Install mamba if you don't have it.
git clone https://github.com/koldunovn/climsight.git
cd climsight
Create environment and install necessary packages:
mamba env create -f environment.yml
Activate the environment:
conda activate climsight
pip install climsight
For installation, use either pip alone for all packages and dependencies in a pure Python setup, or use mamba for dependencies followed by pip for Climsight in a Conda environment. Mixing package sources can lead to conflicts and is generally not recommended.
You have to download example climate data and NaturalEarth coastlines. To do it simply run:
python download_data.py
You would also need an OpenAI API key to run the prototype. You can provide it as environment variable:
export OPENAI_API_KEY="???????"
config settings
There is a possibility to also provide it in the running app. The cost of each request (status September 2023) is about 6 cents with gpt-4
and about 0.3 cents with gpt-3.5-turbo
(you can change it in the config file).
Moreover, if you want to use your own climate data, please adjust the data_settings, variable_mappings, and dimension_mappings according to the structure of your NetCDF files.
And you need to export the path of the configuration file. If you don't want to exchange anything and just test the prepared version, simply run
export CONFIG_PATH="./config.yml"
Otherwise you might want to adjust this path to direct to an individual config file, but keep in mind that it must be a path relative to the one from where you are running climsight. Also, you will have to adjust the paths in the config file you are using to point back to the climsight data folder.
There is a possibility to also provide it in the running app. The cost of each request (status September 2023) is about 6 cents with gpt-4
and about 0.3 cents with gpt-3.5-turbo
(you can change it in the beggining of climsight.py
script).
Change to the climsight
folder:
cd climsight
streamlit run src/climsight/climsight.py
If you install climsight via pip, make sure to run it in the directory where the data folder has been downloaded:
climsight
The browser window should pop up, with the app running. Ask the questions and don't forget to press "Generate".
![Screenshot 2023-09-26 at 15 26 51](https://private-user-images.githubusercontent.com/3407313/282266958-569a4c38-a601-4014-b10d-bd34c59b91bb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMxNTU5NDEsIm5iZiI6MTcyMzE1NTY0MSwicGF0aCI6Ii8zNDA3MzEzLzI4MjI2Njk1OC01NjlhNGMzOC1hNjAxLTQwMTQtYjEwZC1iZDM0YzU5YjkxYmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MDhUMjIyMDQxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MmVhYzNkMDVkMmE4Mjk2YTdjYTNkNDBjYjRhNGQyM2U3MDg4NGRiYzMzZDJhOGJhYTAwZDEyZGJlZGYzOTU0MCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.7l6-4VnS15ZNlojgdREHLJDlXI06-PMWK0kUxPwyHLw)
If you do not have an OpenAI key but want to test Climsight without sending requests to OpenAI, you can run Climsight with the skipLLMCall
argument:
streamlit run src/climsight/climsight.py skipLLMCall
If you use or refer to ClimSight in your work, please cite the following publication:
Koldunov, N., Jung, T. Local climate services for all, courtesy of large language models. Commun Earth Environ 5, 13 (2024). https://doi.org/10.1038/s43247-023-01199-1