Configuration Parameters
Full Configuration File
# LocalVectorDB Server Configuration v1.0
[database]
root_dir = "/var/www/localvectordb_server/.lvdb" # Recommend absolute paths in production environment
timeout = 300
connection_pool_size = 10
enable_gpu = false
enable_fts = true
chunk_size = 500
chunk_overlap = 1
chunking_method = "lines"
# Faiss index settings
faiss_index_type = "IndexFlatL2" # Can be one of: IndexFlatL2, IndexFlatIP, IndexHNSWFlat, IndexLSH
# faiss_index_hnsw_flat_neighbors = 0 # Only used for IndexHNSWFlat, set the number of neighbors for the graph
# faiss_index_lsh_bits = 1536 # Only used for IndexLSH Typically set to twice the embedding dimension
# mmap_index = false # Read-only: memory-map the index so many workers share one page-cached copy
[database.default_metadata_schema]
file_path = { type = "text", indexed = true, required = false }
created_at = { type = "date", indexed = true, required = false }
last_modified = { type = "date", indexed = true, required = false }
mimetype = { type = "text", indexed = true, required = false }
tags = { type = "json", indexed = false, required = false }
# You can define the type directly if you don't need indexing and the field is not required
file_size_bytes = "integer"
[embedding]
provider = "ollama"
model = "nomic-embed-text"
batch_size = 64
timeout = 30
max_retries = 3
[server]
debug = false
environment = "development"
host = "127.0.0.1"
port = 8000
log_level = "INFO"
log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
file_upload_enabled = true # enables the /api/v1/databases/<db-name>/upload route
max_request_size = 104857600
enable_rate_limiting = false
rate_limit = "100 per minute"
rate_limit_storage_uri = "memory://"
proxy_enabled = true
# REQUIRED when proxy_enabled = true: list of trusted proxy IPs / CIDR blocks
# allowed to set forwarded headers. Validation fails if this is empty.
trusted_proxies = ["10.0.0.0/8", "127.0.0.1"]
cache_enabled = true
cache_ignore_errors = true
cache_timeout = 300
cache_type = "RedisCache"
[server.cache_settings] # These parameters are passed to the cache constructor. See https://cachelib.readthedocs.io/en/stable/
host = "localhost"
port = 6379
db = 0
password = "$REDIS_PASSWORD" # '$' prefix indicates to load the environment variable
key_prefix = "my-db-prefix-" # Allows you to run multiple servers using single redis db.
# IMPORTANT: if ``proxy_enabled = true``, you must set the proxy settings AND trusted_proxies.
# The specific values depend on your server set-up. Set the number of proxies forwarding each header.
# When behind a reverse proxy (nginx, etc.), configure trusted_hosts, trusted_proxies, and proxy settings.
[server.proxy_settings]
x_for = 1
x_proto = 1
x_host = 1
x_prefix = 1
[server.security]
# API settings
require_api_key = true
key_database_path = "/path/to/api_keys.db" # If not provided, located in ``{database.root_dir}/api_keys.db``
# Recommended to set keys to expire
default_key_expiry_days = 90
api_key_header = "Authorization"
auto_prune_expired_keys = false
key_audit_logging = true
auth_log_level = "INFO"
warn_expiring_days = 7
# Filter connections by hostname for best practices.
trusted_hosts = ["your-website.com", "*.subdomain.example.com", "localhost"]
# CORS settings
cors_enabled = true
# IMPORTANT: if CORS is enabled, you need to set the allowed origins!
cors_allowed_origins = ["http://localhost:8000", "https://your-website.com"]
cors_allowed_methods = ["GET", "POST", "PUT", "DELETE", "OPTIONS"]
# If you changed the default Authorization header, make sure to put it here too
cors_allowed_headers = ["Content-Type", "Authorization"]
cors_max_age = 86400
[extraction]
# Hardened defaults for untrusted uploads; relax only for trusted content.
allow_remote_fetch = false # Fetch remote assets referenced by a document (SSRF risk)
allowed_hosts = [] # Host allowlist applied when allow_remote_fetch = true
strip_dangerous_elements = true # HTML: strip scripts and event handlers
attachment_mode = "skip" # How embedded attachments/assets are handled
Note
The configuration file shown above is a representative example of a configuration that might be used in a production environment. You will need to modify this for your server! Do not copy and paste and use without modifications, as it almost certainly won’t work.
Database Settings
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
str |
|
Root directory for storing database files and data. |
|
int |
|
Timeout for database operations, in seconds. |
|
int |
|
Number of simultaneous database connections allowed (connection pool size). |
|
bool |
|
Whether to enable GPU acceleration for database operations (if supported). |
|
bool |
|
Whether to enable Full-Text Search (FTS) capabilities. |
|
str |
|
The type of faiss index to use: |
faiss_index_hnsw_flat_neighbors |
int |
|
The number of neighbors for the |
faiss_index_lsh_bits |
int |
|
The number of bits to use for the binary hashing, defaults to 2x the number of embedding dimensions if not provided and using |
|
bool |
|
Memory-map the FAISS index ( |
|
int |
|
Default size (in tokens or lines, depending on |
|
int |
|
Number of tokens/lines to overlap between chunks. |
|
str |
|
Method for splitting documents into chunks (e.g., |
|
Dictionary (table) or null |
|
Default metadata schema as a table of field names to |
Embedding Settings
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
str |
|
Embedding provider to use (e.g., |
|
str |
|
Embedding model name to use with the provider. |
|
str or null |
|
Base URL for the embedding provider’s API (if required). |
|
str or null |
|
API key for the embedding provider (required for some providers, e.g., OpenAI). |
|
int |
|
Number of items to embed per API request (batch size). |
|
int |
|
Timeout for embedding API requests, in seconds. |
|
int |
|
Maximum number of retries for embedding API requests. |
|
Dictionary (table) or null |
|
Additional provider-specific configuration options. |
Server Settings
Note
Parameters from require_api_key onward in the table below (authentication, key
management, trusted_hosts, and CORS settings) live under the [server.security]
table, not [server]. The remaining parameters (debug … trusted_proxies)
live under [server]. Use the dot-notation paths accordingly, e.g.
server.security.require_api_key and server.host.
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
bool |
|
Whether to run the server in debug mode (enables verbose error output). |
|
str |
|
Server environment (e.g., |
|
str |
|
Host address to bind the server to. |
|
int |
|
Port number to bind the server to. |
|
str |
|
Logging level ( |
|
str |
|
Format string for log messages. |
|
bool |
|
Whether to allow file uploads via the |
|
int |
|
Maximum allowed size for incoming requests, in bytes. |
|
bool |
|
Whether to enable API rate limiting. |
|
str |
|
Rate limit rule (e.g., requests per time period). |
|
str |
|
Storage backend URI for rate limiting (e.g., |
|
bool |
|
Whether to enable server-side caching. |
|
bool |
|
If |
|
int |
|
Default cache timeout, in seconds. |
|
str |
|
Prefix for all cache keys. |
|
string |
|
Type of cache backend to use, one of: |
|
dict or null |
|
Additional configuration for the cache backend (e.g. Redis cache config settings). Set as a TOML table under |
|
str / int / int |
|
Redis connection settings (used when |
|
str or null |
|
Redis password, if required. |
|
str or null |
|
Full Redis URL; when set, overrides the individual |
|
float or null |
|
Redis socket read / connect timeouts in seconds. |
|
str or null |
|
Directory for |
|
int |
|
Maximum number of items |
|
list of str |
|
Memcached server addresses (used when |
|
str or null |
|
Memcached SASL credentials, if required. |
|
bool |
|
Reuse the general cache for the multi-worker database registry instead of
configuring a separate |
|
bool |
|
Whether to enable proxy support (for use behind reverse proxies). |
|
dict or null |
|
Proxy configuration settings. Required if |
|
list of str |
|
List of trusted proxy IP addresses or CIDR blocks allowed to set forwarded headers. Required (non-empty) when |
|
bool |
|
Whether API key authentication is required for access. |
|
str |
|
HTTP header used to transmit the API key. |
|
list of str or null |
|
List of trusted hostnames or IP addresses for incoming requests. |
|
str or null |
|
Path to the API key database file ( |
|
int or null |
|
Default number of days before API keys expire ( |
|
bool |
|
Whether to automatically remove expired API keys. |
|
bool |
|
Whether to log API key usage for audit purposes. |
|
str |
|
Logging level for authentication events. |
|
int |
|
Number of days before key expiry to issue warnings. |
|
bool |
|
Whether to enable Cross-Origin Resource Sharing (CORS). |
|
str or list of str |
|
Allowed origins for CORS ( |
|
list of str |
|
Allowed HTTP methods for CORS. |
|
list of str |
|
Allowed HTTP headers for CORS. |
|
int |
|
Maximum time (in seconds) for browsers to cache CORS preflight responses. |
|
bool |
|
Master switch for the security-header / CSP middleware. When |
|
bool |
|
Redirect HTTP requests to HTTPS and mark cookies secure. |
|
bool |
|
Send the |
|
int |
|
|
|
dict |
see below |
Content-Security-Policy directives as a mapping of directive to source
expression (default allows |
|
bool |
|
Send |
|
str |
|
Value for the |
|
bool |
|
Send the legacy |
|
str |
|
Value for the |
Extraction Settings
These live under the [extraction] table and control how uploaded files are
converted to Markdown (via all2md). Defaults are hardened for untrusted uploads.
See File Extraction System for the full security model.
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
bool |
|
Allow fetching remote assets referenced by a document. Leaving this off avoids an SSRF surface. |
|
list of str or null |
|
Host allowlist applied when |
|
bool |
|
HTML only: strip |
|
str |
|
How embedded attachments/assets are handled during extraction. |
Note
All configuration parameters can also be set via environment variables with the LVDB_ prefix,
using uppercase and underscores, e.g., LVDB_SERVER_DEBUG, LVDB_DATABASE_ROOT_DIR,
LVDB_EXTRACTION_ALLOW_REMOTE_FETCH, etc.