forked from open-webui/open-webui
Merge pull request #848 from Patrice-Gaudicheau/feat-makefile-llm-update
This commit is contained in:
commit
941ab5d6cf
3 changed files with 43 additions and 0 deletions
25
Makefile
Normal file
25
Makefile
Normal 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
8
confirm_remove.sh
Executable 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
10
update_ollama_models.sh
Normal 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
|
Loading…
Reference in a new issue