Skip to content

Commit

Permalink
CI: Abstract the steps to prepare the LLM
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Mar 4, 2024
1 parent 3609eed commit 91ca2ce
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 45 deletions.
19 changes: 19 additions & 0 deletions .github/actions/prepare-llm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Prepare llama.cpp and Phi 2
description: Build llama.cpp and load Phi 2
runs:
using: "composite"
steps:
- name: Get and build llama.cpp
shell: bash
run: |
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
make server
- name: Download Phi 2 model
shell: bash
run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf

- name: Run llama.cpp with Phi 2
shell: bash
run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &
12 changes: 3 additions & 9 deletions .github/workflows/test-babashka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,10 @@ jobs:

- run: bb --version

- name: Get and build llama.cpp
run: git clone https://github.com/ggerganov/llama.cpp.git && cd llama.cpp && make
- name: Prepare LLM (Phi 2)
uses: ./.github/actions/prepare-llm

- name: Download Phi 2 model
run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf

- name: Run llama.cpp with Phi 2
run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &

- name: Wait until the API server is ready
- name: Wait until the LLM server is ready
run: while ! curl -s 'http://localhost:8080/health' | grep 'ok'; do sleep 1; done
timeout-minutes: 3

Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,10 @@ jobs:

- run: bun --version

- name: Get and build llama.cpp
run: git clone https://github.com/ggerganov/llama.cpp.git && cd llama.cpp && make
- name: Prepare LLM (Phi 2)
uses: ./.github/actions/prepare-llm

- name: Download Phi 2 model
run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf

- name: Run llama.cpp with Phi 2
run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &

- name: Wait until the API server is ready
- name: Wait until the LLM server is ready
run: while ! curl -s 'http://localhost:8080/health' | grep 'ok'; do sleep 1; done
timeout-minutes: 3

Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test-cpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,10 @@ jobs:
with:
python-version: '3.10'

- name: Get and build llama.cpp
run: git clone https://github.com/ggerganov/llama.cpp.git && cd llama.cpp && make
- name: Prepare LLM (Phi 2)
uses: ./.github/actions/prepare-llm

- name: Download Phi 2 model
run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf

- name: Run llama.cpp with Phi 2
run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &

- name: Wait until the API server is ready
- name: Wait until the LLM server is ready
run: while ! curl -s 'http://localhost:8080/health' | grep 'ok'; do sleep 1; done
timeout-minutes: 3

Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,10 @@ jobs:
with:
node-version: '18'

- name: Get and build llama.cpp
run: git clone https://github.com/ggerganov/llama.cpp.git && cd llama.cpp && make
- name: Prepare LLM (Phi 2)
uses: ./.github/actions/prepare-llm

- name: Download Phi 2 model
run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf

- name: Run llama.cpp with Phi 2
run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &

- name: Wait until the API server is ready
- name: Wait until the LLM server is ready
run: while ! curl -s 'http://localhost:8080/health' | grep 'ok'; do sleep 1; done
timeout-minutes: 3

Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test-pypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ jobs:

- run: pypy3 --version

- name: Get and build llama.cpp
run: git clone https://github.com/ggerganov/llama.cpp.git && cd llama.cpp && make
- name: Prepare LLM (Phi 2)
uses: ./.github/actions/prepare-llm

- name: Download Phi 2 model
run: curl -OL https://huggingface.co/TheBloke/dolphin-2_6-phi-2-GGUF/resolve/main/dolphin-2_6-phi-2.Q3_K_M.gguf

- name: Run llama.cpp with Phi 2
run: ./llama.cpp/server --host 0.0.0.0 -m ./dolphin-2_6-phi-2.Q3_K_M.gguf &

- name: Wait until the API server is ready
- name: Wait until the LLM server is ready
run: while ! curl -s 'http://localhost:8080/health' | grep 'ok'; do sleep 1; done
timeout-minutes: 3

Expand Down

0 comments on commit 91ca2ce

Please sign in to comment.