Skip to content

Commit fe10622

Browse files
authored
Merge pull request #546 from doringeman/fix-llamacpp-makefile
Fix unforked llamacpp
2 parents 0d439d1 + 9bf9df1 commit fe10622

3 files changed

Lines changed: 19 additions & 14 deletions

File tree

llamacpp/Makefile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ ifeq ($(DETECTED_OS),macOS)
3030
-DGGML_NATIVE=OFF \
3131
-DGGML_OPENMP=OFF \
3232
-DLLAMA_CURL=OFF \
33+
-DLLAMA_BUILD_COMMON=ON \
34+
-DLLAMA_BUILD_SERVER=ON \
35+
-DLLAMA_BUILD_TOOLS=ON \
3336
-GNinja \
3437
-S $(NATIVE_DIR)
3538
@echo "Building..."
@@ -43,6 +46,9 @@ ifeq ($(DETECTED_OS),macOS)
4346
rm -rf $(INSTALL_DIR)/lib/cmake
4447
rm -rf $(INSTALL_DIR)/lib/pkgconfig
4548
rm -rf $(INSTALL_DIR)/include
49+
@echo "Fixing rpath..."
50+
install_name_tool -delete_rpath "$(CURDIR)/$(BUILD_DIR)/bin" $(INSTALL_DIR)/bin/com.docker.llama-server
51+
install_name_tool -add_rpath "@executable_path/../lib" $(INSTALL_DIR)/bin/com.docker.llama-server
4652
@echo "Build complete! Binaries are in $(INSTALL_DIR)"
4753
else ifeq ($(DETECTED_OS),Linux)
4854
@echo "Linux build not implemented yet"
@@ -80,16 +86,16 @@ clean:
8086
rm -rf $(INSTALL_DIR)
8187

8288
build-dir:
83-
@echo "$(shell pwd)/$(BUILD_DIR)"
89+
@echo "$(CURDIR)/$(BUILD_DIR)"
8490

8591
install-dir:
86-
@echo "$(shell pwd)/$(INSTALL_DIR)"
92+
@echo "$(CURDIR)/$(INSTALL_DIR)"
8793

8894
help:
8995
@echo "Available targets:"
90-
@echo " build - Build llama.cpp (macOS only for now)"
91-
@echo " install-deps - Install build dependencies"
92-
@echo " build-dir - Print build directory path"
93-
@echo " install-dir - Print install directory path"
94-
@echo " clean - Clean build artifacts"
95-
@echo " help - Show this help"
96+
@echo " build - Build llama.cpp (macOS only for now)"
97+
@echo " install-deps - Install build dependencies"
98+
@echo " build-dir - Print build directory path"
99+
@echo " install-dir - Print install directory path"
100+
@echo " clean - Clean build artifacts"
101+
@echo " help - Show this help"

llamacpp/native/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ if (DDLLAMA_BUILD_SERVER)
4141

4242
add_custom_target(com.docker.llama-server ALL DEPENDS "${LLAMA_SERVER_DST}")
4343

44-
# Install the renamed binary using TARGETS instead of PROGRAMS for better cross-platform support
45-
install(TARGETS llama-server
46-
RUNTIME DESTINATION bin
47-
RENAME "com.docker.llama-server${CMAKE_EXECUTABLE_SUFFIX}")
44+
# Install the renamed binary
45+
install(PROGRAMS "${LLAMA_SERVER_DST}" DESTINATION bin)
4846
endif()
4947

5048
if (WIN32 AND DDLLAMA_BUILD_UTILS)

pkg/inference/scheduling/runner.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,9 @@ func (r *runner) wait(ctx context.Context) error {
222222
return r.err
223223
default:
224224
}
225-
// Create and execute a request targeting a known-valid endpoint.
226-
readyRequest, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost/v1/models", http.NoBody)
225+
// Create and execute a request targeting the health endpoint.
226+
// Note: /health returns 503 during model loading, 200 when ready.
227+
readyRequest, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost/health", http.NoBody)
227228
if err != nil {
228229
return fmt.Errorf("readiness request creation failed: %w", err)
229230
}

0 commit comments

Comments
 (0)