Configuration¶
Nexus supports three deployment modes: standalone, remote, and federation.
Configuration Methods¶
1. Configuration File (nexus.yaml)¶
Create nexus.yaml in your project directory:
# Deployment mode: standalone | remote | federation
mode: standalone
# Data directory for storing files and metadata
data_dir: ./nexus-data
2. Environment Variables¶
Override configuration with environment variables:
3. Programmatic Configuration¶
Configure directly in Python:
import nexus
# Using dict
config = {
"mode": "standalone",
"data_dir": "./nexus-data",
}
nx = nexus.connect(config=config)
# Using file path
nx = nexus.connect("./config.yaml")
Configuration Reference¶
Core Options¶
| Option | Type | Default | Description |
|---|---|---|---|
mode | string | standalone | Deployment mode (standalone, remote, federation) |
data_dir | string | ./nexus-data | Directory for storing files and metadata |
url | string | — | Server URL (required for remote mode) |
api_key | string | — | Authentication key for remote/server access |
Additional Options¶
cache_size_mb— In-memory cache sizeenable_vector_search— Vector search featuresenable_llm_cache— LLM response caching
Example Configurations¶
Development (Standalone)¶
Production (Standalone Server)¶
Remote Client¶
Federation (Multi-Node)¶
# Environment variables for federation nodes
NEXUS_MODE=federation
NEXUS_NODE_ID=1
NEXUS_BIND_ADDR=0.0.0.0:2126
NEXUS_PEERS=2@peer2:2126,3@peer3:2126
Using Environment Variables¶
Configuration Discovery¶
Nexus searches for configuration in this order:
- Explicit config passed to
nexus.connect() - Environment variables (
NEXUS_*) ./nexus.yamlin current directory./nexus.ymlin current directory~/.nexus/config.yamlin home directory- Default values (standalone mode with
./nexus-data)
Next Steps¶
- Deployment Modes - Learn about standalone, remote, and federation modes
- Quick Start - Get started with standalone mode