mirror of
https://github.com/mostlygeek/llama-swap.git
synced 2026-09-07 16:37:22 +02:00
Validate JSON Schema / validate-schema (push) Successful in 37s
Build Containers / build-and-push (cpu) (push) Failing after 39s
Build Containers / build-and-push (cuda) (push) Failing after 30s
Build Containers / build-and-push (cuda13) (push) Failing after 29s
Build Containers / build-and-push (intel) (push) Failing after 30s
Build Containers / build-and-push (musa) (push) Failing after 29s
Build Containers / build-and-push (rocm) (push) Failing after 40s
Build Containers / build-and-push (vulkan) (push) Failing after 32s
Build Containers / delete-untagged-containers (push) Skipped
Linux CI / run-tests (push) Failing after 2m33s
UI Tests / run-tests (push) Successful in 43s
Windows CI / run-tests (push) Canceled after 0s
Add an Docs agent to the playground that can help the user with more advanced configuration. - add mcp 2026-07-28 (stateless mcp) framework - add MCP tools for doc search and config search - add initial set of guides for key topics - add Docs to the Playground - removed out of data documentation and plans
110 lines
3.9 KiB
Makefile
110 lines
3.9 KiB
Makefile
# Define variables for the application
|
|
APP_NAME = llama-swap
|
|
BUILD_DIR = build
|
|
|
|
# Get closest tag or if that fails (no git repo or no tags) then devel
|
|
GIT_VERSION := $(shell git describe --abbrev=6 --tags 2>/dev/null || echo devel)
|
|
# Get the current Git hash
|
|
GIT_HASH := $(shell git rev-parse --short HEAD)
|
|
ifneq ($(shell git status --porcelain),)
|
|
# There are untracked changes
|
|
GIT_HASH := $(GIT_HASH)+
|
|
endif
|
|
|
|
# Capture the current build date in RFC3339 format
|
|
BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
|
|
# Default target: Builds binaries for both OSX and Linux
|
|
all: mac linux simple-responder
|
|
|
|
# Clean build directory
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
# use cached test results while developing
|
|
test-dev:
|
|
go test -short ./...
|
|
staticcheck ./... || true
|
|
|
|
test:
|
|
go test -short -count=1 ./internal/...
|
|
|
|
# for CI - full test (takes longer)
|
|
test-all:
|
|
go test -race -count=1 ./internal/...
|
|
|
|
ui/node_modules:
|
|
cd ui && npm install
|
|
|
|
# build the UI into internal/server/ui_dist; the `embed_ui` build tag embeds
|
|
# this output into the binary (see internal/server/embed.go)
|
|
ui: ui/node_modules
|
|
cd ui && npm run build
|
|
|
|
# Build OSX binary
|
|
mac: ui
|
|
@echo "Building Mac binary..."
|
|
GOOS=darwin GOARCH=arm64 go build -tags embed_ui -ldflags="-X main.commit=${GIT_HASH} -X main.version=${GIT_VERSION} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-darwin-arm64
|
|
|
|
# Build Linux binary
|
|
linux: linux-arm64 linux-amd64
|
|
|
|
linux-amd64: ui
|
|
@echo "Building Linux AMD64 binary..."
|
|
GOOS=linux GOARCH=amd64 go build -tags embed_ui -ldflags="-X main.commit=${GIT_HASH} -X main.version=${GIT_VERSION} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-linux-amd64
|
|
|
|
linux-arm64: ui
|
|
@echo "Building Linux ARM64 binary..."
|
|
GOOS=linux GOARCH=arm64 go build -tags embed_ui -ldflags="-X main.commit=${GIT_HASH} -X main.version=${GIT_VERSION} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-linux-arm64
|
|
|
|
# Build Windows binary
|
|
windows: ui
|
|
@echo "Building Windows binary..."
|
|
GOOS=windows GOARCH=amd64 go build -tags embed_ui -ldflags="-X main.commit=${GIT_HASH} -X main.version=${GIT_VERSION} -X main.date=${BUILD_DATE}" -o $(BUILD_DIR)/$(APP_NAME)-windows-amd64.exe
|
|
|
|
# for testing with real external processes
|
|
simple-responder:
|
|
@echo "Building simple responder"
|
|
GOOS=darwin GOARCH=arm64 go build -o $(BUILD_DIR)/simple-responder_darwin_arm64 cmd/simple-responder/simple-responder.go
|
|
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)/simple-responder_linux_amd64 cmd/simple-responder/simple-responder.go
|
|
|
|
simple-responder-windows:
|
|
@echo "Building simple responder for windows"
|
|
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)/simple-responder.exe cmd/simple-responder/simple-responder.go
|
|
|
|
# Ensure build directory exists
|
|
$(BUILD_DIR):
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
# Create a new release tag
|
|
release:
|
|
@echo "Checking for unstaged changes..."
|
|
@if [ -n "$(shell git status --porcelain)" ]; then \
|
|
echo "Error: There are unstaged changes. Please commit or stash your changes before creating a release tag." >&2; \
|
|
exit 1; \
|
|
fi
|
|
|
|
# Get the highest tag in v{number} format, increment it, and create a new tag
|
|
@highest_tag=$$(git tag --sort=-v:refname | grep -E '^v[0-9]+$$' | head -n 1 || echo "v0"); \
|
|
new_tag="v$$(( $${highest_tag#v} + 1 ))"; \
|
|
echo "tagging new version: $$new_tag"; \
|
|
git tag "$$new_tag";
|
|
|
|
GOOS ?= $(shell go env GOOS 2>/dev/null || echo linux)
|
|
GOARCH ?= $(shell go env GOARCH 2>/dev/null || echo amd64)
|
|
wol-proxy: $(BUILD_DIR)
|
|
@echo "Building wol-proxy"
|
|
go build -o $(BUILD_DIR)/wol-proxy-$(GOOS)-$(GOARCH)-$(shell date +%Y-%m-%d) cmd/wol-proxy/wol-proxy.go
|
|
|
|
test-ui:
|
|
cd ui && npm ci && npm run check && npm test
|
|
|
|
# Score the Playground's Docs Agent against a local model. Builds and starts
|
|
# llama-swap itself; see evals/docs-agent/README.md for the tuning loop.
|
|
eval-docs-agent:
|
|
./evals/docs-agent/run.sh $(EVAL_ARGS)
|
|
|
|
# Phony targets
|
|
.PHONY: all clean ui mac windows simple-responder simple-responder-windows test test-all test-dev test-ui wol-proxy eval-docs-agent
|
|
.PHONY: linux linux-arm64 linux-amd64
|