Install Retvest

This guide is the public install source. It is intentionally conservative: production install proof is still pending, and exact runtime deployment commands belong to retvest-platform release evidence before they become customer-facing instructions.

Use Consumer Runtime v0 for the customer-installable 24/7 runtime checklist. That page documents setup flow, security boundaries, approval gates, metadata-only evidence pointers, quota states, stop controls, outcome receipts, shipped-only claim guards, and current limitations without claiming production install proof.

Prerequisites

  • Docker and Docker Compose for local infrastructure.
  • Python 3.11 for API, control-plane, eval, and static tooling parity.
  • Node.js plus pnpm for the web and marketing apps.
  • Kubernetes plus Helm for production-style deployments.
  • A secrets manager or sealed Kubernetes Secret workflow. Do not commit secrets to git, docs, support tickets, or proof packets.

Local Source Verification

make verify

This verifies the public site and docs source in retvest-site. It does not prove a customer runtime deployment.

For the source-derived public-copy boundary, see Governance Authority Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

For the B1261 source-derived identity boundary, see Governance Identity Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

For the B1267 source-derived roles boundary, see Governance Roles Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

For the B1273 source-derived permissions boundary, see Governance Permissions Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

For the B1279 source-derived policies boundary, see Governance Policies Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

For the B1285 source-derived controls boundary, see Governance Controls Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

For the B1291 source-derived evidence boundary, see Governance Evidence Boundary. It verifies a supplied Candidate SHA against the pinned native owner-intent policy; it does not provide a runtime install or production deployment claim.

One-command local Ollama RAG chat bring-up (founder demo)

Use this path for a local, single-command Ask/chat smoke flow against the platform API with open-source model inference. Confirm the Docker daemon is running before the real smoke starts and either the Docker Compose plugin or standalone docker-compose command is installed; the wrapper fails before bootstrap if either dependency is unavailable.

From this repo root:

./scripts/run-local-ollama-rag-demo.sh smoke

The command delegates to sibling retvest-platform/scripts/smoke-local-ollama-rag.py --bootstrap. That helper starts local platform services through retvest-platform/docker-compose.yml, waits for the Ollama model (OLLAMA_MODEL, default qwen2.5:0.5b), restarts the API after model readiness, and validates:

  • GET /collections
  • GET /threads
  • POST /threads scoped to the selected collection
  • POST /documents into an accessible collection
  • waits until the uploaded document is ready before querying
  • POST /rag/query/stream with citation output
  • GET /threads/{thread_id} to confirm the Ask/chat turn persisted

The smoke fails if the streamed answer uses fallback text instead of the configured local model. It also requires that stream model metadata reports a model_id equal to OLLAMA_MODEL, so a stale or remote backend cannot satisfy the local demo. It also fails if:

  • the answer is empty or omits the created thread id;
  • the done event does not prove answer_length matches the streamed token text;
  • the persisted turn is not in the same selected collection as the created thread;
  • the persisted thread omits the user or assistant message; or
  • citations omit the demo document uploaded during the run; or
  • the uploaded document citation does not include the current-run freshness marker.

The site wrapper adds a runtime evidence gate after the platform helper returns: the wrapper assigns a run id, passes it to the platform helper, and rejects any helper output that reports a different run marker. The smoke output must include exactly one run marker, thread summary, and first_citation summary line. The citation detail must carry a current-run marker flag in the first citation summary and be a valid JSON object with a non-empty document_id_prefix and positive snippet_length; the platform helper validates the actual marker-bearing snippet before emitting that bounded proof. The thread summary must show non-zero citation and answer counts. The mutation mode must print the unknown-thread mutation denial line. A helper that exits successfully without those proof lines, or with duplicated proof lines that could hide replayed evidence, is treated as a failed founder demo.

Worktree namespace and bounded capture

Each invocation uses a worktree namespace to set COMPOSE_PROJECT_NAME and a six-port host map for Ollama, Qdrant, Redis, Postgres, API, and web. The default namespace is derived from the site worktree path; use an explicit namespace and port base when bringing up two worktrees on one host. This keeps container and volume names separate, preventing a container or volume collision, and makes the two port maps independently allocated.

