Configuration
Configure QBITEL Bridge through environment variables, YAML configuration files, and command-line arguments.
Configuration Methods
QBITEL Bridge supports three configuration methods, applied in order of precedence:
- Command-line arguments -- highest priority
- Environment variables -- override YAML settings
- YAML configuration files -- base configuration
YAML Configuration
Create a configuration file at config/qbitel.yaml:
# config/qbitel.yaml
rest_host: "127.0.0.1"
rest_port: 8000
grpc_port: 50051
log_level: "INFO"
enable_observability: true
device: "cpu" # or "cuda" for GPU acceleration
# Database
database_url: "postgresql://qbitel:password@localhost:5432/qbitel"
redis_url: "redis://localhost:6379/0"
# LLM Configuration
llm_provider: "ollama"
ollama_url: "http://localhost:11434"
llm_model: "llama3.2:8b"
# Security
jwt_secret: "your-secret-key"
api_key_enabled: true
mtls_enabled: false Run with a custom configuration file:
python -m ai_engine --config config/qbitel.yaml Core Environment Variables
| Variable | Default | Description |
|---|---|---|
QBITEL_ENVIRONMENT | development | Environment name (fallback: ENVIRONMENT) |
QBITEL_LOG_LEVEL | INFO | Logging level (DEBUG, INFO, WARNING, ERROR) |
QBITEL_DB_HOST | localhost | Database host (fallback: DATABASE_HOST) |
QBITEL_DB_PORT | 5432 | Database port (fallback: DATABASE_PORT) |
QBITEL_DB_PASSWORD | -- | Database password (fallback: DATABASE_PASSWORD) |
Database Configuration
| Variable | Default | Description |
|---|---|---|
QBITEL_REDIS_PASSWORD | -- | Redis password |
QBITEL_ENCRYPTION_KEY | -- | Encryption key for field-level encryption |
QBITEL_API_KEY | -- | API key for authentication (fallback: API_KEY) |
LLM Configuration
| Variable | Default | Description |
|---|---|---|
QBITEL_LLM_PROVIDER | ollama | LLM provider: ollama, vllm, or localai |
OLLAMA_URL | http://localhost:11434 | Ollama endpoint for on-premise LLM |
QBITEL_LLM_MODEL | llama3.2:8b | Default LLM model name |
QBITEL_AIRGAPPED_MODE | false | Enable air-gapped mode (no external API calls) |
Security Configuration
| Variable | Default | Description |
|---|---|---|
QBITEL_JWT_SECRET | -- | Secret key for JWT token signing (fallback: JWT_SECRET) |
API_KEY_ENABLED | true | Enable API key authentication |
MTLS_ENABLED | false | Enable mutual TLS authentication |
PQC_ENABLED | true | Enable post-quantum cryptography |
Observability Configuration
| Variable | Default | Description |
|---|---|---|
ENABLE_OBSERVABILITY | true | Enable metrics, tracing, and logging |
OTEL_EXPORTER_ENDPOINT | http://localhost:4317 | OpenTelemetry collector gRPC endpoint |
SENTRY_DSN | -- | Sentry DSN for error tracking |
PROMETHEUS_PORT | 9091 | Prometheus metrics endpoint port |
Environment-Specific Configuration
QBITEL Bridge ships with environment-specific YAML files:
config/
qbitel.yaml # Base configuration
qbitel.production.yaml # Production overrides
environments/
production.yaml # Production environment settings
staging.yaml # Staging environment settings Select an environment at startup:
# Use development mode with hot-reloading
python -m ai_engine --development --reload
# Use production configuration
python -m ai_engine --config config/qbitel.production.yaml Next Steps
- Full Environment Variables Reference -- complete list of all variables
- Docker Compose Deployment -- configure services in Docker
- Zero-Trust Architecture -- security configuration details