Merge pull request #848 from Patrice-Gaudicheau/feat-makefile-llm-update

This commit is contained in:
Timothy Jaeryang Baek 2024-02-28 16:38:54 -05:00 committed by GitHub
commit 941ab5d6cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 43 additions and 0 deletions

25
Makefile Normal file
View File

@ -0,0 +1,25 @@
install:
@docker-compose up -d
remove:
@chmod +x confirm_remove.sh
@./confirm_remove.sh
start:
@docker-compose start
stop:
@docker-compose stop
update:
# Calls the LLM update script
chmod +x update_ollama_models.sh
@./update_ollama_models.sh
@git pull
@docker-compose down
# Make sure the ollama-webui container is stopped before rebuilding
@docker stop open-webui || true
@docker-compose up --build -d
@docker-compose start

8
confirm_remove.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
echo "Warning: This will remove all containers and volumes, including persistent data. Do you want to continue? [Y/N]"
read ans
if [ "$ans" == "Y" ] || [ "$ans" == "y" ]; then
docker-compose down -v
else
echo "Operation cancelled."
fi

10
update_ollama_models.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# update_llm.sh
# Retrieves the list of LLMs installed in the Docker container
llm_list=$(docker exec ollama ollama list | tail -n +2 | awk '{print $1}')
# Loop over each LLM to update it
for llm in $llm_list; do
docker exec ollama ollama pull $llm
done