-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (33 loc) · 1.56 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (33 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Download model from huggingface
FROM python:3.13-alpine3.22 AS hfdownload
# The hf model "id" and actual "filename" within the hf repo,
# because alot of the times a quantized repo will have many available options.
# By default, use Qwen from ggml-org.
ARG MODEL_ID=ggml-org/Qwen3-1.7B-GGUF
ARG MODEL_FN=Qwen3-1.7B-Q4_K_M.gguf
WORKDIR /models
RUN pip install huggingface_hub && hf download ${MODEL_ID} ${MODEL_FN} --local-dir /models
# Use the llama.cpp server and copy our stuff into it
FROM ghcr.io/ggml-org/llama.cpp:server AS server
ARG CREATED
ARG LLMABDA_VERSION
ARG REVISION
ARG MODEL_FN=Qwen3-1.7B-Q4_K_M.gguf
LABEL org.opencontainers.image.title="llmabda"
LABEL org.opencontainers.image.description="Run LLM's on aws lambda for cheap."
LABEL org.opencontainers.image.version=$LLMABDA_VERSION
LABEL org.opencontainers.image.authors="pogzyb@umich.edu"
LABEL org.opencontainers.image.url="https://github.com/pogzyb/llmabda"
LABEL org.opencontainers.image.source="https://github.com/pogzyb/llmabda"
LABEL org.opencontainers.image.documentation="https://github.com/pogzyb/llmabda"
LABEL org.opencontainers.image.created=$CREATED
LABEL org.opencontainers.image.revision=$REVISION
LABEL org.opencontainers.image.licenses="MIT"
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.9.1 /lambda-adapter /opt/extensions/lambda-adapter
ENV AWS_LWA_PORT=8080
ENV AWS_LWA_ENABLE_COMPRESSION=true
ENV AWS_LWA_READINESS_CHECK_PATH=/health
COPY --from=hfdownload /models /models
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
ENV MODEL_PATH=/models/${MODEL_FN}
ENTRYPOINT ["entrypoint.sh"]