-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #14 Signed-off-by: mudler <[email protected]>
- Loading branch information
Showing
9 changed files
with
110 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
models/*.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
THREADS=14 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
llama-cli | ||
llama-cli | ||
models/*.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG GO_VERSION=1.20 | ||
ARG DEBIAN_VERSION=11 | ||
|
||
FROM golang:$GO_VERSION as builder | ||
|
||
WORKDIR /build | ||
RUN git clone --recurse-submodules https://github.com/go-skynet/go-llama.cpp | ||
RUN cd go-llama.cpp && make libbinding.a | ||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
RUN go mod download | ||
RUN apt-get update | ||
COPY . . | ||
RUN go mod edit -replace github.com/go-skynet/go-llama.cpp=/build/go-llama.cpp | ||
RUN C_INCLUDE_PATH=/build/go-llama.cpp LIBRARY_PATH=/build/go-llama.cpp go build -o llama-cli ./ | ||
|
||
FROM debian:$DEBIAN_VERSION | ||
COPY --from=builder /build/llama-cli /usr/bin/llama-cli | ||
ENTRYPOINT [ "/usr/bin/llama-cli" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,5 @@ | ||
VERSION 0.7 | ||
|
||
go-deps: | ||
ARG GO_VERSION=1.20 | ||
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 | ||
RUN git clone --recurse-submodules https://github.com/go-skynet/go-llama.cpp | ||
RUN cd go-llama.cpp && make libbinding.a | ||
COPY . . | ||
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 ./ | ||
SAVE ARTIFACT llama-cli AS LOCAL llama-cli | ||
|
||
image: | ||
FROM +go-deps | ||
ARG IMAGE=alpaca-cli-nomodel | ||
COPY +build/llama-cli /llama-cli | ||
ENTRYPOINT [ "/llama-cli" ] | ||
SAVE IMAGE --push $IMAGE | ||
|
||
image-all: | ||
BUILD --platform=linux/amd64 --platform=linux/arm64 +image | ||
FROM DOCKERFILE -f Dockerfile . | ||
SAVE ARTIFACT /usr/bin/llama-cli AS LOCAL llama-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.6' | ||
|
||
services: | ||
api: | ||
image: quay.io/go-skynet/llama-cli:latest | ||
build: . | ||
volumes: | ||
- ./models:/models | ||
ports: | ||
- 8080:8080 | ||
environment: | ||
- MODELS_PATH=/models | ||
- CONTEXT_SIZE=700 | ||
- THREADS=$THREADS | ||
command: api |
Empty file.