Skip to content

Commit a29b44c

Browse files
authored
Merge branch 'master' into default_miro
2 parents 3ac4fe1 + 80652ab commit a29b44c

55 files changed

Lines changed: 1533 additions & 531 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/checksum_checker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
token: ${{ secrets.UPDATE_BOT_TOKEN }}
4242
push-to-fork: ci-forks/LocalAI
4343
commit-message: ':arrow_up: Checksum updates in gallery/index.yaml'
44-
title: 'models(gallery): :arrow_up: update checksum'
44+
title: 'chore(model-gallery): :arrow_up: update checksum'
4545
branch: "update/checksum"
4646
body: Updating checksums in gallery/index.yaml
4747
signoff: true

.github/workflows/image-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
# makeflags: "--jobs=3 --output-sync=target"
4848
- build-type: 'cublas'
4949
cuda-major-version: "12"
50-
cuda-minor-version: "4"
50+
cuda-minor-version: "0"
5151
platforms: 'linux/amd64'
5252
tag-latest: 'false'
5353
tag-suffix: '-cublas-cuda12-ffmpeg'
@@ -120,7 +120,7 @@ jobs:
120120
# makeflags: "--jobs=3 --output-sync=target"
121121
# - build-type: 'cublas'
122122
# cuda-major-version: "12"
123-
# cuda-minor-version: "4"
123+
# cuda-minor-version: "0"
124124
# platforms: 'linux/amd64'
125125
# tag-latest: 'false'
126126
# tag-suffix: '-cublas-cuda12-ffmpeg-core'

.github/workflows/image.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
makeflags: "--jobs=3 --output-sync=target"
7676
- build-type: 'cublas'
7777
cuda-major-version: "12"
78-
cuda-minor-version: "4"
78+
cuda-minor-version: "0"
7979
platforms: 'linux/amd64'
8080
tag-latest: 'false'
8181
tag-suffix: '-cublas-cuda12'
@@ -100,7 +100,7 @@ jobs:
100100
makeflags: "--jobs=3 --output-sync=target"
101101
- build-type: 'cublas'
102102
cuda-major-version: "12"
103-
cuda-minor-version: "4"
103+
cuda-minor-version: "0"
104104
platforms: 'linux/amd64'
105105
tag-latest: 'auto'
106106
tag-suffix: '-cublas-cuda12-ffmpeg'
@@ -285,7 +285,7 @@ jobs:
285285
makeflags: "--jobs=4 --output-sync=target"
286286
- build-type: 'cublas'
287287
cuda-major-version: "12"
288-
cuda-minor-version: "4"
288+
cuda-minor-version: "0"
289289
platforms: 'linux/amd64'
290290
tag-latest: 'false'
291291
tag-suffix: '-cublas-cuda12-core'
@@ -307,7 +307,7 @@ jobs:
307307
makeflags: "--jobs=4 --output-sync=target"
308308
- build-type: 'cublas'
309309
cuda-major-version: "12"
310-
cuda-minor-version: "4"
310+
cuda-minor-version: "0"
311311
platforms: 'linux/amd64'
312312
tag-latest: 'false'
313313
tag-suffix: '-cublas-cuda12-ffmpeg-core'

.github/workflows/release.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- master
7+
tags:
8+
- 'v*'
79
pull_request:
810

