diff --git a/.air.toml b/.air.toml new file mode 100644 index 000000000..123d7272c --- /dev/null +++ b/.air.toml @@ -0,0 +1,7 @@ +# .air.toml +[build] +cmd = "make build" +bin = "./local-ai" +include_ext = ["go", "html", "yaml", "toml", "json", "txt", "md"] +exclude_dir = ["pkg/grpc/proto"] +delay = 1000 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fb200120..5ca7df7fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,6 +30,7 @@ Thank you for your interest in contributing to LocalAI! We appreciate your time 3. Install the required dependencies ( see https://localai.io/basics/build/#build-localai-locally ) 4. Build LocalAI: `make build` 5. Run LocalAI: `./local-ai` +6. To Build and live reload: `make build-dev` ## Contributing @@ -76,7 +77,7 @@ LOCALAI_IMAGE_TAG=test LOCALAI_IMAGE=local-ai-aio make run-e2e-aio ## Documentation We are welcome the contribution of the documents, please open new PR or create a new issue. The documentation is available under `docs/` https://github.com/mudler/LocalAI/tree/master/docs - + ## Community and Communication - You can reach out via the Github issue tracker. diff --git a/Makefile b/Makefile index 03e4efccb..d1938411a 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,10 @@ build-launcher: ## Build the launcher application build-all: build build-launcher ## Build both server and launcher +build-dev: ## Run LocalAI in dev mode with live reload + @command -v air >/dev/null 2>&1 || go install github.com/air-verse/air@latest + air -c .air.toml + dev-dist: $(GORELEASER) build --snapshot --clean