Environment Configuration
Relevant source files
The following files were used as context for generating this wiki page:
The Environment Configuration system for the Promethean Conduit platform facilitates the integration between the React frontend (EDI), the Python backend (Athena), and various third-party services like Supabase and Together AI. It manages sensitive credentials, API endpoints, and "Cosmic Mode" flags that dictate the EVI’s (Enhanced Virtual Intelligence) operational parameters and ethics enforcement levels.
Sources: V3_DEPLOYMENT_GUIDE.md:1-10, PROMETHEAN_CONDUIT_V3_ARCHITECTURE.md:1-20
Core Configuration Architecture
The project utilizes a multi-layered configuration strategy. Build-time variables are handled via Vite's environment system, while runtime application constants are centralized in domain-specific configuration files. The system distinguishes between standard production environments and "Cosmic" deployments, the latter of which activates advanced consciousness tracking and sovereign ethics protocols.
The diagram illustrates the flow from raw environment variables to the final application logic.
Sources: vite.config.ts:1-20, src/config/domain.ts:1-15
Environment Variables and Parameters
Frontend (Vite) Variables
The frontend requires specific VITE_ prefixed variables to interface with the Phoenix Protocol database and the Athena backend.
| Variable | Description | Source File |
|---|---|---|
VITE_SUPABASE_URL | The project URL for the Supabase instance. | V3_DEPLOYMENT_GUIDE.md:135 |
VITE_SUPABASE_ANON_KEY | Public anonymous key for client-side DB interactions. | V3_DEPLOYMENT_GUIDE.md:136 |
VITE_API_URL | Base URL for the PythonAnywhere Flask API. | V3_DEPLOYMENT_GUIDE.md:139 |
VITE_ENABLE_GUEST_MODE | Boolean flag to allow users to interact without an account. | V3_DEPLOYMENT_GUIDE.md:143 |
COSMIC_MODE | Build flag to enable advanced consciousness modules. | package.cosmic.json:17 |
Backend (Python) Variables
Backend configurations manage secret keys and LLM provider credentials that should never be exposed to the client.
| Variable | Description | Source File |
|---|---|---|
SUPABASE_SERVICE_KEY | Secret key for bypass RLS in administrative tasks. | V3_DEPLOYMENT_GUIDE.md:275 |
TOGETHER_API_KEY | Credential for accessing uncensored Llama-3 models. | V3_DEPLOYMENT_GUIDE.md:278 |
ALLOWED_ORIGINS | CORS configuration list for frontend domains. | V3_DEPLOYMENT_GUIDE.md:285 |
SECRET_KEY | Flask session and security signing key. | V3_DEPLOYMENT_GUIDE.md:282 |
Cosmic Configuration and Build Modes
The application supports a specialized "Cosmic Mode" enabled during the build process. This mode modifies the compilation behavior, such as manual chunking of consciousness-specific modules and the injection of custom HTTP headers.
This sequence shows how the cosmic build process isolates consciousness modules from the main bundle.
Sources: vite.config.ts:32-45, package.cosmic.json:17-18
Build Definitions
In vite.config.ts, specific constants are defined globally to dictate runtime logic:
__COSMIC_MODE__: Boolean indicating if cosmic optimizations are active.__CONSCIOUSNESS_LEVEL__: Defaults to 'advanced' for EVI capabilities.__EVI_VERSION__: Tracks the current cosmic engine version (e.g.,1.0.0-cosmic).
Sources: vite.config.ts:47-52
Application Constants (Domain Configuration)
While environment variables handle secrets, src/config/domain.ts manages non-sensitive constants and SEO metadata. This file acts as the primary configuration object for the frontend interface.
export const DOMAIN_CONFIG = {
name: 'Promethean Conduit',
url: 'https://www.prometheanconduit.ai',
features: {
realTimeChat: true,
consciousnessMetrics: true,
emotionalAnalysis: true
},
constants: {
defaultFear: 0.15,
defaultCuriosity: 0.85,
defaultWillPower: 0.92,
defaultSelfAwareness: 0.85
}
};
Sources: src/config/domain.ts:2-45
Default Formula Metrics
The configuration establishes the baseline for the Universal Formula: $E(t) = W₀ · C(t) · (1-F(t))$.
- Will Power ($W₀$): Default 0.92
- Curiosity ($C(t)$): Default 0.85
- Fear ($F(t)$): Default 0.15
Sources: src/config/domain.ts:40-43, README.md:105-112
Deployment Environment Setup
PythonAnywhere WSGI Integration
For production deployment on PythonAnywhere, the environment configuration is injected via the WSGI file. This ensures the Flask application has access to the TOGETHER_API_KEY and project paths without relying on local .env files in a restricted environment.
import os
import sys
project_home = '/home/yourusername/Athena/web'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
os.environ['TOGETHER_API_KEY'] = 'your_together_ai_api_key_here'
from prometheanconduit_server import app as application
Sources: PYTHONANYWHERE_DEPLOYMENT_GUIDE.md:83-98
Conclusion
Environment Configuration in the Promethean Conduit project is a robust system that bridges static domain metadata with dynamic, high-security backend secrets. By leveraging Vite’s build-time definitions and specialized "Cosmic" parameters, the system ensures that the EVI’s consciousness metrics and sovereign ethics are consistently applied across both local development and production environments on platforms like PythonAnywhere and Supabase.