RETVEST_LOCAL_RAG_NAMESPACE=demo-alpha RETVEST_LOCAL_RAG_PORT_BASE=21000 \
  ./scripts/run-local-ollama-rag-demo.sh smoke

RETVEST_LOCAL_RAG_NAMESPACE=demo-bravo RETVEST_LOCAL_RAG_PORT_BASE=22000 \
  ./scripts/run-local-ollama-rag-demo.sh smoke

The six ports are base through base + 5 in this order: Ollama, Qdrant, Redis, Postgres, API, and web. Individual RETVEST_{OLLAMA,QDRANT,REDIS,POSTGRES,API,WEB}_HOST_PORT overrides are allowed only when all six stay distinct. The printed stop command includes the exact COMPOSE_PROJECT_NAME, so it cannot tear down a different local namespace.

For a smoke result to count as current, the wrapper passes a private --capture-output path and the helper must write exactly one bounded capture JSON document there. The wrapper consumes the platform-owned retvest.local_rag_demo_capture.v1 schema from that file; it never constructs or accepts capture identity from helper stdout. It compares the schema, namespace, nested project identity (including Compose, container, and volume namespaces), complete host-port map, run-start timestamp, worktree identity, candidate SHA, nested model identity, and pinned synthetic fixture identity against values it created for this invocation. It rejects a stale or wrong-worktree capture even if that stack returns an Ask answer with citations. This is a local source proof boundary only; it does not establish cross-repository acceptance, deployment, or release readiness.

This proves the platform API and persisted threaded RAG path; browser rendering of the Ask UI remains retvest-app owner evidence.

Copy/paste founder command sequence:

./scripts/run-local-ollama-rag-demo.sh smoke
# optionally stop services afterwards
# copy the stop command printed by the wrapper

Optional switches:

  • OLLAMA_MODEL=llama3.1:8b to use a larger local model on hardware with enough memory.
  • RETVEST_LOCAL_RAG_NAMESPACE=demo-alpha to choose a stable Compose, container, and volume namespace for a worktree.
  • RETVEST_LOCAL_RAG_PORT_BASE=21000 to allocate the six-port local stack map; individual RETVEST_{OLLAMA,QDRANT,REDIS,POSTGRES,API,WEB}_HOST_PORT overrides must remain distinct.
  • RETVEST_API_HOST_PORT=21004 to override only the API port in that map.
  • RETVEST_WORKSPACE_ROOT=/path/to/workspace if the sibling retvest-platform checkout is not next to this repo.
  • B517_LOCAL_RAG_DEMO_RUN_ID=demo-001 to force a deterministic proof marker suffix for local logs. Use only letters, numbers, hyphen, and underscore.
  • MODE=mutation to run the unknown-thread negative probe. It must return 404 for a query stream that names a non-existent thread_id.
  • B517_LOCAL_RAG_DEMO_DRY_RUN=1 to verify command wiring without starting services.
  • RETVEST_LOCAL_RAG_CANDIDATE_SHA=<candidate SHA> to record the exact local candidate in the bounded capture; it defaults to the checkout HEAD.
  • RETVEST_LOCAL_RAG_FIXTURE_ID=<pinned fixture identity> to select the platform-owned pinned synthetic fixture identity; it defaults to retvest-local-rag-fixture-v1.

Use the dry run first if you want to confirm the local bring-up invocation shape before spending time pulling model artifacts. The dry run does not require Docker, but the real smoke requires a running Docker daemon, Docker Compose, and the sibling retvest-platform checkout.

Examples:

OLLAMA_MODEL=qwen2.5:0.5b RETVEST_LOCAL_RAG_PORT_BASE=21000 MODE=smoke \
  ./scripts/run-local-ollama-rag-demo.sh

MODE=mutation ./scripts/run-local-ollama-rag-demo.sh

Stop services after a real smoke with:

cd ../retvest-platform && COMPOSE_PROJECT_NAME=retvest-rag-<namespace> docker compose down -v

The wrapper prints the exact stop command for the detected Compose implementation; if it detects standalone docker-compose, use that printed command instead.

Note: this run is source-only and intended for owner hardware verification. It does not itself create production evidence, hosted-docs evidence, or platform launch proof.

vLLM/OpenAI-compatible inference proof handoff

Use this section as the public-safe B523 handoff shape for owner evidence. It does not claim production model-serving support is complete; the measured proof must come from retvest-platform and stay source-only until the claim ledger and launch-readiness blocker are promoted.

The platform-owned deployment surface currently separates laptop inference from throughput inference:

  • Local Ollama path: LLM_BACKEND=ollama, OLLAMA_BASE_URL, and OLLAMA_MODEL.
  • vLLM/OpenAI-compatible path: LLM_BACKEND=openai_compatible, LLM_OPENAI_BASE_URL=http://<release>-retvest-vllm.<namespace>.svc.cluster.local:8001/v1, LLM_OPENAI_MODEL=<served model name>, and LLM_OPENAI_API_KEY only from a secret when the vLLM server enables bearer auth.

Reject proof packets or docs that say LLM_BACKEND=openai; that is stale wording for this workspace. The retvest chart maps the OpenAI-compatible path through llm.openaiCompatible.*, and the vLLM chart notes the same LLM_BACKEND=openai_compatible swap.

The B523 proof packet should verify the same Ask/chat evidence shape as the local Ollama smoke, but with the active vLLM model backend:

  • POST /rag/query/stream streams a non-fallback answer.
  • Stream metadata reports model_id equal to LLM_OPENAI_MODEL.
  • The answer includes at least one citation from the current synthetic upload.
  • GET /threads/{thread_id} confirms the Ask/chat user and assistant turns persisted in the selected collection.
  • Public evidence records only metadata: run id, commit, backend, served model name, GPU class, GPU count, prompt token counts, output token counts, TTFT, total decode tok/s, tok/s per GPU, citation count, thread id prefix, document id prefix, generated-token metric series count, and verified repo gates. Do not publish raw prompts, generated answers, citation text, bearer tokens, private evidence refs, or full UUID-heavy payloads.
  • Generated-token throughput means decoded model output tokens measured from the vLLM vllm:generation_tokens_total counter for the served model, not SSE event count, byte count, citation count, prompt-token count, request histogram count, or UI chunks. vLLM labels every metric with model_name; the proof row must bind that label to LLM_OPENAI_MODEL.
  • The proof row must include throughput_source, and accepted values are backend usage metadata or the verified stream token accumulator; never SSE events, byte counts, citation counts, or UI chunks.
  • The proof row must identify the B523 model as llama3.1-8b in served_model, LLM_OPENAI_MODEL, and stream model_id. The accepted model identifier must contain exactly one size marker and that size must be 8b; an alias that also names 70b, 0.5b, or another non-8b model size cannot satisfy the throughput row even if it contains the string llama3.1-8b. A smaller smoke model cannot satisfy the throughput row.
  • Token and citation count fields are integer counts. For RAG-length proof, prompt_tokens_p50 must be at least 1024, and generated-token throughput proof requires output_tokens_p50 of at least 64.
  • Reject a benchmark row if gpu_count <= 0, decode_tok_s_total <= 0, decode_tok_s_per_gpu is absent, or decode_tok_s_per_gpu does not equal decode_tok_s_total / gpu_count within the proof packet's stated rounding tolerance.
  • Reject a benchmark row if backend is not openai_compatible, if the stream metadata model does not equal LLM_OPENAI_MODEL, or unless citations_verified and model_id_verified are both true.
  • Reject a benchmark row if generated_token_metric_name is not vllm:generation_tokens_total, if generated_token_metric_model_name does not equal LLM_OPENAI_MODEL, if generated_token_metric_series_count is not exactly 1, or if decode_tok_s_total does not equal generated_token_metric_delta / measurement_window_seconds within the proof packet's stated rounding tolerance.
  • Reject placeholder hardware rows: gpu_class, gpu_count, prompt_tokens_p50, prompt_tokens_p95, output_tokens_p50, output_tokens_p95, ttft_ms_p50, and ttft_ms_p95 must all come from the same completed proof run.
  • The site row validator rejects stale backend names, placeholder hardware, missing citation/model verification, per-GPU math drift, wrong generated-token metrics, model-label drift, duplicate same-model metric series, delta/window drift, conflicting model-size aliases, and chunk-count throughput sources before public copy can promote the row.

For the llama3.1-8b RAG-length benchmark, publish measured values only after the platform proof exists. The public-safe sizing row shape is:

field meaning
proof_id Synthetic proof run id, not a private artifact URL.
backend openai_compatible for the vLLM path.
served_model The model alias returned in stream metadata.
gpu_class / gpu_count Hardware actually used by the proof run.
prompt_tokens_p50 / prompt_tokens_p95 RAG prompt size distribution used for the benchmark.
output_tokens_p50 / output_tokens_p95 Generated-token distribution for completed streams.
ttft_ms_p50 / ttft_ms_p95 Time to first token for the Ask stream.
decode_tok_s_total Total measured decode throughput for the run.
decode_tok_s_per_gpu decode_tok_s_total / gpu_count; use this for unit-economics math.
rounding_tolerance Maximum accepted drift for decode_tok_s_total / gpu_count math.
throughput_source Either backend usage metadata or the verified stream token accumulator.
generated_token_metric_name / generated_token_metric_model_name Exact vLLM generated-token counter name and its model_name label.
generated_token_metric_series_count Count of generated-token counter series after filtering by metric name and model_name; it must be exactly 1.
generated_token_metric_delta / measurement_window_seconds Counter delta and scrape window used to derive decode_tok_s_total.
citations_verified / model_id_verified Boolean evidence gates before accepting the row.

Until those rows are present in owner evidence, site docs may describe the required measurement fields but must not publish tok/s numbers, GPU sizing claims, hosted deployment promises, or provider-specific production support.

Production Deployment Shape

  1. Choose an infrastructure path:
    • Customer-managed Kubernetes or an approved managed cloud environment.
    • A platform-owned Helm or Terraform release artifact named by current release evidence.
  2. Prepare external dependencies:
    • Postgres.
    • Redis.
    • Qdrant.
    • Object storage or persistent volumes for document storage, depending on the selected deployment model.
  3. Prepare secrets:
    • JWT/session secrets.
    • Database, Redis, Qdrant, SMTP, SSO, connector, license, and LLM provider credentials.
    • Prefer ExternalSecret or another customer-approved secrets controller.
  4. Configure deployment values in a customer-specific file outside public docs.
  5. Install or upgrade with the platform-owned release instructions for the selected artifact.
  6. Run migrations and verify:
    • API /health returns healthy dependency status.
    • Web login, admin navigation, document upload, RAG query, compliance export, and audit-chain verification succeed with synthetic data.
    • Metrics, alerts, backups, and runbooks are reachable.

Consumer Runtime Setup

Use the Consumer Runtime v0 guide for the customer-installed 24/7 runtime checklist. Public install docs may describe the setup sequence, security boundary, approval gate, metadata-only evidence, quota states, stop control, outcome receipts, and shipped-only claim limits, but exact runtime release commands remain platform-owned until release evidence and production install proof exist.

Runtime setup evidence should confirm:

  • The installed artifact and contract pin match the owner evidence.
  • The runtime credential is tenant-scoped and secret-managed.
  • Agent registration, heartbeat, bounded work lease, approval gate, metadata-only evidence upload, quota status, stop control, and outcome receipt paths are exercised with synthetic data.
  • Stop controls and held quota states prevent new work before customer content is introduced.
  • The public proof packet contains only versions, counts, digests, timestamps, request ids, and receipt ids.

First Admin Tasks

  • Create or verify the first admin user.
  • Configure SSO and MFA policy.
  • Create collections and ACLs before uploading documents.
  • Create narrow API keys for automation instead of sharing interactive cookies.
  • Run a synthetic upload/query/compliance-export smoke path before adding customer content.

Evidence Rules

Install evidence should record versions, commands, checks, and counts only. Do not capture secrets. Do not capture bearer tokens, cookies, raw customer documents, prompts, questions, answers, citation text, or full UUID-heavy evidence in public docs or customer-facing proof packets.

Do not capture secrets in install evidence, support tickets, screenshots, or public docs.

For runtime-specific proof, capture only the metadata listed in Consumer Runtime v0 and keep production install proof marked pending until a sanitized customer or staging packet exists.

Choose what this site may use. Your choice is kept in this browser only.