Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,31 @@ all: mac linux simple-responder
clean:
rm -rf $(BUILD_DIR)

test:
proxy/ui_dist/placeholder.txt:
mkdir -p proxy/ui_dist
touch $@

test: proxy/ui_dist/placeholder.txt
go test -short -v -count=1 ./proxy

test-all:
test-all: proxy/ui_dist/placeholder.txt
go test -v -count=1 ./proxy

# build react UI
ui:
cd ui && npm run build
Comment on lines +32 to +34
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

ui target should install dependencies first

If node_modules is absent in clean CI environments the build fails.
Consider a sentinel dependency to run npm ci once, e.g.:

ui: ui/node_modules.stamp
	cd ui && npm run build

ui/node_modules.stamp:
	cd ui && npm ci
	touch $@
🤖 Prompt for AI Agents
In the Makefile around lines 32 to 34, the `ui` target currently only runs the
build command without ensuring dependencies are installed, which causes failures
in clean CI environments. Modify the `ui` target to depend on a sentinel file
like `ui/node_modules.stamp` that triggers `npm ci` to install dependencies if
needed. Add a new target `ui/node_modules.stamp` that runs `npm ci` inside the
`ui` directory and then creates the stamp file to mark completion. This ensures
dependencies are installed before building.

# Build OSX binary
mac:
mac: ui
@echo "Building Mac binary..."
GOOS=darwin GOARCH=arm64 go build -ldflags="-X main.commit=${GIT_HASH} -X main.version=local_${GIT_HASH} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-darwin-arm64

# Build Linux binary
linux:
linux: ui
@echo "Building Linux binary..."
GOOS=linux GOARCH=amd64 go build -ldflags="-X main.commit=${GIT_HASH} -X main.version=local_${GIT_HASH} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-linux-amd64

# Build Windows binary
windows:
windows: ui
@echo "Building Windows binary..."
GOOS=windows GOARCH=amd64 go build -ldflags="-X main.commit=${GIT_HASH} -X main.version=local_${GIT_HASH} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-windows-amd64.exe

Expand Down Expand Up @@ -69,4 +76,4 @@ release:
git tag "$$new_tag";

# Phony targets
.PHONY: all clean mac linux windows simple-responder
.PHONY: all clean ui mac linux windows simple-responder
5 changes: 5 additions & 0 deletions config.example.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# ======
# For a more detailed configuration example:
# https://github.com/mostlygeek/llama-swap/wiki/Configuration
# ======

# Seconds to wait for llama.cpp to be available to serve requests
# Default (and minimum): 15 seconds
healthCheckTimeout: 90
Expand Down
1 change: 1 addition & 0 deletions proxy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ui_dist/*
Binary file removed proxy/html/favicon.ico
Binary file not shown.
14 changes: 0 additions & 14 deletions proxy/html/index.html

This file was deleted.

259 changes: 0 additions & 259 deletions proxy/html/logs.html

This file was deleted.

10 changes: 0 additions & 10 deletions proxy/html_files.go

This file was deleted.

Loading