-
Notifications
You must be signed in to change notification settings - Fork 0
Engine: local mode + all-in-one Docker image + BYOK + UI + source endpoint + ingest race fix #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hallelx2
merged 10 commits into
main
from
halleluyaholudele/hal-186-engine-zero-config-local-mode
Jun 19, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7d95eb1
engine: zero-config local mode (engine --local / VLE_LOCAL_MODE) on :…
hallelx2 ee92a5d
docs: align documented local Postgres URL with the real default (?ssl…
hallelx2 47c5793
engine: fsync source writes + retry source fetch on ErrNotFound (HAL-…
hallelx2 9644ecc
config: document that anthropic base_url must include /v1 for GLM/Z.a…
hallelx2 b1fd728
engine: add GET /v1/documents/{id}/source + all-in-one Docker image (…
hallelx2 e0992e1
ci: enforce LF for shell scripts (protect the Docker entrypoint)
hallelx2 ea11a06
ci: build all-in-one image from the local-mode branch to publish :latest
hallelx2 ccaa5c9
engine+ui: BYOK — per-request LLM key via X-LLM-* headers + dashboard…
hallelx2 0556aab
Merge remote-tracking branch 'origin/main' into halleluyaholudele/hal…
hallelx2 079d2aa
ci: trigger all-in-one image build on main + dispatch (post-merge)
hallelx2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Shell scripts and the all-in-one entrypoint MUST stay LF — CRLF breaks the | ||
| # shebang inside the Linux container ("bad interpreter: /usr/bin/env bash^M"). | ||
| *.sh text eol=lf | ||
| deploy/allinone/entrypoint.sh text eol=lf | ||
| localapp/serve.py text eol=lf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: docker-allinone | ||
|
|
||
| # Build and publish the ALL-IN-ONE image (engine + bundled Postgres + web UI) | ||
| # so anyone can `docker run` Vectorless with just an LLM key. | ||
| # | ||
| # Publishes to Docker Hub AND GitHub Container Registry: | ||
| # docker.io/<DOCKERHUB_USERNAME>/vectorless:latest|sha-<short>|vX.Y.Z | ||
| # ghcr.io/hallelx2/vectorless:latest|sha-<short>|vX.Y.Z | ||
| # | ||
| # Requires two repo secrets for the Docker Hub push: | ||
| # DOCKERHUB_USERNAME — your Docker Hub account/namespace | ||
| # DOCKERHUB_TOKEN — a Docker Hub access token with Read/Write/Delete scope | ||
| # (GHCR uses the built-in GITHUB_TOKEN — no extra secret.) | ||
|
|
||
| on: | ||
| workflow_dispatch: {} # run on demand from the Actions tab / gh CLI | ||
| push: | ||
| branches: [main] # publish :latest on every push to the default branch | ||
| tags: ["v*.*.*"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write # push to ghcr.io | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: build + push all-in-one | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Log in to ghcr.io | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract tags + labels | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: | | ||
| docker.io/${{ secrets.DOCKERHUB_USERNAME }}/vectorless | ||
| ghcr.io/${{ github.repository_owner }}/vectorless | ||
| tags: | | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }} | ||
| type=ref,event=tag | ||
| type=sha,prefix=sha-,format=short | ||
|
|
||
| - name: Build + push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile.allinone | ||
| platforms: linux/amd64 | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| VERSION=${{ github.ref_name }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # ── All-in-one image: engine + bundled Postgres + viewer UI ────────── | ||
| # | ||
| # One `docker run` gives a fully working Vectorless: the retrieval engine, | ||
| # a Postgres instance bundled in the same container, and the local web UI. | ||
| # The only thing the user supplies is an LLM provider key. | ||
| # | ||
| # docker run -p 8080:8080 -p 7654:7654 \ | ||
| # -e VLE_LLM_ANTHROPIC_API_KEY=<your GLM key> \ | ||
| # hallelx2/vectorless:latest | ||
| # # → UI: http://localhost:8080 | ||
| # # → API: http://localhost:7654 | ||
| # | ||
| # Context: vectorless-engine/ directory. | ||
|
|
||
| # ── Build stage ────────────────────────────────────────────────────── | ||
| FROM golang:1.25-alpine AS build | ||
| RUN apk add --no-cache ca-certificates | ||
| WORKDIR /src | ||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
| COPY cmd/ ./cmd/ | ||
| COPY pkg/ ./pkg/ | ||
| COPY internal/ ./internal/ | ||
| ARG VERSION=dev | ||
| RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \ | ||
| go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" \ | ||
| -o /bin/engine ./cmd/engine | ||
|
|
||
| # ── Runtime stage: Postgres base + python + engine + viewer ────────── | ||
| FROM postgres:16-bookworm | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get install -y --no-install-recommends python3 ca-certificates \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY --from=build /bin/engine /usr/local/bin/engine | ||
| COPY localapp/ /opt/vectorless-app/ | ||
| COPY deploy/allinone/entrypoint.sh /usr/local/bin/vl-entrypoint.sh | ||
| RUN chmod +x /usr/local/bin/vl-entrypoint.sh | ||
|
|
||
| # Bundled Postgres credentials — must match engine --local's expected DSN | ||
| # (postgres://vectorless:vectorless@localhost:5432/vectorless). | ||
| ENV POSTGRES_USER=vectorless \ | ||
| POSTGRES_PASSWORD=vectorless \ | ||
| POSTGRES_DB=vectorless | ||
|
|
||
| # Engine defaults: local mode, minimal ingest (fast, queryable in seconds), | ||
| # document bytes under /data (mount a volume here to persist), and GLM via | ||
| # z.ai's Anthropic-compatible gateway out of the box. Override any of these | ||
| # with -e at runtime; the user still supplies VLE_LLM_ANTHROPIC_API_KEY. | ||
| ENV VLE_INGEST_MODE=minimal \ | ||
| VLE_STORAGE_LOCAL_ROOT=/data/documents \ | ||
| VLE_LLM_DRIVER=anthropic \ | ||
| VLE_LLM_ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic/v1 \ | ||
| VLE_LLM_ANTHROPIC_MODEL=glm-4.6 \ | ||
| VIEWER_PORT=8080 \ | ||
| ENGINE_URL=http://localhost:7654 \ | ||
| HOST=0.0.0.0 | ||
|
|
||
| EXPOSE 8080 7654 | ||
| VOLUME ["/data", "/var/lib/postgresql/data"] | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/vl-entrypoint.sh"] | ||
|
|
||
| LABEL org.opencontainers.image.title="vectorless (all-in-one)" | ||
| LABEL org.opencontainers.image.description="Vectorless retrieval engine + bundled Postgres + web UI in one container. Reasoning-based document retrieval — no chunking, no embeddings, no vector DB." | ||
| LABEL org.opencontainers.image.source="https://github.com/hallelx2/vectorless-engine" | ||
| LABEL org.opencontainers.image.licenses="Apache-2.0" | ||
| LABEL org.opencontainers.image.vendor="Vectorless" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #!/usr/bin/env bash | ||
| # All-in-one entrypoint: Postgres + Vectorless engine + the local viewer UI, | ||
| # all in one container. Postgres is bundled so `docker run` needs no external | ||
| # services — the user only supplies an LLM provider key. | ||
| set -euo pipefail | ||
|
|
||
| PGUSER_="${POSTGRES_USER:-vectorless}" | ||
| PGDB_="${POSTGRES_DB:-vectorless}" | ||
|
|
||
| echo "[vectorless] starting bundled Postgres…" | ||
| # The official postgres entrypoint handles first-run initdb (using the | ||
| # POSTGRES_* env vars) and then execs postgres. Run it in the background so we | ||
| # can start the engine + UI alongside it in the same container. | ||
| docker-entrypoint.sh postgres & | ||
|
|
||
| echo "[vectorless] waiting for Postgres to accept connections…" | ||
| until pg_isready -h localhost -U "$PGUSER_" -d "$PGDB_" >/dev/null 2>&1; do | ||
| sleep 1 | ||
| done | ||
| echo "[vectorless] Postgres ready." | ||
|
|
||
| # Start the viewer UI (serves the single-page app + same-origin proxy to the | ||
| # engine). Backgrounded; the engine is the container's main process. | ||
| if [ -f /opt/vectorless-app/serve.py ]; then | ||
| echo "[vectorless] starting viewer UI on :${VIEWER_PORT:-8080} → ${ENGINE_URL:-http://localhost:7654}" | ||
| PYTHONIOENCODING=utf-8 python3 /opt/vectorless-app/serve.py & | ||
| fi | ||
|
|
||
| if [ -z "${VLE_LLM_ANTHROPIC_API_KEY:-}" ] && [ -z "${VLE_LLM_OPENAI_API_KEY:-}" ] && [ -z "${VLE_LLM_GEMINI_API_KEY:-}" ]; then | ||
| echo "[vectorless] WARNING: no LLM provider key set. Ingestion will work, but" | ||
| echo "[vectorless] queries need e.g. -e VLE_LLM_ANTHROPIC_API_KEY=<your GLM key>" | ||
| fi | ||
|
|
||
| echo "[vectorless] starting engine (local mode) on :7654 …" | ||
| # exec so the engine becomes PID 1's foreground process and receives signals. | ||
| exec engine --local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): OpenAI and Gemini branches ignore the
baseURLargument, which may surprise callers ofBuildLLM.BuildLLMpassesbaseURLtobuildLLMFrom, but theopenaiandgeminibranches ignore it. Calls that setX-LLM-Base-Urlfor these providers will have no effect. Please either plumbbaseURLinto the OpenAI/Gemini client configs (as with Anthropic) or make it explicit in the API/docs that this parameter only applies to Anthropic.Suggested implementation:
To fully wire
baseURLfor the Gemini provider, ensure thegeminicase returns a client configured with theBaseURLfield, mirroring the Anthropic/OpenAI patterns. For example, the body should look like:This assumes
openai.Configandgemini.Configboth support aBaseURLfield; if they use a different field name, adjust accordingly.