Skip to content

Commit

Permalink
Merge pull request #2 from clouvet/add-default-model
Browse files Browse the repository at this point in the history
Pull a default model on start
  • Loading branch information
kylemclaren authored Aug 14, 2024
2 parents 964b6b2 + e1e6b7d commit 701024d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ app = '' # change this before deploying!
primary_region = 'ord'

[env]
DEFAULT_MODEL = 'llama3.1:8b'
OLLAMA_BASE_URL = 'http://localhost:11434'
OLLAMA_MODELS = '/app/backend/data/models'

Expand Down
11 changes: 11 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ mkdir -p /app/backend/data/models

/bin/ollama serve &

# Wait until Ollama service is up and running
until curl -s http://localhost:11434 > /dev/null; do
echo 'Waiting for Ollama service to start...';
sleep 1;
done

if ! [ -e "$DEFAULT_MODEL" ]; then
echo "Pulling default model: $DEFAULT_MODEL"
ollama pull $DEFAULT_MODEL &
fi

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR" || exit

Expand Down

0 comments on commit 701024d

Please sign in to comment.