LocalAI/Earthfile

33 lines
959 B
Plaintext
Raw Normal View History

2023-03-19 23:40:32 +00:00
VERSION 0.7
2023-03-18 22:59:06 +00:00
go-deps:
2023-03-19 23:46:49 +00:00
ARG GO_VERSION=1.20
2023-03-18 22:59:06 +00:00
FROM golang:$GO_VERSION
WORKDIR /build
COPY go.mod ./
COPY go.sum ./
RUN go mod download
RUN apt-get update
SAVE ARTIFACT go.mod AS LOCAL go.mod
SAVE ARTIFACT go.sum AS LOCAL go.sum
build:
FROM +go-deps
WORKDIR /build
2023-04-07 08:08:15 +00:00
RUN git clone --recurse-submodules https://github.com/go-skynet/go-llama.cpp
RUN cd go-llama.cpp && make libbinding.a
2023-03-18 22:59:06 +00:00
COPY . .
2023-04-07 08:08:15 +00:00
RUN go mod edit -replace github.com/go-skynet/go-llama.cpp=/build/go-llama.cpp
RUN C_INCLUDE_PATH=$GOPATH/src/github.com/go-skynet/go-llama.cpp LIBRARY_PATH=$GOPATH/src/github.com/go-skynet/go-llama.cpp go build -o llama-cli ./
2023-03-18 22:59:06 +00:00
SAVE ARTIFACT llama-cli AS LOCAL llama-cli
image:
2023-03-23 17:50:43 +00:00
FROM +go-deps
ARG IMAGE=alpaca-cli-nomodel
COPY +build/llama-cli /llama-cli
ENTRYPOINT [ "/llama-cli" ]
SAVE IMAGE --push $IMAGE
2023-03-23 17:50:43 +00:00
image-all:
BUILD --platform=linux/amd64 --platform=linux/arm64 +image