Skip to content

Commit 7af2398

Browse files
committed
Use no warmup
1 parent a723d49 commit 7af2398

File tree

4 files changed

+3
-31
lines changed

4 files changed

+3
-31
lines changed

Dockerfile

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
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-
121
FROM node:20
132

143
# Create llamafile files
@@ -24,9 +13,6 @@ RUN apt-get update && \
2413
RUN 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
3117
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
3218
ENV AWS_LWA_INVOKE_MODE=response_stream

bin/build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set -e
44
source ./variables.sh
55

66
mkdir -p $llamafiledir
7-
mkdir -p ./tmp/bin
87

98
if [ ! -f "$llamafiledir/$llamafile" ]; then
109
curl -L "$llamafileurl" -o "$llamafiledir/$llamafile"

src/command

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
#!/bin/sh
22
set -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

66
echo "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 \

variables.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
21
llamafile=gemma-2-9b-it.Q2_K.llamafile
32
llamafileurl="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-
113
llamafileimage="llamafile-on-lambda"
124
llamafiledir="./tmp/llamafile"

0 commit comments

Comments
 (0)