Every knob is a command-line flag and an HMS_* environment variable with the same meaning. A flag wins over its variable. The server starts with safe defaults, and refuses to start on contradictory settings. A test keeps this page, the flags and the variables in step.
Secrets never appear as flags: HMS_API_KEY is read from the environment only.
TCP listen address. Loopback unless you change it.
--unix-socket
HMS_UNIX_SOCKET
unset
Listen on this unix socket (mode 0600) instead of TCP. A stale socket file is replaced; a live one is an error.
--tls-cert
HMS_TLS_CERT
unset
PEM certificate chain. Enables HTTPS (rustls, TLS 1.2 and 1.3, ALPN h2 and http/1.1). Needs --tls-key. Reloaded on SIGHUP or POST /api/v1/admin/tls/reload.
--tls-key
HMS_TLS_KEY
unset
PEM private key for --tls-cert.
--max-connections
HMS_MAX_CONNECTIONS
1024
Simultaneous connections; more wait in the kernel backlog.
--header-read-timeout-seconds
HMS_HEADER_READ_TIMEOUT_SECONDS
10
Time a client has to send request headers (and finish a TLS handshake) before the connection is dropped. 1..=300.
--shutdown-delay-seconds
HMS_SHUTDOWN_DELAY_SECONDS
0
After SIGTERM or SIGINT, keep serving this long with /readyz answering 503, so a load balancer or Kubernetes endpoint controller can drain the instance before the listener closes.
--shutdown-grace-seconds
HMS_SHUTDOWN_GRACE_SECONDS
30
After SIGTERM or SIGINT, time open connections get to finish before they are cut. Admitted work still completes before the final flush.
Serve without authentication: every caller has every scope. Refused unless the listener is loopback or a unix socket, and refused when credentials are also configured.
--keys-file
HMS_KEYS_FILE
unset
JSON file of hashed per-tenant keys; see docs/server/auth.md. Reloaded on SIGHUP and by POST /api/v1/admin/keys/reload.
HMS_API_KEY (environment only, no flag)
unset
One key valid for every tenant with every scope. Empty is an error.
--metrics-public
HMS_METRICS_PUBLIC
off
Serve /metrics without credentials. Otherwise it needs the admin scope. /healthz, /readyz and /openapi.json are always public.
--cors-origins
HMS_CORS_ORIGINS
empty
Comma-separated origins allowed by CORS, or *. Empty sends no CORS headers.
--cors-max-age-seconds
HMS_CORS_MAX_AGE_SECONDS
600
Preflight cache lifetime.
With neither HMS_API_KEY nor --keys-file, the server only starts if --no-auth is given.
Request body limit (413 above it) for JSON endpoints.
--body-timeout-seconds
HMS_BODY_TIMEOUT_SECONDS
30
Deadline to read a body, and the longest idle gap in a streamed upload. 1..=300.
--max-batch
HMS_MAX_BATCH
1000
Documents per batch request, at most 4096.
--max-top-k
HMS_MAX_TOP_K
100
Upper bound for top_k.
--query-index
HMS_QUERY_INDEX
auto
Route of unfiltered vector queries: auto (the graph index once maintenance built one, else the exact scan), exact, or graph (409 until a graph index exists). A request's index field overrides it.
--query-ef
HMS_QUERY_EF
128
Beam width of graph-index queries, 1..=4096: the recall knob. A request's ef field overrides it.
--graph-min-rows
HMS_GRAPH_MIN_ROWS
4096
Fewest embedded chunks for which index maintenance builds the graph index; smaller stores answer from the exact scan.
--ingest-encode
HMS_INGEST_ENCODE
eager
When ingest computes chunk hypervectors (the text-vector channel): eager (at ingest), deferred (on the first vector query or maintenance; needs stored text and a text encoder) or lexical (never: embedding-only workloads skip the channel's time and memory). Text and query_vector search see every document in every mode.
--max-tenants
HMS_MAX_TENANTS
64
Stores open at once (503 tenant_limit above it).
--max-concurrent-work
HMS_MAX_CONCURRENT_WORK
4
Requests reading bodies or running engine work at once, 1..=256.
--max-queue
HMS_MAX_QUEUE
0
Requests allowed to wait for a work slot. 0 answers 503 server_busy immediately.
--queue-timeout-ms
HMS_QUEUE_TIMEOUT_MS
1000
Longest a queued request waits before 503.
--rate-limit-rps
HMS_RATE_LIMIT_RPS
0
Per-tenant sustained requests per second (token bucket); 429 rate_limited with Retry-After. 0 disables.
--rate-limit-burst
HMS_RATE_LIMIT_BURST
0
Per-tenant burst. 0 means one second of the sustained rate.
--max-documents-per-tenant
HMS_MAX_DOCUMENTS_PER_TENANT
0
Per-tenant document quota; a write that would exceed it gets 429 quota_exceeded. Replacing an existing id never counts. 0 disables.
--idempotency-ttl-seconds
HMS_IDEMPOTENCY_TTL_SECONDS
600
How long an Idempotency-Key replays its response.
--idempotency-capacity
HMS_IDEMPOTENCY_CAPACITY
10000
Records kept in memory; the oldest are evicted first.