Skip to content

Commit b51ca01

Browse files
authored
Merge pull request #356 from doringeman/make-run-local-llama
build: add LOCAL_LLAMA for make run to run with locally build llama.cpp on macOS
2 parents 10e184e + 29dc9a2 commit b51ca01

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@ model-distribution-tool:
4242

4343
# Run the application locally
4444
run: build
45-
LLAMA_ARGS="$(LLAMA_ARGS)" \
46-
./$(APP_NAME)
45+
@LLAMACPP_BIN="llamacpp/install/bin"; \
46+
if [ "$(LOCAL_LLAMA)" = "1" ]; then \
47+
echo "Using local llama.cpp build from $${LLAMACPP_BIN}"; \
48+
export LLAMA_SERVER_PATH="$$(pwd)/$${LLAMACPP_BIN}"; \
49+
fi; \
50+
LLAMA_ARGS="$(LLAMA_ARGS)" ./$(APP_NAME)
4751

4852
# Clean build artifacts
4953
clean:
@@ -154,9 +158,11 @@ help:
154158
@echo ""
155159
@echo "Backend configuration options:"
156160
@echo " LLAMA_ARGS - Arguments for llama.cpp (e.g., \"--verbose --jinja -ngl 999 --ctx-size 2048\")"
161+
@echo " LOCAL_LLAMA - Use local llama.cpp build from llamacpp/install/bin (set to 1 to enable)"
157162
@echo ""
158163
@echo "Example usage:"
159164
@echo " make run LLAMA_ARGS=\"--verbose --jinja -ngl 999 --ctx-size 2048\""
165+
@echo " make run LOCAL_LLAMA=1"
160166
@echo " make docker-run LLAMA_ARGS=\"--verbose --jinja -ngl 999 --threads 4 --ctx-size 2048\""
161167
@echo ""
162168
@echo "Model distribution tool examples:"

0 commit comments

Comments
 (0)