Skip to content

SerenityGPT configuration reference

Introduction

SerenityGPT offers a flexible configuration system that adapts to various deployment and staging environments. This system uses a three-tiered approach to set configuration variables. It ensures easy management across different environments, allowing you to balance convenience and security while maintaining maximum data integrity.

Configuration hierarchy

SerenityGPT applies configuration values in the following order of precedence:

  1. Environment variables (highest priority).
  2. config.yaml file.
  3. Default fallback values in the application (lowest priority, where applicable).

This hierarchy allows you to easily override certain settings, while keeping other settings that are common across environments in the config.yaml file.

Recommendations for configuring different environments

Test and trial environments

In disposable or insecure environments:

  • Use the config.yaml file for general settings that won't change with different environments.
  • Set environment variables for local, environment-specific values and secrets.

Staging and production

For staging and production environments:

  • Use environment variables for sensitive information and environment-specific settings.
  • Optionally use a config.yaml for non-sensitive configuration shared with other environments.

Containerized environments (Docker/Kubernetes)

SerenityGPT supports mounting a config.yaml file into a container (mount path: /app/config/config.yaml). However, using environment variables is often preferred for the following reasons:

  • It's more secure when integrated with secret management systems.
  • It's more flexible, allowing changes between environments without rebuilding containers.
  • It's simpler, with built-in support in most container orchestration platforms.

As above, a hybrid approach often works best:

  • Use environment variables for sensitive and environment-specific information.
  • Use a mounted configuration file for static, non-sensitive shared configuration.

Settings best practices

To maintain a secure and manageable configuration:

  1. Don't commit sensitive information to version control.
  2. Use secure secret management systems for sensitive data in production.

By following these practices, you can maintain a secure, flexible, and easily manageable configuration system across all your Serenity deployment environments.