Skip to content

feat: do not bundle llama-cpp anymore #5790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jul 18, 2025
Merged

Conversation

mudler
Copy link
Owner

@mudler mudler commented Jul 4, 2025

Description

This PR fixes #

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Copy link

netlify bot commented Jul 4, 2025

Deploy Preview for localai ready!

Name Link
🔨 Latest commit feecf58
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/687a2abfc9ffd40008172e46
😎 Deploy Preview https://deploy-preview-5790--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mudler mudler force-pushed the feat/build-llama-cpp-externally branch 3 times, most recently from 4980a37 to 608264c Compare July 7, 2025 09:38
@mudler mudler mentioned this pull request Jul 8, 2025
1 task
@mudler mudler force-pushed the feat/build-llama-cpp-externally branch 2 times, most recently from d1569f2 to f3b1c38 Compare July 8, 2025 17:22
@richiejp
Copy link
Collaborator

richiejp commented Jul 8, 2025

So a completely separate Dockerfile and Makefile? This will be a major improvement!

@mudler
Copy link
Owner Author

mudler commented Jul 9, 2025

So a completely separate Dockerfile and Makefile? This will be a major improvement!

yup! my plan is to isolate everything, one backend at a time. Currently the llama.cpp one is the most heavy, having also lots of specific code in the golang part - ideally I want to get rid of all of the specific llama.cpp code and the binary bundling bits out of the main code.

This is how I'm testing things now with #5816 in:

docker build --build-arg BACKEND=llama-cpp -t llama-cpp-backend -f backend/Dockerfile.llama-cpp .
docker save llama-cpp-backend -o llama-backend.tar
local-ai backends install "ocifile://$PWD/llama-backend.tar"

@mudler mudler force-pushed the feat/build-llama-cpp-externally branch 3 times, most recently from 4005854 to 630fdba Compare July 10, 2025 16:54
@mudler mudler added the enhancement New feature or request label Jul 11, 2025
@github-actions github-actions bot added the ci label Jul 11, 2025
@mudler mudler force-pushed the feat/build-llama-cpp-externally branch 3 times, most recently from 0c1529b to ae65455 Compare July 13, 2025 16:28
@mudler mudler force-pushed the feat/build-llama-cpp-externally branch 9 times, most recently from 1072662 to c90a0e8 Compare July 14, 2025 20:44
@mudler mudler changed the title [WIP] feat: build llama cpp externally feat: build llama cpp externally Jul 14, 2025
mudler added 24 commits July 18, 2025 09:29
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
@mudler mudler force-pushed the feat/build-llama-cpp-externally branch from fe05d6b to b038c5a Compare July 18, 2025 07:30
@mudler
Copy link
Owner Author

mudler commented Jul 18, 2025

Any tips on testing this? Does it significantly change the build process for those compiling locally? (So does this require a README update?)

yes actually good point, my plan is to remove all the backends outside so we can build LocalAI in a simpler way by using standard golang tooling. At that point I will re-work documentation, at this stage is not really functional and in a "transient" state. However, for now the steps are the same:

make build # Will build local-ai, with some backends still included in the binary

The difference is in how backends are built. If you want llama-cpp, for example, you can install it from the Backends tab in the webui, or with localai backends install. If you want to build it instead and install you can run:

make docker-build-llama-cpp
make docker-save-llama-cpp
./local-ai backends install ocifile://$PWD/backend-images/llama-cpp.tar

This does the following:

  • Builds the backend with docker
  • Save the result as a standard container image
  • Install it in local-ai (in the default backends folder, next to the binary)

Signed-off-by: Ettore Di Giacinto <[email protected]>
@mudler mudler force-pushed the feat/build-llama-cpp-externally branch from b038c5a to feecf58 Compare July 18, 2025 11:06
@mudler mudler merged commit 294f702 into master Jul 18, 2025
27 checks passed
@mudler mudler deleted the feat/build-llama-cpp-externally branch July 18, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants