Documentation

Console administration API

See SECURITY.md for sign-in, roles, TLS, tenants, credential limits and tracing.

Routes require authentication; static console files are public. The admin token (VLITE_AUTH_TOKEN, VLITE_AUTH_TOKEN_FILE or --token-file) grants super-admin access. Bootstrap secrets are never returned; scoped secrets return once on creation/rotation. Never log them.

Configuration and roles

The server, not the console, enforces access:

GET /v1/capabilities returns version, api_version, format_version, role, features, routes and identity. Check api_version and features, not the package version.

Dashboard administration walkthrough

Super admins work in Administration. Its Users & access tab holds:

Issue a graph-scoped API key

Select graph_read / graph_write; Graphs requires 1–64 distinct names matching ^[a-z][a-z0-9_-]{0,62}$ (28 characters within tenants), or * alone. Graph-only keys send collections: ["*"] without vector permissions. Check GET /v1/capabilities → scope with the key. Listing and rotation show graph scope; rotation preserves permissions.

Administration and Observability also hold:

Mutations ask for confirmation, run one at a time and never retry. Signing out clears admin results. Startup settings, secret and TLS files, and format upgrades stay host tasks.

ANN maintenance observations and retry backoff

GET /v1/index/hnsw/maintenance (or its collection route) reports whether the active graph is ready and whether pressure recommends a rebuild. The graph can stay ready while a replacement builds. The optional rebuild.phase is building, cancelling, ready_to_publish (finished, waiting for a poll) or discard_pending (terminal, waiting for a poll); Rust exposes it as HnswRebuildProgress.phase. Writes never rebuild synchronously, and ready-only search never falls back to exact search.

Automatic server maintenance can retry rebuilds that end in catch-up overflow or supersession. Backoff is off by default and never affects explicit maintain_hnsw calls. Enable it with PUT /v1/admin/maintenance/auto:

{"retry_backoff_initial_ms":250,"retry_backoff_max_ms":4000}

The delay doubles with each repeated failure for a collection, up to the maximum. Set both values to zero to disable, or use 1 <= initial <= max <= 3600000 milliseconds. Tick responses mark a deferred retry as retry_backoff with the attempt count and remaining delay.

Opt-in durable group commit

vlite-server <path> --group-commit coalesces concurrent puts, deletes, atomic batches and metadata patches into one shared datafile sync. This covers REST, collection routes and gRPC Put, Delete, WriteBatch and UpdateMetadata. It matters most with --durability full; the default periodic durability syncs every 60 s. Set limits after the flag:

--group-commit --group-commit-requests 16 --group-commit-bytes 67108864 --group-commit-delay-ms 0
Setting Default Range
Outstanding grouped writes 16 1–16
Retained-input byte budget 64 MiB 1024–268435456 bytes
Collection window 0 ms 0–100 ms

In-process servers opt in with Service::with_group_commit(GroupCommitConfig::default()) before cloning or publishing the service. Its tests cover crash, short-write and failed-sync recovery, not power loss.

Metrics use the group_commit_ prefix (vlite_group_commit_ in Prometheus). group_commit_enabled always reports the policy; the rest appear only when enabled, and collection-scoped callers never see them.

Queue wait includes the window, lock contention and earlier work in the group; sync time starts after the last operation. These are process-local diagnostics, not an accounting ledger.

Reproduce the local-disk comparison with:

cargo test --release --features server --lib comparative_durable_write_benchmark -- --ignored --nocapture

It checks reopening all 512 acknowledged records, with 16-dimensional vectors and 128-byte payloads, at concurrency 1 and 16. Two paired runs on a shared Windows host measured zero-delay grouping at 12571–15617 writes/s versus 1926–2910 writes/s with independent syncs at concurrency 16 (5.4–6.5x); grouped p99 was 1.52–1.65 ms versus 5.93–16.43 ms. This is a small, noisy in-process workload, not a production SLO. Sequential zero-delay throughput was 6–8% lower. Tune against real arrivals and storage.

Exact-search read snapshots

Simple exact searches (no reranking or indexed filter) scan a bounded snapshot outside the owner lock, so writes can commit during the scan. When snapshot limits are exhausted, the search runs under the lock instead of failing. If snapshot copying hurts latency, start with --lock-held-reads (embedded: Service::with_snapshot_reads(false)); results are the same. Metrics: snapshot_reads_enabled, read_snapshot_active_captures and read_snapshot_retained_logical_bytes (logical bytes per capture, not resident memory).

Token lifecycle and audit (admin only)

Route Behavior
GET /v1/admin/tokens Returns {generation,admin_file_configured,read_only_configured,read_only_file_configured}.
POST /v1/admin/tokens/reload with {} Validates configured files, then swaps both credentials atomically; invalid files change nothing. Empty read-only files revoke access; identical role tokens are rejected.
POST /v1/admin/memory/bindings/reload, …/preflight; GET …/status Reload rereads the grants file; resend while drained is false. Check previews without changing grants; status compares them to it. Grants only; no gRPC.
POST /v1/admin/tokens/revoke-read-only with {} Revokes read-only access in memory, incrementing generation; empty its file to persist across reload or restart.
GET /v1/admin/audit Returns {items:[...],capacity:256}.

Environment credentials need restart to rotate. No route creates arbitrary tokens or accepts file paths.

Audit items contain only {request_id,method,route,status,role,duration_ns,timestamp_unix_ms}. route is the matched template or "unmatched"; role is null when authentication failed. Queries, IDs, vectors, metadata, payloads, headers and bodies are never recorded. The ring is process-local, resets at restart and is not a tamper-evident compliance log.

HNSW configuration, jobs, and maintenance

config is {m,ef_construction,seed}, default 16,100,42. m is 2–64 and ef_construction is m–4096. seed accepts a JSON u64 or a decimal string; admin responses use a string. POST /v1/search and POST /v1/index/hnsw accept config, so ready-only queries can select a non-default graph.

limits is {max_records,max_snapshot_vector_bytes}, default 100000,134217728, with ranges 1–1000000 and 1–268435456. They bound the snapshot, not process memory, duration or graph allocations. ANN metrics are "squared_l2" and "cosine".

Route Behavior
POST /v1/index/hnsw/rebuild with {config?,metric?,limits?} Starts one bounded job and returns 202 {"outcome":"running"}, or 409 if a job is pending.
GET /v1/index/hnsw/rebuild Observes without polling; returns {policy,status} like the maintenance GET.
POST /v1/index/hnsw/rebuild/poll with {} Reaps or publishes a finished graph without blocking. outcome is idle, running, cancelling, published, cancelled, superseded or catch_up_overflow. A terminal result is consumed.
POST /v1/index/hnsw/rebuild/cancel with {} Returns {cancelled:boolean}. Cancellation is cooperative and keeps the active graph; poll afterward.
GET /v1/index/hnsw/maintenance Returns the policy and status shown below. Never publishes.
PUT /v1/index/hnsw/maintenance Validates and replaces the process-local policy. Omitted fields use defaults. High-water bounds are 1–256 IDs and 1–8388608 vector bytes. Resets at restart.
POST /v1/index/hnsw/maintenance/tick with {} Polls or publishes a matching job, then starts a replacement if needed. Returns {outcome,started,status}; a mismatched pending job returns 409.
{"policy":{"config":{"m":16,"ef_construction":100,"seed":"42"},"metric":"squared_l2","limits":{"max_records":100000,"max_snapshot_vector_bytes":134217728},"rebuild_at_buffered_ids":128,"rebuild_at_buffer_vector_bytes":4194304},"status":{"ready":false,"pressure":"unavailable","active_buffer":null,"rebuild":null}}

Readiness applies to the maintenance policy's config and metric. There is no hidden timer or retry. The synchronous index POST still returns 204.

Safe backup and restart-selected restore (admin only)

Route Behavior
GET /v1/admin/backups Returns {enabled,items:[{name,kind,bytes}],restart_required:true}, where kind is backup or restore. Lists at most 1000 generated files.
POST /v1/admin/backups with {} Snapshots while the owner lock excludes writers, then syncs, validates and publishes a new backup-*.vlite without overwrite. Returns 201 {name,inspection,restart_required:true}. Copying delays other database work, so schedule large copies.
POST /v1/admin/restores with {"backup":"backup-....vlite"} Validates the backup and creates a new restore-*.vlite. Returns 201 with the same schema. Optional sequence or timestamp_ms selects a PITR target.
POST /v1/admin/restores/select with {"name":"restore-....vlite"} Revalidates the copy and records it in the private next-startup marker. Returns {name,inspection,restart_required:true}.

inspection is {format_version,dimensions,live_records,file_bytes,valid_bytes,incomplete_tail_bytes}. Without VLITE_ADMIN_DIR, copy and select return 409. Paths, traversal, symlinks and overwrites are rejected, and invalid backups never replace the active database. Do not change snapshots by hand while the server runs.

Selection does not switch the live database. At the next startup with the same VLITE_ADMIN_DIR, the server validates and opens the selected copy instead of its positional path. A --create-if-missing dimension must still match. A bad selection fails startup; it never falls back. The original file stays untouched. The marker persists: remove next-startup offline to return to the positional database, or select another copy. Do not move or delete a selected copy. There is no upload, download, delete or in-place recovery route.

Unix syncs the directory after copies and selection; Windows keeps the engine's directory-entry power-loss limitation. An I/O error after publication can leave the output present, so inspect it before retrying.

Webhooks, disk ANN, PITR and encryption status

View or edit this page on GitHub ↗