File tree Expand file tree Collapse file tree 4 files changed +3
-31
lines changed
Expand file tree Collapse file tree 4 files changed +3
-31
lines changed Original file line number Diff line number Diff line change 1- # Temporary server warmup option workaround.
2- # https://github.com/Mozilla-Ocho/llamafile/issues/485
3- FROM node:20 as llamafile-builder
4- RUN mkdir /opt/local && \
5- cd /tmp && \
6- git clone https://github.com/Mozilla-Ocho/llamafile.git && \
7- cd llamafile && \
8- git checkout 21a30bed && \
9- make && \
10- make install PREFIX=/opt/local
11-
121FROM node:20
132
143# Create llamafile files
@@ -24,9 +13,6 @@ RUN apt-get update && \
2413RUN wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf && \
2514 chmod +x /usr/bin/ape
2615
27- # Copy llamafile build.
28- COPY --from=llamafile-builder /opt/local /usr/local
29-
3016# Lambda Web Adapter
3117COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
3218ENV AWS_LWA_INVOKE_MODE=response_stream
Original file line number Diff line number Diff line change 44source ./variables.sh
55
66mkdir -p $llamafiledir
7- mkdir -p ./tmp/bin
87
98if [ ! -f " $llamafiledir /$llamafile " ]; then
109 curl -L " $llamafileurl " -o " $llamafiledir /$llamafile "
Original file line number Diff line number Diff line change 11#! /bin/sh
22set -e
33
4- LLAMAFILE_PATH=${LLAMAFILE_PATH:- $(find " /opt/llamafile" -name " *.llamafile" -o -name " *.gguf " - type f)}
4+ LLAMAFILE_PATH=${LLAMAFILE_PATH:- $(find " /opt/llamafile" -name " *.llamafile" -type f)}
55
66echo " Starting llamafile ${LLAMAFILE_PATH} ..."
77
8- # Options that might make sense for you:
9- #
10- # --path /nonexistent
11- # Avoid serving the non-API web interface.
12-
13- llamafile \
14- --model $LLAMAFILE_PATH \
8+ $LLAMAFILE_PATH \
159 --server \
1610 --fast \
1711 --threads " $( nproc) " \
1812 --gpu DISABLE \
13+ --no-warmup \
1914 --timeout 600 \
2015 --nobrowser \
2116 --log-disable \
Original file line number Diff line number Diff line change 1-
21llamafile=gemma-2-9b-it.Q2_K.llamafile
32llamafileurl=" https://huggingface.co/jartine/gemma-2-9b-it-llamafile/resolve/main/gemma-2-9b-it.Q2_K.llamafile"
4-
5- # llamafile=Mistral-7B-Instruct-v0.3.Q4_0.llamafile
6- # llamafileurl="https://huggingface.co/Mozilla/Mistral-7B-Instruct-v0.3-llamafile/resolve/main/Mistral-7B-Instruct-v0.3.Q4_0.llamafile"
7-
8- # llamafile=Phi-3-mini-4k-instruct.Q2_K.llamafile
9- # llamafileurl="https://huggingface.co/Mozilla/Phi-3-mini-4k-instruct-llamafile/resolve/main/Phi-3-mini-4k-instruct.Q2_K.llamafile"
10-
113llamafileimage=" llamafile-on-lambda"
124llamafiledir=" ./tmp/llamafile"
You can’t perform that action at this time.
0 commit comments