Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion multipass/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
if ! multipass list | grep $vm_name | grep Running > /dev/null
then
echo 'Creating and provisioning multipass VM...'
multipass launch --name $vm_name $ubuntu_version
multipass launch --name $vm_name $ubuntu_version --disk 15G
multipass stop $vm_name
multipass mount --type native $script_dir/../roles $vm_name:$target_dir/.ansible/roles
multipass mount --type native $script_dir $vm_name:$target_dir/test
Expand Down
8 changes: 8 additions & 0 deletions roles/llama.cpp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# llama.cpp role
This role installs [llama.cpp](https://github.com/ggml-org/llama.cpp), relying on a built version of llama.cpp created by
https://github.com/guardian/transcription-service/blob/main/.github/workflows/build-llama-cpp.yaml

You can control which build of llama.cpp gets baked in via the llama_cpp_build_stage flag and the riffraff project
`investigations::transcription-service-llama-cpp`.

This role expects the AWS Deep Learning AMI as the base image, which provides CUDA drivers and toolkit out of the box.
3 changes: 3 additions & 0 deletions roles/llama.cpp/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
target_dir: /opt/llama
llama_cpp_build_stage: PROD
3 changes: 3 additions & 0 deletions roles/llama.cpp/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
dependencies:
- aws-tools
34 changes: 34 additions & 0 deletions roles/llama.cpp/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
- name: Create target and models directory
file:
path: "{{ target_dir }}"
state: directory
owner: ubuntu
group: ubuntu
recurse: yes

- name: Download compiled llama.cpp project
shell: |
aws s3 cp s3://amigo-data-{{ model_script_stage.lower() }}/deploy/{{ llama_cpp_build_stage }}/llama-cpp/llama-cpp-cuda.zip /tmp/llama-cpp-cuda.zip
unzip -o /tmp/llama-cpp-cuda.zip -d {{ target_dir }}

- name: Set ownership of llama directory
file:
path: "{{ target_dir }}"
owner: ubuntu
group: ubuntu
recurse: yes

- name: Symlink llama-cli into /usr/local/bin
file:
src: "{{ target_dir }}/llama.cpp/install/bin/llama-cli"
dest: /usr/local/bin/llama-cli
state: link

- name: Symlink llama-server into /usr/local/bin
file:
src: "{{ target_dir }}/llama.cpp/install/bin/llama-server"
dest: /usr/local/bin/llama-server
state: link


Loading