feat: localchat, a Go + Templ + HTMX chat app for local Gemma models
Streams replies over SSE from any OpenAI-compatible server (oMLX, llama.cpp, Ollama, ...). Single binary that can install itself as an OS service; docker compose bundles llama.cpp + Gemma 4 E2B.
This commit is contained in:
28 files changed
+2459
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM golang:1.27-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
ARG VERSION=dev
|
||||
# Templ output (*_templ.go) is committed, so no generate step is needed here.
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o /localchat ./cmd/localchat
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
COPY --from=build /localchat /localchat
|
||||
ENV LOCALCHAT_ADDR=0.0.0.0:3000
|
||||
EXPOSE 3000
|
||||
HEALTHCHECK --interval=30s --timeout=5s CMD ["/localchat", "healthcheck"]
|
||||
ENTRYPOINT ["/localchat"]
|
||||
CMD ["serve"]
|
||||
Reference in new issue
Block a user