Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions llamacpp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ ifeq ($(DETECTED_OS),macOS)
-DGGML_NATIVE=OFF \
-DGGML_OPENMP=OFF \
-DLLAMA_CURL=OFF \
-DLLAMA_BUILD_COMMON=ON \
-DLLAMA_BUILD_SERVER=ON \
-DLLAMA_BUILD_TOOLS=ON \
-GNinja \
-S $(NATIVE_DIR)
@echo "Building..."
Expand All @@ -43,6 +46,9 @@ ifeq ($(DETECTED_OS),macOS)
rm -rf $(INSTALL_DIR)/lib/cmake
rm -rf $(INSTALL_DIR)/lib/pkgconfig
rm -rf $(INSTALL_DIR)/include
@echo "Fixing rpath..."
install_name_tool -delete_rpath "$(shell pwd)/$(BUILD_DIR)/bin" $(INSTALL_DIR)/bin/com.docker.llama-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the built-in $(CURDIR) variable is preferred over $(shell pwd). It's more efficient as it avoids forking a shell process and is a standard practice in GNU Makefiles.

	install_name_tool -delete_rpath "$(CURDIR)/$(BUILD_DIR)/bin" $(INSTALL_DIR)/bin/com.docker.llama-server

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install_name_tool -add_rpath "@executable_path/../lib" $(INSTALL_DIR)/bin/com.docker.llama-server
@echo "Build complete! Binaries are in $(INSTALL_DIR)"
else ifeq ($(DETECTED_OS),Linux)
@echo "Linux build not implemented yet"
Expand Down Expand Up @@ -87,9 +93,9 @@ install-dir:

help:
@echo "Available targets:"
@echo " build - Build llama.cpp (macOS only for now)"
@echo " install-deps - Install build dependencies"
@echo " build-dir - Print build directory path"
@echo " install-dir - Print install directory path"
@echo " clean - Clean build artifacts"
@echo " help - Show this help"
@echo " build - Build llama.cpp (macOS only for now)"
@echo " install-deps - Install build dependencies"
@echo " build-dir - Print build directory path"
@echo " install-dir - Print install directory path"
@echo " clean - Clean build artifacts"
@echo " help - Show this help"
6 changes: 2 additions & 4 deletions llamacpp/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ if (DDLLAMA_BUILD_SERVER)

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

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

if (WIN32 AND DDLLAMA_BUILD_UTILS)
Expand Down
5 changes: 3 additions & 2 deletions pkg/inference/scheduling/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ func (r *runner) wait(ctx context.Context) error {
return r.err
default:
}
// Create and execute a request targeting a known-valid endpoint.
readyRequest, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost/v1/models", http.NoBody)
// Create and execute a request targeting the health endpoint.
// Note: /health returns 503 during model loading, 200 when ready.
readyRequest, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost/health", http.NoBody)
if err != nil {
return fmt.Errorf("readiness request creation failed: %w", err)
}
Expand Down