Skip to main content

Configuration

VCAL Server is configured entirely via environment variables or an optional .env file.
If a variable is not set, the documented default is used.

Tip: For production deployments, prefer a .env file or systemd environment overrides over inline variables.


Core / Index

VariableDescriptionDefault
VCAL_BINDAddress and port to bind the HTTP server0.0.0.0:8080
VCAL_DIMSVector dimensionality (required if no snapshot exists)
VCAL_MHNSW graph out-degree (recall vs memory trade-off)32
VCAL_EF_SEARCHHNSW search parameter (ef)128
VCAL_SIM_THRESHOLDGlobal cosine similarity cutoff used by /v1/search and /v1/qa. Can be overridden per request via min_score.0.80
VCAL_DATA_DIRPersistent data directory (index, answers, snapshots)./data

Capacity & Eviction

VariableDescriptionDefault
VCAL_CAP_MAX_BYTESMax in-memory size before LRU eviction (e.g. 512M, 8G)
VCAL_CAP_MAX_VECTORSMax vector count before LRU eviction
VCAL_TTL_SECSDefault TTL for cache entries (seconds)
VCAL_EVICT_EVERY_SECSInterval between eviction sweeps30

If both byte and vector limits are set, eviction triggers on whichever limit is reached first.


Persistence / Snapshots

VariableDescriptionDefault
VCAL_AUTOSAVE_SECSAutosave interval for index + payloads (0 = disabled)300
VCAL_AUTOSAVE_ATOMICWrite snapshots atomically (temp + rename)1
VCAL_SNAPSHOT_COMPRESSIONSnapshot compression mode (auto, on, off)auto

Snapshots are forward-compatible within the same major version.


Authentication & Authorization

VariableDescriptionDefault
VCAL_AUTH_HEADERHTTP header used for API keysx-vcal-key
VCAL_KEYS_APP_FILEFile containing app keys (data-plane /v1/* routes)
VCAL_KEYS_ADMIN_FILEFile containing admin keys (/admin/* routes)
VCAL_ALLOW_METRICS_WITHOUT_AUTHAllow /metrics without authentication0
VCAL_API_BASEBase path for data-plane endpoints/v1

Recommended: Use key files rather than embedding secrets directly in environment variables.


Licensing (Required)

VCAL Server will not start without a valid license.

VariableDescriptionDefault
VCAL_LICENSE_FILEPath to active license JSON file (Trial / Growth / Enterprise)

The license file is:

  • Cryptographically signed by the vendor
  • Validated at startup
  • Periodically revalidated at runtime

Startup fails if the license is missing, invalid, or expired.


Limits / Middleware

VariableDescriptionDefault
VCAL_RATE_QPSGlobal request rate limit (0 = disabled)0
VCAL_RATE_WINDOW_SECSRate-limit window size1
VCAL_TIMEOUT_SECSPer-request timeout (seconds)30
VCAL_CONCURRENCYMax concurrent requests (0 = unlimited)0

Metrics / Observability

VariableDescriptionDefault
VCAL_PROM_ENABLEDEnable Prometheus /metrics endpoint1
VCAL_LOG_LEVELLog verbosity (error, warn, info, debug, trace)info
VCAL_TOKENS_PER_HITEstimated tokens saved per cache hit (ROI metrics)0

Example .env

VCAL_BIND=0.0.0.0:8080
VCAL_DIMS=1536
VCAL_M=32
VCAL_EF_SEARCH=128
VCAL_SIM_THRESHOLD=0.80
VCAL_DATA_DIR=/var/lib/vcal/data

VCAL_CAP_MAX_BYTES=2G
VCAL_TTL_SECS=2592000
VCAL_EVICT_EVERY_SECS=60

VCAL_AUTOSAVE_SECS=300
VCAL_AUTOSAVE_ATOMIC=1

VCAL_AUTH_HEADER=x-vcal-key
VCAL_KEYS_APP_FILE=/opt/vcal-server/app.keys
VCAL_KEYS_ADMIN_FILE=/opt/vcal-server/admin.keys

VCAL_LICENSE_FILE=/etc/vcal/license.json

VCAL_PROM_ENABLED=1
VCAL_LOG_LEVEL=info
VCAL_TIMEOUT_SECS=30
VCAL_ALLOW_METRICS_WITHOUT_AUTH=1

Notes

  • VCAL_SIM_THRESHOLD is global but can be overridden per request.
  • All key and license files must be readable by the VCAL Server process.
  • For production deployments, avoid committing secrets or keys into source control.