911
env:
@@ -29,11 +31,10 @@ jobs:
2931
with:
3032
go-version: '1.21.x'
3133
cache: false
32-
3334
- name: Dependencies
3435
run: |
3536
sudo apt-get update
36-
sudo apt-get install build-essential ffmpeg protobuf-compiler ccache gawk
37+
sudo apt-get install build-essential ffmpeg protobuf-compiler ccache upx-ucl gawk
3738
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libgmock-dev
3839
- name: Install CUDA Dependencies
3940
run: |
@@ -149,7 +150,7 @@ jobs:
149150
- name: Dependencies
150151
run: |
151152
sudo apt-get update
152-
sudo apt-get install -y wget curl build-essential ffmpeg protobuf-compiler ccache gawk cmake libgmock-dev
153+
sudo apt-get install -y wget curl build-essential ffmpeg protobuf-compiler ccache upx-ucl gawk cmake libgmock-dev
153154
- name: Intel Dependencies
154155
run: |
155156
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
@@ -250,7 +251,7 @@ jobs:
250251
- name: Dependencies
251252
run: |
252253
sudo apt-get update
253-
sudo apt-get install -y --no-install-recommends libopencv-dev protobuf-compiler ccache
254+
sudo apt-get install -y --no-install-recommends libopencv-dev protobuf-compiler ccache upx-ucl
254255
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af
255256
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
256257
- name: Build stablediffusion

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Dependencies
7171
run: |
7272
sudo apt-get update
73-
sudo apt-get install build-essential curl ffmpeg
73+
sudo apt-get install build-essential ccache upx-ucl curl ffmpeg
7474
sudo apt-get install -y libgmock-dev
7575
curl https://repo.anaconda.com/pkgs/misc/gpgkeys/anaconda.asc | gpg --dearmor > conda.gpg && \
7676
sudo install -o root -g root -m 644 conda.gpg /usr/share/keyrings/conda-archive-keyring.gpg && \

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get update && \
2424
cmake \
2525
curl \
2626
git \
27-
unzip && \
27+
unzip upx-ucl && \
2828
apt-get clean && \
2929
rm -rf /var/lib/apt/lists/*
3030

@@ -99,7 +99,7 @@ FROM requirements-${IMAGE_TYPE} AS requirements-drivers
9999

100100
ARG BUILD_TYPE
101101
ARG CUDA_MAJOR_VERSION=12
102-
ARG CUDA_MINOR_VERSION=4
102+
ARG CUDA_MINOR_VERSION=0
103103

104104
ENV BUILD_TYPE=${BUILD_TYPE}
105105

Makefile

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ DETECT_LIBS?=true
88
# llama.cpp versions
99
GOLLAMA_REPO?=https://github.com/go-skynet/go-llama.cpp
1010
GOLLAMA_VERSION?=2b57a8ae43e4699d3dc5d1496a1ccd42922993be
11-
CPPLLAMA_VERSION?=705b7ecf60e667ced57c15d67aa86865e3cc7aa7
11+
CPPLLAMA_VERSION?=01245f5b1629075543bc4478418c7d72a0b4b3c7
1212

1313
# gpt4all version
1414
GPT4ALL_REPO?=https://github.com/nomic-ai/gpt4all
@@ -58,7 +58,7 @@ RANDOM := $(shell bash -c 'echo $$RANDOM')
5858

5959
VERSION?=$(shell git describe --always --tags || echo "dev" )
6060
# go tool nm ./local-ai | grep Commit
61-
LD_FLAGS?=
61+
LD_FLAGS?=-s -w
6262
override LD_FLAGS += -X "github.com/mudler/LocalAI/internal.Version=$(VERSION)"
6363
override LD_FLAGS += -X "github.com/mudler/LocalAI/internal.Commit=$(shell git rev-parse HEAD)"
6464

@@ -72,6 +72,14 @@ WHITE := $(shell tput -Txterm setaf 7)
7272
CYAN := $(shell tput -Txterm setaf 6)
7373
RESET := $(shell tput -Txterm sgr0)
7474

75+
UPX?=
76+
# check if upx exists
77+
ifeq (, $(shell which upx))
78+
UPX=
79+
else
80+
UPX=$(shell which upx)
81+
endif
82+
7583
# Default Docker bridge IP
7684
E2E_BRIDGE_IP?=172.17.0.1
7785

@@ -377,6 +385,7 @@ build: prepare backend-assets grpcs ## Build the project
377385
$(info ${GREEN}I BUILD_TYPE: ${YELLOW}$(BUILD_TYPE)${RESET})
378386
$(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET})
379387
$(info ${GREEN}I LD_FLAGS: ${YELLOW}$(LD_FLAGS)${RESET})
388+
$(info ${GREEN}I UPX: ${YELLOW}$(UPX)${RESET})
380389
ifneq ($(BACKEND_LIBS),)
381390
$(MAKE) backend-assets/lib
382391
cp -f $(BACKEND_LIBS) backend-assets/lib/
@@ -421,7 +430,7 @@ else
421430
endif
422431

423432
dist-cross-linux-arm64:
424-
CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_NATIVE=off" GRPC_BACKENDS="backend-assets/grpc/llama-cpp-fallback backend-assets/grpc/llama-cpp-grpc backend-assets/util/llama-cpp-rpc-server" \
433+
CMAKE_ARGS="$(CMAKE_ARGS) -DGGML_NATIVE=off" GRPC_BACKENDS="backend-assets/grpc/llama-cpp-fallback backend-assets/grpc/llama-cpp-grpc backend-assets/util/llama-cpp-rpc-server" GO_TAGS="p2p" \
425434
STATIC=true $(MAKE) build
426435
mkdir -p release
427436
# if BUILD_ID is empty, then we don't append it to the binary name
@@ -471,7 +480,7 @@ prepare-e2e:
471480
mkdir -p $(TEST_DIR)
472481
cp -rfv $(abspath ./tests/e2e-fixtures)/gpu.yaml $(TEST_DIR)/gpu.yaml
473482
test -e $(TEST_DIR)/ggllm-test-model.bin || wget -q https://huggingface.co/TheBloke/CodeLlama-7B-Instruct-GGUF/resolve/main/codellama-7b-instruct.Q2_K.gguf -O $(TEST_DIR)/ggllm-test-model.bin
474-
docker build --build-arg GRPC_BACKENDS="$(GRPC_BACKENDS)" --build-arg IMAGE_TYPE=core --build-arg BUILD_TYPE=$(BUILD_TYPE) --build-arg CUDA_MAJOR_VERSION=12 --build-arg CUDA_MINOR_VERSION=4 --build-arg FFMPEG=true -t localai-tests .
483+
docker build --build-arg GRPC_BACKENDS="$(GRPC_BACKENDS)" --build-arg IMAGE_TYPE=core --build-arg BUILD_TYPE=$(BUILD_TYPE) --build-arg CUDA_MAJOR_VERSION=12 --build-arg CUDA_MINOR_VERSION=0 --build-arg FFMPEG=true -t localai-tests .
475484

476485
run-e2e-image:
477486
ls -liah $(abspath ./tests/e2e-fixtures)
@@ -733,13 +742,22 @@ backend-assets/grpc: protogen-go replace
733742
backend-assets/grpc/bert-embeddings: sources/go-bert.cpp sources/go-bert.cpp/libgobert.a backend-assets/grpc
734743
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(CURDIR)/sources/go-bert.cpp LIBRARY_PATH=$(CURDIR)/sources/go-bert.cpp \
735744
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/bert-embeddings ./backend/go/llm/bert/
745+
ifneq ($(UPX),)
746+
$(UPX) backend-assets/grpc/bert-embeddings
747+
endif
736748

737749
backend-assets/grpc/gpt4all: sources/gpt4all sources/gpt4all/gpt4all-bindings/golang/libgpt4all.a backend-assets/gpt4all backend-assets/grpc
738750
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(CURDIR)/sources/gpt4all/gpt4all-bindings/golang/ LIBRARY_PATH=$(CURDIR)/sources/gpt4all/gpt4all-bindings/golang/ \
739751
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/gpt4all ./backend/go/llm/gpt4all/
752+
ifneq ($(UPX),)
753+
$(UPX) backend-assets/grpc/gpt4all
754+
endif
740755

741756
backend-assets/grpc/huggingface: backend-assets/grpc
742757
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/huggingface ./backend/go/llm/langchain/
758+
ifneq ($(UPX),)
759+
$(UPX) backend-assets/grpc/huggingface
760+
endif
743761

744762
backend/cpp/llama/llama.cpp:
745763
LLAMA_VERSION=$(CPPLLAMA_VERSION) $(MAKE) -C backend/cpp/llama llama.cpp
@@ -765,6 +783,9 @@ else
765783
echo "BUILD_GRPC_FOR_BACKEND_LLAMA is not defined."
766784
LLAMA_VERSION=$(CPPLLAMA_VERSION) $(MAKE) -C backend/cpp/${VARIANT} grpc-server
767785
endif
786+
ifneq ($(UPX),)
787+
$(UPX) backend/cpp/${VARIANT}/grpc-server
788+
endif
768789

769790
# This target is for manually building a variant with-auto detected flags
770791
backend-assets/grpc/llama-cpp: backend-assets/grpc backend/cpp/llama/llama.cpp
@@ -837,33 +858,57 @@ backend-assets/grpc/llama-cpp-grpc: backend-assets/grpc backend/cpp/llama/llama.
837858
backend-assets/util/llama-cpp-rpc-server: backend-assets/grpc/llama-cpp-grpc
838859
mkdir -p backend-assets/util/
839860
cp -rf backend/cpp/llama-grpc/llama.cpp/build/bin/rpc-server backend-assets/util/llama-cpp-rpc-server
861+
ifneq ($(UPX),)
862+
$(UPX) backend-assets/util/llama-cpp-rpc-server
863+
endif
840864

841865
backend-assets/grpc/llama-ggml: sources/go-llama.cpp sources/go-llama.cpp/libbinding.a backend-assets/grpc
842866
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(CURDIR)/sources/go-llama.cpp LIBRARY_PATH=$(CURDIR)/sources/go-llama.cpp \
843867
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/llama-ggml ./backend/go/llm/llama-ggml/
868+
ifneq ($(UPX),)
869+
$(UPX) backend-assets/grpc/llama-ggml
870+
endif
844871

845872
backend-assets/grpc/piper: sources/go-piper sources/go-piper/libpiper_binding.a backend-assets/grpc backend-assets/espeak-ng-data
846873
CGO_CXXFLAGS="$(PIPER_CGO_CXXFLAGS)" CGO_LDFLAGS="$(PIPER_CGO_LDFLAGS)" LIBRARY_PATH=$(CURDIR)/sources/go-piper \
847874
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/piper ./backend/go/tts/
875+
ifneq ($(UPX),)
876+
$(UPX) backend-assets/grpc/piper
877+
endif
848878

849879
backend-assets/grpc/rwkv: sources/go-rwkv.cpp sources/go-rwkv.cpp/librwkv.a backend-assets/grpc
850880
CGO_LDFLAGS="$(CGO_LDFLAGS)" C_INCLUDE_PATH=$(CURDIR)/sources/go-rwkv.cpp LIBRARY_PATH=$(CURDIR)/sources/go-rwkv.cpp \
851881
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/rwkv ./backend/go/llm/rwkv
882+
ifneq ($(UPX),)
883+
$(UPX) backend-assets/grpc/rwkv
884+
endif
852885

853886
backend-assets/grpc/stablediffusion: sources/go-stable-diffusion sources/go-stable-diffusion/libstablediffusion.a backend-assets/grpc
854887
CGO_LDFLAGS="$(CGO_LDFLAGS)" CPATH="$(CPATH):$(CURDIR)/sources/go-stable-diffusion/:/usr/include/opencv4" LIBRARY_PATH=$(CURDIR)/sources/go-stable-diffusion/ \
855888
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/stablediffusion ./backend/go/image/stablediffusion
889+
ifneq ($(UPX),)
890+
$(UPX) backend-assets/grpc/stablediffusion
891+
endif
856892

857893
backend-assets/grpc/tinydream: sources/go-tiny-dream sources/go-tiny-dream/libtinydream.a backend-assets/grpc
858894
CGO_LDFLAGS="$(CGO_LDFLAGS)" LIBRARY_PATH=$(CURDIR)/go-tiny-dream \
859895
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/tinydream ./backend/go/image/tinydream
896+
ifneq ($(UPX),)
897+
$(UPX) backend-assets/grpc/tinydream
898+
endif
860899

861900
backend-assets/grpc/whisper: sources/whisper.cpp sources/whisper.cpp/libwhisper.a backend-assets/grpc
862901
CGO_LDFLAGS="$(CGO_LDFLAGS) $(CGO_LDFLAGS_WHISPER)" C_INCLUDE_PATH="$(CURDIR)/sources/whisper.cpp/include:$(CURDIR)/sources/whisper.cpp/ggml/include" LIBRARY_PATH=$(CURDIR)/sources/whisper.cpp \
863902
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/whisper ./backend/go/transcribe/
903+
ifneq ($(UPX),)
904+
$(UPX) backend-assets/grpc/whisper
905+
endif
864906

865907
backend-assets/grpc/local-store: backend-assets/grpc
866908
$(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o backend-assets/grpc/local-store ./backend/go/stores/
909+
ifneq ($(UPX),)
910+
$(UPX) backend-assets/grpc/local-store
911+
endif
867912

868913
grpcs: prepare $(GRPC_BACKENDS)
869914

backend/cpp/llama/grpc-server.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,6 @@ static void params_parse(const backend::ModelOptions* request,
22592259
// get the directory of modelfile
22602260
std::string model_dir = params.model.substr(0, params.model.find_last_of("/\\"));
22612261
params.lora_adapter.push_back(std::make_tuple(model_dir + "/"+request->loraadapter(), scale_factor));
2262-
params.lora_base = model_dir + "/"+request->lorabase();
22632262
}
22642263
params.use_mlock = request->mlock();
22652264
params.use_mmap = request->mmap();

backend/python/autogptq/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
accelerate
22
auto-gptq==0.7.1
3-
grpcio==1.65.0
3+
grpcio==1.65.1
44
protobuf
55
torch
66
certifi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
accelerate
22
bark==0.1.5
3-
grpcio==1.65.0
3+
grpcio==1.65.1
44
protobuf
55
certifi
66
transformers

0 commit comments

Comments
 (0)