plexus.config.loader module
Plexus Configuration Loader
Loads configuration from YAML files with environment variable fallback. Supports precedence order: current directory -> user home directory -> environment variables.
- class plexus.config.loader.ConfigLoader
Bases:
objectLoads and processes Plexus configuration from YAML files.
- CONFIG_FILENAMES = ['config.yaml', 'config.yml']
- ENV_VAR_MAPPING = {'airtable.api_key': 'AIRTABLE_API_KEY', 'anthropic.api_key': 'ANTHROPIC_API_KEY', 'aws.access_key_id': 'AWS_ACCESS_KEY_ID', 'aws.data_lake.athena_results_bucket': 'PLEXUS_TRAINING_DATA_LAKE_ATHENA_RESULTS_BUCKET_NAME', 'aws.data_lake.bucket_name': 'PLEXUS_TRAINING_DATA_LAKE_BUCKET_NAME', 'aws.data_lake.database_name': 'PLEXUS_TRAINING_DATA_LAKE_DATABASE_NAME', 'aws.region_name': 'AWS_REGION_NAME', 'aws.secret_access_key': 'AWS_SECRET_ACCESS_KEY', 'aws.storage.datasets_bucket': 'AMPLIFY_STORAGE_DATASETS_BUCKET_NAME', 'aws.storage.report_block_details_bucket': 'AMPLIFY_STORAGE_REPORTBLOCKDETAILS_BUCKET_NAME', 'aws.storage.score_result_attachments_bucket': 'AMPLIFY_STORAGE_SCORERESULTATTACHMENTS_BUCKET_NAME', 'aws.storage.task_attachments_bucket': 'AMPLIFY_STORAGE_TASKATTACHMENTS_BUCKET_NAME', 'azure.api_base': 'AZURE_API_BASE', 'azure.api_key': 'AZURE_API_KEY', 'azure.api_version': 'AZURE_API_VERSION', 'azure.client_id': 'AZURE_CLIENT_ID', 'azure.client_secret': 'AZURE_CLIENT_SECRET', 'azure.openai_api_key': 'AZURE_OPENAI_API_KEY', 'azure.openai_deployment': 'AZURE_OPENAI_DEPLOYMENT', 'azure.openai_endpoint': 'AZURE_OPENAI_ENDPOINT', 'azure.tenant_id': 'AZURE_TENANT_ID', 'celery.aws_access_key_id': 'CELERY_AWS_ACCESS_KEY_ID', 'celery.aws_region_name': 'CELERY_AWS_REGION_NAME', 'celery.aws_secret_access_key': 'CELERY_AWS_SECRET_ACCESS_KEY', 'celery.broker_url': 'CELERY_BROKER_URL', 'celery.queue_name': 'CELERY_QUEUE_NAME', 'celery.result_backend': 'CELERY_RESULT_BACKEND', 'celery.result_backend_template': 'CELERY_RESULT_BACKEND_TEMPLATE', 'dashboard.minimal_branding': 'NEXT_PUBLIC_MINIMAL_BRANDING', 'debug': 'DEBUG', 'environment': 'environment', 'langchain.api_key': 'LANGCHAIN_API_KEY', 'langchain.debug': 'LANGCHAIN_DEBUG', 'langchain.endpoint': 'LANGCHAIN_ENDPOINT', 'langchain.project': 'LANGCHAIN_PROJECT', 'langchain.tracing_v2': 'LANGCHAIN_TRACING_V2', 'langgraph.timeout': 'LANGGRAPH_TIMEOUT', 'mlflow.experiment_name': 'MLFLOW_EXPERIMENT_NAME', 'mlflow.tracking_uri': 'MLFLOW_TRACKING_URI', 'openai.api_key': 'OPENAI_API_KEY', 'performance.mkl_num_threads': 'MKL_NUM_THREADS', 'performance.numexpr_num_threads': 'NUMEXPR_NUM_THREADS', 'performance.omp_num_threads': 'OMP_NUM_THREADS', 'performance.openblas_num_threads': 'OPENBLAS_NUM_THREADS', 'plexus.account_key': 'PLEXUS_ACCOUNT_KEY', 'plexus.api_key': 'PLEXUS_API_KEY', 'plexus.api_url': 'PLEXUS_API_URL', 'plexus.app_url': 'PLEXUS_APP_URL', 'plexus.default_account_id': 'PLEXUS_DEFAULT_ACCOUNT_ID', 'plexus.enable_batching': 'PLEXUS_ENABLE_BATCHING', 'plexus.langgraph_checkpointer_postgres_uri': 'PLEXUS_LANGGRAPH_CHECKPOINTER_POSTGRES_URI', 'plexus.working_directory': '_PLEXUS_WORKING_DIRECTORY', 'tensorflow.force_gpu_allow_growth': 'TF_FORCE_GPU_ALLOW_GROWTH', 'tensorflow.gpu_allocator': 'TF_GPU_ALLOCATOR'}
- HOME_CONFIG_DIR = '.plexus'
- __init__()
- get_available_sources() List[str]
Get list of available configuration sources.
- get_config_value(key_path: str, default: Any = None) Any
Get a configuration value by key path.
- load_config() Dict[str, Any]
Load configuration from all sources and set environment variables.
- class plexus.config.loader.ConfigSource(path: Path, priority: int, exists: bool = False)
Bases:
objectRepresents a configuration source with its path and priority.
- __init__(path: Path, priority: int, exists: bool = False) None
- exists: bool = False
- path: Path
- priority: int
- plexus.config.loader.load_config() Dict[str, Any]
Convenience function to load Plexus configuration.