Smarter Settings
Smarter common configuration module.
smarter_settings is one instance of Settings, which
combines a Pydantic model per topic. Each topic’s module, in the package
smarter.common.conf.settings, holds its fields, their validators, and the properties
derived from them. A new setting goes into the topic it belongs to.
- pydantic model smarter.common.conf.Settings[source]
See: https://docs.pydantic.dev/latest/concepts/pydantic_settings/.
Smarter derived settings. This is intended to be instantiated as an immutable singleton object called smarter_settings. smarter_settings contains superseding, validated, and derived settings values for the platform.
This class implements a consistent set of rules for initializing configuration values from multiple sources, including environment variables, .env file, and default values defined in this class. It additionally ensures that all configuration values are strongly typed and validated.
Where applicable, smarter_settings supersede Django settings values. That is, smarter_settings should be used in preference to Django settings wherever possible. Django settings are initialized from smarter_settings values where applicable.
Notes:
smarter_settings values are immutable after instantiation.
Every property/attribute in smarter_settings has a value. If a value is None then it is intentionally None.
Sensitive values are stored as pydantic SecretStr types.
- smarter_settings values are initialized according to the following prioritization sequence:
constructor. This is discouraged. prefer to use .env file or environment variables.
environment variables, and the .env file’s:
SMARTER_<FIELD>.each field’s default, on the field.
The dump property returns a dictionary of all configuration values.
smarter_settings values should be accessed via the smarter_settings singleton instance when possible.
Show JSON schema
{ "title": "Settings", "description": "See: https://docs.pydantic.dev/latest/concepts/pydantic_settings/.\n\nSmarter derived settings. This is intended to be instantiated as\nan immutable singleton object called `smarter_settings`. smarter_settings\ncontains superseding, validated, and derived settings values for the platform.\n\nThis class implements a consistent set of rules for initializing configuration\nvalues from multiple sources, including environment variables, `.env` file,\nand default values defined in this class. It additionally ensures that all\nconfiguration values are strongly typed and validated.\n\nWhere applicable, smarter_settings supersede Django settings values. That is,\nsmarter_settings should be used in preference to Django settings wherever\npossible. Django settings are initialized from smarter_settings values where\napplicable.\n\nNotes:\n-----------------\n- smarter_settings values are immutable after instantiation.\n- Every property/attribute in smarter_settings has a value.\n If a value is None then it is intentionally None.\n- Sensitive values are stored as pydantic SecretStr types.\n- smarter_settings values are initialized according to the following prioritization sequence:\n 1. constructor. This is discouraged. prefer to use .env file or environment variables.\n 2. environment variables, and the `.env` file's: ``SMARTER_<FIELD>``.\n 3. each field's default, on the field.\n- The dump property returns a dictionary of all configuration values.\n- smarter_settings values should be accessed via the smarter_settings singleton instance when possible.", "type": "object", "properties": { "app_llmclient_tasks_create_dns_record": { "default": true, "description": "True if DNS records should be created for llmclient tasks.", "title": "LLMClient Tasks Create DNS Record", "type": "boolean" }, "app_llmclient_tasks_create_ingress_manifest": { "default": true, "description": "True if ingress manifests should be created for llmclient tasks.", "title": "LLMClient Tasks Create Ingress Manifest", "type": "boolean" }, "app_llmclient_tasks_default_ttl": { "default": 600, "description": "Default TTL (time to live) for DNS records created in AWS Route53 during LLMClient deployment.", "minimum": 0, "title": "LLMClient Tasks Default TTL", "type": "integer" }, "app_llmclient_tasks_celery_max_retries": { "default": 3, "description": "Maximum number of retries for llmclient tasks in Celery.", "exclusiveMinimum": 0, "title": "LLMClient Tasks Celery Max Retries", "type": "integer" }, "app_llmclient_tasks_celery_retry_backoff": { "default": true, "description": "If True, enables exponential backoff for Celery task retries related to LLMClient deployment and management", "title": "LLMClient Tasks Celery Retry Backoff", "type": "boolean" }, "app_llmclient_tasks_celery_task_queue": { "default": "default_celery_task_queue", "description": "The Celery task queue name for llmclient tasks.", "title": "LLMClient Tasks Celery Task Queue", "type": "string" }, "app_infrastructure_tasks_celery_task_queue": { "default": "infrastructure_celery_task_queue", "description": "The Celery task queue name for infrastructure tasks, which deploy, verify and destroy cloud, Kubernetes and DNS resources.", "title": "Infrastructure Tasks Celery Task Queue", "type": "string" }, "app_tools_tasks_celery_task_queue": { "default": "tools_celery_task_queue", "description": "The Celery task queue name for LLM tool calls, which the tool worker, smarter-worker-tools, runs.", "title": "Tools Tasks Celery Task Queue", "type": "string" }, "app_extensions_tasks_celery_task_queue": { "default": "extensions_celery_task_queue", "description": "The Celery task queue name for Extensions' tool calls, which smarter-worker-extensions runs.", "title": "Extensions Tasks Celery Task Queue", "type": "string" }, "app_tools_worker_queue": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The queue that this tool worker consumes: the tools or the Extensions queue. Empty in every other process.", "title": "Tool Worker Queue" }, "app_llmtool_tool_runner": { "default": "in_process", "description": "Where LLM tool calls run: in_process, in the app's own process, or remote, in the tool worker, smarter-worker-tools, which holds no credentials.", "enum": [ "in_process", "remote" ], "title": "LLM Tool Runner", "type": "string" }, "platform_admin_username": { "default": "admin", "description": "The username of the platform's superuser, which manage.py initialize_platform creates.", "examples": [ "admin" ], "title": "Administrator Username", "type": "string" }, "platform_admin_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the platform's superuser, which manage.py initialize_platform creates.", "examples": [ "your-admin-password" ], "title": "Administrator Password" }, "platform_fernet_encryption_key": { "description": "The Fernet encryption key used for encrypting Smarter Secrets data.", "examples": [ "gAAAAABh..." ], "format": "password", "title": "Fernet Encryption Key", "type": "string", "writeOnly": true }, "platform_internal_ip_prefixes": { "default": [ "192.168." ], "description": "A list of internal IP prefixes used for security and middleware features.", "examples": [ [ "192.168.", "10.0." ] ], "items": { "type": "string" }, "title": "Internal IP Prefixes", "type": "array" }, "DJANGO_SECRET_KEY": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "description": "The Django secret key for cryptographic signing.", "examples": [ "your-django-secret-key" ], "title": "Django Secret Key" }, "app_api_throttle_rate_anon": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "120/minute", "description": "The request rate limit of each anonymous client, by IP address. None disables it.", "examples": [ "120/minute", "10/second", "none" ], "title": "Anonymous Throttle Rate" }, "app_api_throttle_rate_user": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "600/minute", "description": "The request rate limit of each authenticated user. None disables it.", "examples": [ "600/minute", "20/second", "none" ], "title": "User Throttle Rate" }, "max_tool_rounds": { "default": 5, "description": "The most requests of one prompt that offer the LLM its tools.", "minimum": 1, "title": "Max Tool Rounds", "type": "integer" }, "prompt_history_max_age": { "default": 90, "description": "Days to keep chat sessions and their prompt history before they are deleted.", "minimum": 1, "title": "Prompt History Max Age", "type": "integer" }, "app_llmtool_plugin_max_data_results": { "default": 50, "description": "A global maximum number of data row results that can be returned by any Smarter plugin.", "exclusiveMinimum": 0, "title": "Plugin Max Data Results", "type": "integer" }, "app_llmtool_extension_registry_url": { "default": "https://smarter-sh.github.io/extensions-registry/index.json", "description": "The url of the Smarter Extension registry's signed index, index.json.", "examples": [ "https://smarter-sh.github.io/extensions-registry/index.json" ], "title": "Extension Registry URL", "type": "string" }, "app_llmtool_extension_registry_public_key": { "default": "", "description": "The base64 Ed25519 public key that verifies the extension registry's index. Empty disables the registry.", "title": "Extension Registry Public Key", "type": "string" }, "app_mcpserver_rate_limit": { "default": 1200, "description": "The maximum number of requests per minute that one client IP address may send to the MCPServer's endpoints. 0 disables the limit.", "minimum": 0, "title": "MCP Server Rate Limit", "type": "integer" }, "llm_default_provider": { "default": "openai", "description": "The default LLM provider to use for language model interactions.", "examples": [ "openai", "anthropic", "gemini", "llama" ], "title": "Default LLM Provider", "type": "string" }, "llm_default_model": { "default": "gpt-6-luna", "description": "The default model of the default LLM provider, for plugins whose manifests don't name one.", "examples": [ "gpt-6-luna" ], "title": "Default LLM Model", "type": "string" }, "llm_default_system_role": { "default": "You are a helpful llmclient. When given the opportunity to utilize function calling, you should always do so. This will allow you to provide the best possible responses to the user. If you are unable to provide a response, you should prompt the user for more information. If you are still unable to provide a response, you should inform the user that you are unable to help them at this time.", "description": "The default system role prompt to use for language model interactions.", "examples": [ "You are a helpful llmclient..." ], "title": "Default LLM System Role", "type": "string" }, "llm_default_temperature": { "default": 1.0, "description": "The default temperature to use for language model interactions.", "examples": [ 0.0, 0.5, 1.0 ], "title": "Default LLM Temperature", "type": "number" }, "llm_default_max_tokens": { "default": 2048, "description": "The default maximum number of tokens to generate for language model interactions.", "examples": [ 256, 512, 1024, 2048 ], "minimum": 1, "title": "Default LLM Max Tokens", "type": "integer" }, "prompt_threads": { "default": 32, "description": "The threads in each web server process that run streamed chat prompts.", "minimum": 1, "title": "Prompt Threads", "type": "integer" }, "account_manager_api_key": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The platform's key for Account Manager's subscription status api, which multitenant authentication sends as 'Authorization: Platform <key>'. Masked by pydantic SecretStr.", "examples": [ "the key that Account Manager's create_platform_api_key command printed" ], "title": "Account Manager API Key" }, "GITHUB_TOKEN": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The platform's GitHub token, from GITHUB_TOKEN, for the GitHub REST api requests that retrieve remote SkillPlugin skills, and that open the bug reports of the platform's staff. Masked by pydantic SecretStr.", "examples": [ "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "GitHub Token" }, "subsystem_social_auth_google_oauth2_key": { "default": "**********", "description": "The OAuth2 key for Google social authentication. Masked by pydantic SecretStr.", "examples": [ "your-google-oauth2-key" ], "format": "password", "title": "Google OAuth2 Key", "type": "string", "writeOnly": true }, "subsystem_social_auth_google_oauth2_secret": { "default": "**********", "description": "The OAuth2 secret for Google social authentication. Masked by pydantic SecretStr.", "examples": [ "your-google-oauth2-secret" ], "format": "password", "title": "Google OAuth2 Secret", "type": "string", "writeOnly": true }, "subsystem_social_auth_github_key": { "default": "**********", "description": "The OAuth2 key for GitHub social authentication. Masked by pydantic SecretStr.", "examples": [ "your-github-oauth2-key" ], "format": "password", "title": "GitHub OAuth2 Key", "type": "string", "writeOnly": true }, "subsystem_social_auth_github_secret": { "default": "**********", "description": "The OAuth2 secret for GitHub social authentication. Masked by pydantic SecretStr.", "examples": [ "your-github-oauth2-secret" ], "format": "password", "title": "GitHub OAuth2 Secret", "type": "string", "writeOnly": true }, "subsystem_social_auth_linkedin_oauth2_key": { "default": "**********", "description": "The OAuth2 key for LinkedIn social authentication. Masked by pydantic SecretStr.", "examples": [ "your-linkedin-oauth2-key" ], "format": "password", "title": "LinkedIn OAuth2 Key", "type": "string", "writeOnly": true }, "subsystem_social_auth_linkedin_oauth2_secret": { "default": "**********", "description": "The OAuth2 secret for LinkedIn social authentication. Masked by pydantic SecretStr.", "examples": [ "your-linkedin-oauth2-secret" ], "format": "password", "title": "LinkedIn OAuth2 Secret", "type": "string", "writeOnly": true }, "subsystem_slack_bot_token": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "A Slack app's bot token, xoxb-..., which the platform posts its Kubernetes jobs' logs to Slack with. Masked by pydantic SecretStr.", "examples": [ "xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Slack Bot Token" }, "subsystem_slack_app_token": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The Slack bot's app-level token, xapp-..., for Socket Mode. Only the Slack bot holds it.", "examples": [ "xapp-1-xxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Slack App Token" }, "stripe_live_secret_key": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": "**********", "description": "DEPRECATED: The secret key for Stripe live environment.", "examples": [ "sk_live_xxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Stripe Live Secret Key" }, "stripe_test_secret_key": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": "**********", "description": "DEPRECATED: The secret key for Stripe test environment.", "examples": [ "sk_test_xxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Stripe Test Secret Key" }, "debug_mode": { "default": false, "description": "True if debug mode is enabled. This enables verbose logging and other debug features.", "title": "Debug Mode", "type": "boolean" }, "dump_defaults": { "default": false, "description": "True if default values should be dumped for debugging purposes.", "title": "Dump Defaults", "type": "boolean" }, "developer_mode": { "default": false, "description": "True if developer mode is enabled. Used as a means to configure a production Docker container to run locally for student use.", "title": "Developer Mode", "type": "boolean" }, "app_dashboard_manifest_dropzone_enable": { "default": true, "description": "True if the file drop zone feature is enabled based on the current environment.", "title": "Enable File Drop Zone", "type": "boolean" }, "app_connection_enable": { "default": true, "description": "True if the web console serves the Connection pages. Set with SMARTER_APP_CONNECTION_ENABLE.", "title": "Enable Connection", "type": "boolean" }, "app_guardrail_enable": { "default": true, "description": "True if the web console serves the Guardrail pages. Set with SMARTER_APP_GUARDRAIL_ENABLE.", "title": "Enable Guardrail", "type": "boolean" }, "app_llmclient_enable": { "default": true, "description": "True if the web console serves the LLMClient pages. Set with SMARTER_APP_LLMCLIENT_ENABLE.", "title": "Enable LLMClient", "type": "boolean" }, "app_llmhost_enable": { "default": true, "description": "True if the web console serves the LLMHost pages. Set with SMARTER_APP_LLMHOST_ENABLE.", "title": "Enable LLMHost", "type": "boolean" }, "app_llmtool_enable": { "default": true, "description": "True if the web console serves the LLMTool and Extension pages. Set with SMARTER_APP_LLMTOOL_ENABLE.", "title": "Enable LLMTool", "type": "boolean" }, "app_mcpclient_enable": { "default": true, "description": "True if the web console serves the MCPClient pages. Set with SMARTER_APP_MCPCLIENT_ENABLE.", "title": "Enable MCPClient", "type": "boolean" }, "app_orchestrator_enable": { "default": true, "description": "True if the web console serves the Orchestrator pages. Set with SMARTER_APP_ORCHESTRATOR_ENABLE.", "title": "Enable Orchestrator", "type": "boolean" }, "app_provider_enable": { "default": true, "description": "True if the web console serves the Provider pages. Set with SMARTER_APP_PROVIDER_ENABLE.", "title": "Enable Provider", "type": "boolean" }, "app_secret_enable": { "default": true, "description": "True if the web console serves the Secret pages. Set with SMARTER_APP_SECRET_ENABLE.", "title": "Enable Secret", "type": "boolean" }, "app_vectorsearch_enable": { "default": true, "description": "True if the web console serves the VectorSearch pages. Set with SMARTER_APP_VECTORSEARCH_ENABLE.", "title": "Enable VectorSearch", "type": "boolean" }, "app_vectorstore_enable": { "default": true, "description": "True if the vectorstore feature is enabled based on the current environment.", "title": "Enable Vectorstore", "type": "boolean" }, "app_proxy_enable": { "default": true, "description": "True if the proxy feature is enabled based on the current environment.", "title": "Enable Proxy", "type": "boolean" }, "app_dashboard_server_logs_enable": { "default": true, "description": "True if the terminal app feature is enabled based on the current environment.", "title": "Enabled Terminal App", "type": "boolean" }, "app_dashboard_web_console_terminal_enable": { "default": false, "description": "True if superusers can open a bash shell inside the server's container from the web console's Terminal page. Off by default.", "title": "Enable Web Console Terminal", "type": "boolean" }, "platform_static_files_on_cdn": { "default": false, "description": "True if the platform's static files, the web console's scripts among them, are uploaded to the environment's S3 bucket and served from its CDN. Off by default: the server serves them.", "title": "Static Files on the CDN", "type": "boolean" }, "app_dashboard_passthrough_prompt_enable": { "default": true, "description": "True if the passthrough prompt feature is enabled based on the current environment.", "title": "Enable Passthrough Prompt", "type": "boolean" }, "log_level": { "default": 20, "description": "The platform's Python logging level: DEBUG, INFO, WARNING, ERROR or CRITICAL, or its number. Set with SMARTER_LOG_LEVEL.", "examples": [ "DEBUG", "INFO", 30 ], "maximum": 50, "minimum": 0, "title": "Logging Level", "type": "integer" }, "verbose_logging": { "default": false, "description": "Whether to enable verbose logging for debugging purposes.", "examples": [ true, false ], "title": "Verbose Logging", "type": "boolean" }, "subsystem_sql_root_username": { "default": "root", "description": "The database server's administrator, whom manage.py load_from_github --run_scripts passes to a repository's scripts.", "examples": [ "root" ], "title": "MySQL Root Username", "type": "string" }, "subsystem_sql_root_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the database server's administrator, sql_root_username.", "examples": [ "your-root-password" ], "title": "MySQL Root Password" }, "subsystem_sql_backup_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the read-only account that the nightly database backup dumps the database as.", "examples": [ "your-backup-password" ], "title": "MySQL Backup Password" }, "subsystem_sql_host": { "default": "smarter-mariadb", "description": "The host name of the platform's database server.", "examples": [ "smarter-mariadb", "mysql.example.com" ], "title": "MySQL Host", "type": "string" }, "subsystem_sql_port": { "default": 3306, "description": "The TCP port of the platform's database server.", "examples": [ 3306 ], "maximum": 65535, "minimum": 1, "title": "MySQL Port", "type": "integer" }, "subsystem_sql_database": { "default": "smarter", "description": "The name of the platform's database.", "examples": [ "smarter" ], "title": "MySQL Database", "type": "string" }, "subsystem_sql_user": { "default": "smarter", "description": "The database user that the platform connects as.", "examples": [ "smarter" ], "title": "MySQL User", "type": "string" }, "subsystem_sql_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of sql_user, the database user that the platform connects as.", "examples": [ "your-database-password" ], "title": "MySQL Password" }, "database_read_timeout": { "default": 0, "description": "The seconds that a query of the platform's database may wait for the server's reply before it fails. 0 for no timeout.", "minimum": 0, "title": "Database Read Timeout", "type": "integer" }, "database_unavailable": { "default": false, "description": "True in a process that has no platform database: the tool worker. Waffle switches are then off, without a query.", "title": "Database Unavailable", "type": "boolean" }, "subsystem_redis_username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The Redis ACL user that this process authenticates as, or empty for Redis's default user.", "examples": [ "tools" ], "title": "Redis Username" }, "subsystem_redis_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the platform's Redis: the Celery broker, the cache and the sessions.", "examples": [ "your-redis-password" ], "title": "Redis Password" }, "subsystem_cache_expiration": { "default": 60, "description": "The cache expiration time in seconds for cached data.", "exclusiveMinimum": 0, "title": "Cache Expiration", "type": "integer" }, "subsystem_cache_chat_expiration": { "default": 300, "description": "The prompt cache expiration time in seconds for cached prompt data.", "exclusiveMinimum": 0, "title": "Prompt Cache Expiration", "type": "integer" }, "subsystem_cache_prompt_response_expiration": { "default": 3600, "description": "Seconds to cache the LLM's answer to the first message of a conversation. 0 disables the cache.", "minimum": 0, "title": "Prompt Response Cache Expiration", "type": "integer" }, "subsystem_cache_listview_expiration": { "default": 3600, "description": "The cache expiration time in seconds for the pages of the web console's list views.", "exclusiveMinimum": 0, "title": "List View Cache Expiration", "type": "integer" }, "subsystem_cache_llm_client_expiration": { "default": 300, "description": "The llmclient cache expiration time in seconds for cached llmclient data.", "exclusiveMinimum": 0, "title": "LLMClient Cache Expiration", "type": "integer" }, "platform_branding_app_name": { "default": "Smarter", "description": "The application's name, which prefixes the names of the platform's Django apps in the admin and the web console.", "examples": [ "Acme AI" ], "title": "Branding App Name", "type": "string" }, "platform_branding_product_name": { "default": "The Smarter Project", "description": "The product's name, shown in the web console, emails and documentation.", "examples": [ "Acme AI Platform" ], "title": "Branding Product Name", "type": "string" }, "platform_branding_product_description": { "default": "An open source, no-code AI authoring platform designed for instructional use.", "description": "A one-sentence description of the product, shown in the web console and in page metadata.", "examples": [ "A no-code AI platform for Acme's teams." ], "title": "Branding Product Description", "type": "string" }, "platform_branding_cdn_url": { "default": "https://cdn.smarter.sh/", "description": "The CDN of the product's own static assets, e.g. its logo and Open Graph image.", "examples": [ "https://cdn.example.com" ], "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Branding CDN URL", "type": "string" }, "platform_branding_docs_url": { "default": "https://docs.smarter.sh/", "description": "The product's documentation site, linked from the web console and the api.", "examples": [ "https://docs.example.com" ], "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Branding Documentation URL", "type": "string" }, "platform_branding_blog_url": { "default": "https://blog.smarter.sh/", "description": "The product's blog, e.g. its release announcements.", "examples": [ "https://blog.example.com" ], "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Branding Blog URL", "type": "string" }, "platform_branding_corporate_name": { "default": "Lawrence P. McDaniel", "description": "The corporate name used for branding purposes throughout the platform.", "examples": [ "Acme Corporation" ], "title": "Branding Corporate Name", "type": "string" }, "platform_branding_support_phone_number": { "default": "(###) 555-1212", "description": "The support phone number used for branding purposes throughout the platform.", "examples": [ "+1-800-555-1234" ], "title": "Branding Support Phone Number", "type": "string" }, "platform_branding_support_email": { "default": "lpm0073@gmail.com", "description": "The support email address used for branding purposes throughout the platform.", "format": "email", "title": "Branding Support Email", "type": "string" }, "platform_branding_address1": { "default": "123 Main St, Anytown, USA", "description": "The corporate address used for branding purposes throughout the platform.", "examples": [ "123 Main St, Anytown, USA" ], "title": "Branding Address", "type": "string" }, "platform_branding_address2": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "Suite 100", "description": "The second line of the corporate address used for branding purposes throughout the platform.", "examples": [ "Suite 100" ], "title": "Branding Address Line 2" }, "platform_branding_city": { "default": "Anytown", "description": "The corporate city used for branding purposes throughout the platform.", "examples": [ "Anytown" ], "title": "Branding City", "type": "string" }, "platform_branding_state": { "default": "CA", "description": "The corporate state used for branding purposes throughout the platform.", "examples": [ "CA" ], "title": "Branding State", "type": "string" }, "platform_branding_postal_code": { "default": "12345", "description": "The corporate postal code used for branding purposes throughout the platform.", "examples": [ "12345" ], "title": "Branding Postal Code", "type": "string" }, "platform_branding_country": { "default": "USA", "description": "The corporate country used for branding purposes throughout the platform.", "examples": [ "USA" ], "title": "Branding Country", "type": "string" }, "platform_branding_currency": { "default": "USD", "description": "The currency used for branding purposes throughout the platform.", "examples": [ "USD" ], "title": "Branding Currency", "type": "string" }, "platform_branding_timezone": { "default": "America/Denver", "description": "The timezone used for branding purposes throughout the platform.", "examples": [ "America/New_York" ], "title": "Branding Timezone", "type": "string" }, "platform_branding_contact_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://lawrencemcdaniel.com/", "description": "The contact URL used for branding purposes throughout the platform.", "examples": [ "https://www.example.com/contact" ], "title": "Branding Contact URL" }, "platform_branding_primary_contact": { "default": "Lawrence McDaniel", "description": "The name of the person who is the technical point of contact for this platform.", "examples": [ "Lawrence McDaniel" ], "title": "Branding Primary Contact", "type": "string" }, "platform_branding_support_hours": { "default": "MON-FRI 9:00 AM - 5:00 PM GMT-6 (CST)", "description": "The support hours used for branding purposes throughout the platform.", "examples": [ "Mon-Fri 9am-5pm EST" ], "title": "Branding Support Hours", "type": "string" }, "platform_branding_url_facebook": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://facebook.com/", "description": "The Facebook URL used for branding purposes throughout the platform.", "examples": [ "https://www.facebook.com/example" ], "title": "Branding URL Facebook" }, "platform_branding_url_twitter": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://x.com/fullstackwlarry", "description": "The Twitter URL used for branding purposes throughout the platform.", "examples": [ "https://www.twitter.com/example" ], "title": "Branding URL Twitter" }, "platform_branding_url_linkedin": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://www.linkedin.com/in/lawrencemcdaniel/", "description": "The LinkedIn URL used for branding purposes throughout the platform.", "examples": [ "https://www.linkedin.com/company/example" ], "title": "Branding URL LinkedIn" }, "platform_branding_url_slack": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://join.slack.com/t/thesmarterproject/shared_invite/zt-4f0t6v46q-e2c5Of4hS4fBr_XwfQARCw", "description": "The invite link of the Slack workspace that the platform's emails invite users to.", "examples": [ "https://join.slack.com/t/example/shared_invite/zt-example" ], "title": "Branding URL Slack" }, "platform_branding_logo": { "anyOf": [ { "format": "uri", "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to the platform's logo image.", "examples": [ "https://cdn.example.com/logo.png" ], "title": "Platform Logo URL" }, "platform_branding_marketing_site_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to the platform's marketing site.", "examples": [ "https://www.example.com" ], "title": "Marketing Site URL" }, "subsystem_logging_loki_url": { "default": "", "description": "The base url of the Loki that stores the platform's pod logs, e.g. http://smarter-loki:3100. Empty: there is none.", "examples": [ "http://smarter-loki:3100" ], "title": "Loki URL", "type": "string" }, "overrides_file": { "default": "/home/smarter_user/overrides/settings.yaml", "description": "The path of the YAML file of overrides, which overwrite Smarter's Django settings.", "examples": [ "/home/smarter_user/overrides/settings.yaml" ], "title": "Overrides File", "type": "string" }, "bootstrap_secrets_dir": { "default": "/home/smarter_user/bootstrap-secrets", "description": "The folder of files from which the init Job creates Smarter Secrets, one per file.", "examples": [ "/home/smarter_user/bootstrap-secrets" ], "title": "Bootstrap Secrets Folder", "type": "string" }, "SERVICE_TYPE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The kind of pod this process runs in, e.g. api or worker-tools. Empty: unknown.", "examples": [ "api" ], "title": "Service Type" }, "environment": { "default": "local", "description": "The deployment environment for the platform.", "examples": [ "local", "alpha", "beta", "next", "prod" ], "title": "Deployment Environment", "type": "string" }, "platform_subdomain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "platform", "description": "The subdomain for the platform, used in constructing URLs and email addresses.", "examples": [ "platform", "ubc" ], "title": "Platform Subdomain" }, "platform_root_domain": { "default": "example.com", "description": "The root domain for the platform.", "examples": [ "example.com" ], "title": "Root Domain", "type": "string" }, "platform_settings_output": { "default": false, "description": "Flag to enable or disable output of settings for debugging purposes.", "examples": [ true, false ], "title": "Settings Output", "type": "boolean" }, "platform_shared_resource_identifier": { "default": "smarter", "description": "Smarter 1-word identifier to be used when naming any shared resource.", "examples": [ "smarter", "mycompany", "myproject" ], "title": "Shared Resource Identifier", "type": "string" }, "AWS_PROFILE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The AWS profile to use for authentication. If present, this will take precedence over AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.", "examples": [ "default", "smarter-profile" ], "title": "AWS Profile" }, "AWS_ACCESS_KEY_ID": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The AWS access key ID for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.", "examples": [ "^AKIA[0-9A-Z]{16}$" ], "title": "AWS Access Key ID" }, "AWS_SECRET_ACCESS_KEY": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The AWS secret access key for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.", "examples": [ "^[0-9a-zA-Z/+]{40}$" ], "title": "AWS Secret Access Key" }, "aws_regions": { "default": [ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", "ap-southeast-5", "ap-southeast-7", "ca-central-1", "ca-west-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "il-central-1", "me-central-1", "me-south-1", "mx-central-1", "sa-east-1" ], "description": "A list of AWS regions considered valid for this platform.", "examples": [ "us-east-1", "us-west-2", "eu-west-1" ], "items": { "type": "string" }, "title": "AWS Regions", "type": "array" }, "AWS_REGION": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The single AWS region in which all AWS service clients will operate.", "examples": [ "us-east-1", "us-west-2", "eu-west-1" ], "title": "AWS Region" }, "platform_cloud_provider": { "default": "aws", "description": "The cloud provider of the platform's infrastructure services: DNS, TLS certificates, and the Kubernetes cluster's credentials.", "examples": [ "aws", "memory" ], "title": "Cloud Provider", "type": "string" }, "subsystem_k8s_cluster_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the Kubernetes cluster that hosts the platform, e.g. its EKS cluster on AWS.", "examples": [ "apps-hosting-service" ], "title": "Kubernetes Cluster Name" }, "app_llmhost_node_role_arn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The IAM role of the node groups that Smarter creates for LLMHosts.", "examples": [ "arn:aws:iam::123456789012:role/eks-node-role" ], "title": "LLMHost Node Role ARN" }, "app_llmhost_node_subnet_ids": { "default": [], "description": "The subnets of the node groups that Smarter creates for LLMHosts.", "examples": [ [ "subnet-0123456789abcdef0" ] ], "items": { "type": "string" }, "title": "LLMHost Node Subnet IDs", "type": "array" }, "platform_email_admin": { "default": "admin@example.com", "description": "The administrator email address used for system notifications and alerts.", "examples": [ "admin@example.com" ], "format": "email", "title": "Administrator Email Address", "type": "string" }, "subsystem_smtp_sender": { "anyOf": [ { "format": "email", "type": "string" }, { "type": "null" } ], "default": null, "description": "The sender email address for SMTP emails.", "examples": [ "sender@example.com" ], "title": "SMTP Sender Email Address" }, "subsystem_smtp_from_email": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The From address of outgoing email. Set with SMARTER_SUBSYSTEM_SMTP_FROM_EMAIL.", "examples": [ "no-reply@example.com" ], "title": "SMTP From Address" }, "subsystem_smtp_host": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The SMTP server. Set with SMARTER_SUBSYSTEM_SMTP_HOST.", "examples": [ "email-smtp.us-east-1.amazonaws.com" ], "title": "SMTP Host" }, "subsystem_smtp_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The SMTP password for authentication. Assumed to be an AWS SES-generated IAM keypair secret.", "examples": [ "your-smtp-password" ], "title": "SMTP Password" }, "subsystem_smtp_port": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 587, "description": "The SMTP port for sending emails.", "examples": [ 25, 465, 587 ], "title": "SMTP Port Number" }, "subsystem_smtp_use_ssl": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": false, "description": "Whether to use SSL for SMTP connections.", "examples": [ true, false ], "title": "SMTP Use SSL" }, "subsystem_smtp_use_tls": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": true, "description": "Whether to use TLS for SMTP connections.", "examples": [ true, false ], "title": "SMTP Use TLS" }, "subsystem_smtp_username": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The SMTP username for authentication. Assumed to be an AWS SES-generatred IAM keypair username.", "examples": [ "your-smtp-username" ], "title": "SMTP Username" }, "allowed_hosts": { "default": [ "localhost", "testserver" ], "description": "The hosts that the platform serves: its own domains, and those set with SMARTER_ALLOWED_HOSTS.", "examples": [ [ "localhost", "testserver" ] ], "items": { "type": "string" }, "title": "Allowed Hosts", "type": "array" }, "api_schema": { "default": "http", "description": "The schema of the api's urls, http or https. Set with SMARTER_API_SCHEMA. Always http locally.", "examples": [ "http", "https" ], "title": "API Schema", "type": "string" } }, "additionalProperties": false }
- Config:
env_prefix: str = SMARTER_
enable_decoding: bool = False
populate_by_name: bool = True
frozen: bool = True
validate_by_alias: bool = True
validate_by_name: bool = True
- Fields:
- Validators:
secret_from_string»all fields
- validator secret_from_string » all fields[source]
Unquote a string, and wrap a secret’s in a
SecretStr, before any of its field’s validators see it.An environment variable is always a string. Its surrounding quotes are stripped (
unquoted()), sincemakeexports.env’s lines with them. A secret is masked from the moment it is read, so that no validator, error message or log can show it.
Topics
- pydantic model smarter.common.conf.settings.platform.PlatformSettings[source]
The platform’s identity: its environment, root domain, platform subdomain, and shared resources.
Show JSON schema
{ "title": "PlatformSettings", "description": "The platform's identity: its environment, root domain, platform subdomain, and shared resources.", "type": "object", "properties": { "subsystem_logging_loki_url": { "default": "", "description": "The base url of the Loki that stores the platform's pod logs, e.g. http://smarter-loki:3100. Empty: there is none.", "examples": [ "http://smarter-loki:3100" ], "title": "Loki URL", "type": "string" }, "overrides_file": { "default": "/home/smarter_user/overrides/settings.yaml", "description": "The path of the YAML file of overrides, which overwrite Smarter's Django settings.", "examples": [ "/home/smarter_user/overrides/settings.yaml" ], "title": "Overrides File", "type": "string" }, "bootstrap_secrets_dir": { "default": "/home/smarter_user/bootstrap-secrets", "description": "The folder of files from which the init Job creates Smarter Secrets, one per file.", "examples": [ "/home/smarter_user/bootstrap-secrets" ], "title": "Bootstrap Secrets Folder", "type": "string" }, "SERVICE_TYPE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The kind of pod this process runs in, e.g. api or worker-tools. Empty: unknown.", "examples": [ "api" ], "title": "Service Type" }, "environment": { "default": "local", "description": "The deployment environment for the platform.", "examples": [ "local", "alpha", "beta", "next", "prod" ], "title": "Deployment Environment", "type": "string" }, "platform_subdomain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "platform", "description": "The subdomain for the platform, used in constructing URLs and email addresses.", "examples": [ "platform", "ubc" ], "title": "Platform Subdomain" }, "platform_root_domain": { "default": "example.com", "description": "The root domain for the platform.", "examples": [ "example.com" ], "title": "Root Domain", "type": "string" }, "platform_settings_output": { "default": false, "description": "Flag to enable or disable output of settings for debugging purposes.", "examples": [ true, false ], "title": "Settings Output", "type": "boolean" }, "platform_shared_resource_identifier": { "default": "smarter", "description": "Smarter 1-word identifier to be used when naming any shared resource.", "examples": [ "smarter", "mycompany", "myproject" ], "title": "Shared Resource Identifier", "type": "string" } } }
- Fields:
- Validators:
- field bootstrap_secrets_dir: str = '/home/smarter_user/bootstrap-secrets'
The folder from which
manage.py initialize_bootstrap_secretscreates Smarter Secrets, one per file.Each file is named after its Secret, e.g.
openai_api_key, and holds its value (issue #1099).This is how a built-in Provider’s, a search service’s or a managed vector database’s key reaches the platform, rather than as an environment variable: the key’s only source is then its Smarter Secret, which every service reads. The Helm chart mounts the Kubernetes Secret
smarter-bootstrap-secretshere, in the init Job only. Locally, docker-compose mounts the repository’sbootstrap-secrets/here, insmarter-apionly, whichmake bootstrap-secretsfills from.env. A missing folder is not an error: there is nothing to create.- Type:
- Default:
"/home/smarter_user/bootstrap-secrets"
The folder of files from which the init Job creates Smarter Secrets, one per file.
- field environment: str = 'local'
The deployment environment for the platform.
This setting indicates the environment in which the platform is running, such as development, staging, or production. It can be used to adjust behavior and configurations based on the environment.
- Type:
- Default:
SmarterEnvironments.LOCAL- Raises:
SmarterConfigurationError – If the value is not a valid environment name from SmarterEnvironments.all
The deployment environment for the platform.
- Validated by:
- field overrides_file: str = '/home/smarter_user/overrides/settings.yaml'
The path of the overrides file: a YAML mapping of Django setting names to values, which.
overwrite every value in
smarter.settings.smarter.settings.overridesreads the file, from this same environment variable, beforesmarter_settingsis used for anything else. A missing file is not an error: there are no overrides from a file. Locally, Docker Compose mountsoverrides/from the repository’s root here. The Helm chart mounts no file: on Kubernetes, the deployment’s overrides areDJANGO_*variables in the chart’senv.- Type:
- Default:
"/home/smarter_user/overrides/settings.yaml"
The path of the YAML file of overrides, which overwrite Smarter’s Django settings.
- field platform_root_domain: str = 'example.com'
The root domain for the platform.
This setting specifies the primary domain name used by the platform. It is used for constructing URLs, email addresses, and other domain-related configurations.
- Type:
- Default:
"example.com"- Raises:
SmarterConfigurationError – If the value is not a valid domain name.
The root domain for the platform.
- Validated by:
- field platform_settings_output: bool = False
If True, enables verbose output of Smarter run-time settings during Django startup.
This will generate a multi-line header in new terminal windows launched from Kubernetes pods running Smarter services.
- Type:
- Default:
False- Raises:
SmarterConfigurationError – If the value is not a boolean.
Flag to enable or disable output of settings for debugging purposes.
- Validated by:
A single, lowercase word used as a unique identifier for all shared resources across the Smarter platform.
This value is used as a prefix or namespace when naming resources that are shared between services, environments, or deployments—such as S3 buckets, Kubernetes namespaces, or other cloud resources. It ensures that resource names are consistent, easily identifiable, and do not conflict with those from other projects or organizations.
Important
The identifier should be a simple word, using only lowercase letters.
Avoid changing this value after initial deployment, as it would likely lead to resource naming conflicts and unintended consequences in Kubernetes, cloud infrastructure, and other services relying on consistent naming conventions.
- Typical usage:
As a prefix for cloud resource names (e.g.,
smarter-platform-alpha)To distinguish resources in multi-tenant or multi-environment deployments
For automated naming conventions in infrastructure-as-code and deployment scripts
- Examples:
smartermycompanymyproject
- Type:
- Default:
"smarter"- Raises:
SmarterConfigurationError – If the value is not a string.
Smarter 1-word identifier to be used when naming any shared resource.
- Validated by:
- field platform_subdomain: str | None = 'platform'
The subdomain for the platform, used in constructing URLs and email addresses.
- field service_type: str | None = None
The kind of pod this process runs in: one of
smarter.common.const.SmarterKubernetesPodKinds.all, e.g.apiorworker-extensions.The Helm chart sets
SERVICE_TYPEon every pod, and docker-compose on every service. It isn’t a secret.smarter_settingsnames the kind when it reports that it is READY, with the checks that it made for that kind, and refuses to start a pod whose kind contradicts what it can see for itself, e.g. aworker-extensionspod with a database (check_service_type()). Unset, e.g. in a local script or amanage.pyshell, the kind is unknown, and is reported so.- Type:
Optional[str]
- Default:
None, an unknown kind.
- Raises:
SmarterConfigurationError – If the value is not one of
smarter.common.const.SmarterKubernetesPodKinds.all.
The kind of pod this process runs in, e.g. api or worker-tools. Empty: unknown.
- Validated by:
- field subsystem_logging_loki_url: str = ''
The base url of the Loki that stores the last 72 hours of the platform’s pod logs.
The Helm chart runs Loki in the platform’s namespace, and sets this to its Service, e.g.
http://smarter-loki:3100. The MCPServer’s staff-only log tools query it, throughsmarter.apps.infrastructure.services.infrastructure.logs. While it is empty, e.g. in local development, the log tools say that there is no log store. :type: str :default:"":raises SmarterConfigurationError: If the value is not an http or https url.The base url of the Loki that stores the platform’s pod logs, e.g. http://smarter-loki:3100. Empty: there is none.
- Validated by:
- validator validate_environment » environment[source]
Validates the environment field.
- validator validate_platform_root_domain » platform_root_domain[source]
Validates the root_domain field.
If the value is not set, returns the default root domain.
- validator validate_platform_settings_output » platform_settings_output[source]
Validates the settings_output field.
Validates the shared_resource_identifier field.
Uses the field’s default if no value is received.
- validator validate_service_type » service_type[source]
Validate
service_type: one ofsmarter.common.const.SmarterKubernetesPodKinds.all, trimmed and in lower case, or None.
- class smarter.common.const.SmarterKubernetesPodKinds[source]
The fixed set of kinds of pod that the platform runs: the values of
SERVICE_TYPE.The Helm chart sets
SERVICE_TYPEon each Deployment and Job, and docker-compose on each service, andsmarter_settings.service_typevalidates it againstall. The settings check each kind for what it should and shouldn’t hold (ADR-038). This class says what each kind is; what each kind does with a credential isSmarterPodCapabilities.- all = ['api', 'worker', 'worker-infrastructure', 'beat', 'worker-tools', 'worker-extensions', 'job-init', 'job-migrate', 'job-backup', 'bastion']
Every kind of pod.
- labels: Dict[str, str] = {'api': 'the api server', 'bastion': 'the bastion', 'beat': 'Celery Beat', 'job-backup': 'the backup job', 'job-init': 'the init job', 'job-migrate': 'the migrate job', 'worker': 'the worker', 'worker-extensions': 'the Extension worker', 'worker-infrastructure': 'the infrastructure worker', 'worker-tools': 'the tool worker'}
for the tool worker.- Type:
How each kind’s name reads in a sentence, e.g. in the settings’ READY line
- restricted = ['worker-tools', 'worker-extensions']
The kinds without a database, which run code that the platform doesn’t control (ADR-038, issue #1077).
- with_database = ['api', 'worker', 'worker-infrastructure', 'beat', 'job-init', 'job-migrate', 'job-backup', 'bastion']
every one but the
restrictedworkers, which a test checks.- Type:
The kinds with a database
- class smarter.common.const.SmarterPodCapabilities[source]
What a kind of pod does that needs a credential: each capability lists the kinds of pod that have it (ADR-038).
A credential setting names the capability that uses it, e.g.
HeldBy(*SmarterPodCapabilities.email)on SMTP’s password, so that only those kinds hold it (smarter.common.conf.credentials). They are lists of members, not the Kubernetes Roles or the IAM roles that the Helm chart and smarter-infrastructure create: those are one per kind of pod, for all of its capabilities at once. What a pod is, e.g. whether it has a database, is onSmarterKubernetesPodKinds.- aws = ['api', 'worker', 'worker-infrastructure', 'job-init', 'job-backup', 'bastion']
S3, Route53, ACM and EKS.
On Kubernetes, each kind with its own IAM role, and no key.
The backup Job saves its dump to S3. Celery Beat and the migrate Job make no AWS call, and have no role (ADR-038, phase 3), so the settings don’t ask STS for credentials there (
Settings.uses_aws).- Type:
Call AWS
- database_admin = ['job-init', 'job-backup', 'bastion']
Administer the database server, as its administrator or the backup account.
The init Job creates the database, its user and the backup account. The backup Job dumps the database as the backup account, or as the administrator until that account exists. The bastion is for a person who does either.
- email = ['api', 'worker', 'worker-infrastructure', 'job-init', 'job-backup']
the app, both workers, the init Job, and the backup Job.
smarter-worker-infrastructureemails a custom domain’s verification result, and the backup Job its own result.- Type:
Send email, with SMTP’s credentials
- job_logs = ['job-init', 'job-backup']
the init Job and the backup Job.
- Type:
Post a Job’s log to Slack, with
manage.py email_job_log
- signing = ['api', 'worker', 'worker-infrastructure', 'job-init']
the app, both workers and the init Job.
E.g. an account contact’s email, which the workers send, carries an unsubscribe token signed with
SECRET_KEY. Celery Beat and the migrate Job sign nothing, and start with a random key of their own.- Type:
Sign what the app verifies, with the Django secret key
- smarter_secrets = ['api', 'worker', 'worker-infrastructure', 'job-init']
the app, both workers and the init Job.
The tasks that use a Secret’s value, e.g. an LLMHost’s api key or a plugin’s connection, run in the workers, and the init Job creates the bootstrap Secrets.
- Type:
Decrypt and encrypt Smarter Secrets, with the Fernet key
- pydantic model smarter.common.conf.settings.domains.DomainSettings[source]
The domains, urls, hosts and bucket names that are derived from the platform’s identity.
Show JSON schema
{ "title": "DomainSettings", "description": "The domains, urls, hosts and bucket names that are derived from the platform's identity.", "type": "object", "properties": { "subsystem_logging_loki_url": { "default": "", "description": "The base url of the Loki that stores the platform's pod logs, e.g. http://smarter-loki:3100. Empty: there is none.", "examples": [ "http://smarter-loki:3100" ], "title": "Loki URL", "type": "string" }, "overrides_file": { "default": "/home/smarter_user/overrides/settings.yaml", "description": "The path of the YAML file of overrides, which overwrite Smarter's Django settings.", "examples": [ "/home/smarter_user/overrides/settings.yaml" ], "title": "Overrides File", "type": "string" }, "bootstrap_secrets_dir": { "default": "/home/smarter_user/bootstrap-secrets", "description": "The folder of files from which the init Job creates Smarter Secrets, one per file.", "examples": [ "/home/smarter_user/bootstrap-secrets" ], "title": "Bootstrap Secrets Folder", "type": "string" }, "SERVICE_TYPE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The kind of pod this process runs in, e.g. api or worker-tools. Empty: unknown.", "examples": [ "api" ], "title": "Service Type" }, "environment": { "default": "local", "description": "The deployment environment for the platform.", "examples": [ "local", "alpha", "beta", "next", "prod" ], "title": "Deployment Environment", "type": "string" }, "platform_subdomain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "platform", "description": "The subdomain for the platform, used in constructing URLs and email addresses.", "examples": [ "platform", "ubc" ], "title": "Platform Subdomain" }, "platform_root_domain": { "default": "example.com", "description": "The root domain for the platform.", "examples": [ "example.com" ], "title": "Root Domain", "type": "string" }, "platform_settings_output": { "default": false, "description": "Flag to enable or disable output of settings for debugging purposes.", "examples": [ true, false ], "title": "Settings Output", "type": "boolean" }, "platform_shared_resource_identifier": { "default": "smarter", "description": "Smarter 1-word identifier to be used when naming any shared resource.", "examples": [ "smarter", "mycompany", "myproject" ], "title": "Shared Resource Identifier", "type": "string" }, "allowed_hosts": { "default": [ "localhost", "testserver" ], "description": "The hosts that the platform serves: its own domains, and those set with SMARTER_ALLOWED_HOSTS.", "examples": [ [ "localhost", "testserver" ] ], "items": { "type": "string" }, "title": "Allowed Hosts", "type": "array" }, "api_schema": { "default": "http", "description": "The schema of the api's urls, http or https. Set with SMARTER_API_SCHEMA. Always http locally.", "examples": [ "http", "https" ], "title": "API Schema", "type": "string" } } }
- Fields:
- Validators:
add_platform_hosts»all fieldslocal_api_schema»all fields
- field allowed_hosts: List[str] = ['localhost', 'testserver']
The host names that the platform serves, Django’s
ALLOWED_HOSTS: its own domains, and the.hosts set with
SMARTER_ALLOWED_HOSTS, a comma-separated list.The platform’s domains are always added: see
add_platform_hosts().localhostandtestserverare there for Kubernetes’ liveness and readiness probes, and for Django’s test client. Smarter’s own middleware validates hosts as well: seesmarter.apps.llmclient.middleware.security.SmarterSecurityMiddleware.- Type:
List[str]
- Default:
["localhost", "testserver"], plus the platform’s domains
The hosts that the platform serves: its own domains, and those set with SMARTER_ALLOWED_HOSTS.
- Validated by:
- field api_schema: str = 'http'
The schema of the api’s urls,
httporhttps.Set it with
SMARTER_API_SCHEMA. The local environment always useshttp, whatever it is set to: seelocal_api_schema().- Type:
- Default:
"http"- Raises:
SmarterConfigurationError – If the value is neither
httpnorhttps.
The schema of the api’s urls, http or https. Set with SMARTER_API_SCHEMA. Always http locally.
- Validated by:
- validator local_api_schema » all fields[source]
Use
httpfor the api’s urls in the local environment, which serves no https.
- validator validate_allowed_hosts » allowed_hosts[source]
Validates the allowed_hosts field: a list, or a comma-separated string.
- validator validate_api_schema » api_schema[source]
Validates the api_schema field:
httporhttps, or the default if it is empty.
- validator add_platform_hosts » all fields[source]
Add the platform’s own domains to
allowed_hosts, so that it is the complete list.The domains, e.g.
environment_platform_domain, are derived from the validated environment, root domain and subdomain, so they are added once those are validated. Each host with a port is added without it as well. Every host is validated.- Return type:
- Returns:
The settings, whose
allowed_hostsis final.- Raises:
SmarterConfigurationError – If a host is not a valid hostname.
- pydantic model smarter.common.conf.settings.aws.AwsSettings[source]
The cloud provider: AWS credentials, region, and the EKS cluster.
Show JSON schema
{ "title": "AwsSettings", "description": "The cloud provider: AWS credentials, region, and the EKS cluster.", "type": "object", "properties": { "AWS_PROFILE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The AWS profile to use for authentication. If present, this will take precedence over AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.", "examples": [ "default", "smarter-profile" ], "title": "AWS Profile" }, "AWS_ACCESS_KEY_ID": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The AWS access key ID for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.", "examples": [ "^AKIA[0-9A-Z]{16}$" ], "title": "AWS Access Key ID" }, "AWS_SECRET_ACCESS_KEY": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The AWS secret access key for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.", "examples": [ "^[0-9a-zA-Z/+]{40}$" ], "title": "AWS Secret Access Key" }, "aws_regions": { "default": [ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", "ap-southeast-5", "ap-southeast-7", "ca-central-1", "ca-west-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "il-central-1", "me-central-1", "me-south-1", "mx-central-1", "sa-east-1" ], "description": "A list of AWS regions considered valid for this platform.", "examples": [ "us-east-1", "us-west-2", "eu-west-1" ], "items": { "type": "string" }, "title": "AWS Regions", "type": "array" }, "AWS_REGION": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The single AWS region in which all AWS service clients will operate.", "examples": [ "us-east-1", "us-west-2", "eu-west-1" ], "title": "AWS Region" }, "platform_cloud_provider": { "default": "aws", "description": "The cloud provider of the platform's infrastructure services: DNS, TLS certificates, and the Kubernetes cluster's credentials.", "examples": [ "aws", "memory" ], "title": "Cloud Provider", "type": "string" }, "subsystem_k8s_cluster_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the Kubernetes cluster that hosts the platform, e.g. its EKS cluster on AWS.", "examples": [ "apps-hosting-service" ], "title": "Kubernetes Cluster Name" }, "app_llmhost_node_role_arn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The IAM role of the node groups that Smarter creates for LLMHosts.", "examples": [ "arn:aws:iam::123456789012:role/eks-node-role" ], "title": "LLMHost Node Role ARN" }, "app_llmhost_node_subnet_ids": { "default": [], "description": "The subnets of the node groups that Smarter creates for LLMHosts.", "examples": [ [ "subnet-0123456789abcdef0" ] ], "items": { "type": "string" }, "title": "LLMHost Node Subnet IDs", "type": "array" } } }
- Fields:
- Validators:
- field app_llmhost_node_role_arn: str | None = None
The IAM role of the EKS managed node groups that Smarter creates for LLMHostCompute.
If it is not set, Smarter uses the node role of the cluster’s first managed node group that it did not create, i.e. the node group that Smarter itself runs on.
- Type:
Optional[str]
- Default:
None
The IAM role of the node groups that Smarter creates for LLMHosts.
- field app_llmhost_node_subnet_ids: List[str] = []
The subnets of the EKS managed node groups that Smarter creates for LLMHostCompute, e.g.
subnet-0123,subnet-0456. An LLMHostCompute’s own subnet_ids take precedence.If it is not set, Smarter uses the subnets of the cluster’s first managed node group that it did not create. A model volume is an EBS volume in one availability zone, so an LLMHost whose retained volume is in one zone cannot be relaunched on a node in another: one subnet per node group avoids this.
- Type:
List[str]
- Default:
[]
The subnets of the node groups that Smarter creates for LLMHosts.
- Validated by:
- field aws_access_key_id: HeldBy(pods=frozenset({'worker-infrastructure', 'api', 'worker', 'job-backup', 'bastion', 'job-init'}))] = None
The AWS access key ID for authentication.
Used if AWS_PROFILE is not set. Masked by pydantic SecretStr. This setting provides the access key ID used to authenticate with AWS services. It is used in conjunction with the AWS secret access key to sign requests to AWS APIs.
- Type:
SecretStr
- Default:
None- Raises:
SmarterConfigurationError – If the value is not a valid AWS access key ID
The AWS access key ID for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘worker-infrastructure’, ‘api’, ‘worker’, ‘job-backup’, ‘bastion’, ‘job-init’})
- Validated by:
- field aws_profile: str | None = None
The AWS profile to use for authentication.
If present, this will take precedence over AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. This setting specifies which AWS credentials profile to use when connecting to AWS services. Profiles are defined in the AWS credentials file (typically located at ~/.aws/credentials) and allow for managing multiple sets of credentials for different environments or accounts.
- Type:
Optional[str]
- Default:
None- Raises:
SmarterConfigurationError – If the value is not a string.
The AWS profile to use for authentication. If present, this will take precedence over AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
- Validated by:
- field aws_region: str | None = None
The single AWS region in which all AWS service clients will operate.
This setting specifies the default AWS region for the platform. All AWS service clients will be configured to use this region unless overridden on a per-client basis.
- Type:
- Default:
None- Raises:
SmarterConfigurationError – If the value is not a valid AWS region name.
The single AWS region in which all AWS service clients will operate.
- Validated by:
- field aws_regions: List[str] = ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'af-south-1', 'ap-east-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-northeast-3', 'ap-south-1', 'ap-south-2', 'ap-southeast-1', 'ap-southeast-2', 'ap-southeast-3', 'ap-southeast-4', 'ap-southeast-5', 'ap-southeast-7', 'ca-central-1', 'ca-west-1', 'eu-central-1', 'eu-central-2', 'eu-north-1', 'eu-south-1', 'eu-south-2', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'il-central-1', 'me-central-1', 'me-south-1', 'mx-central-1', 'sa-east-1']
A list of AWS regions considered valid for this platform.
This setting defines the AWS regions that the platform is configured to operate in. It can be used to restrict operations to specific regions, ensuring that resources are created and managed only in approved locations.
- Type:
List[str]
- Default:
Value from
AWS_REGIONS- Raises:
SmarterConfigurationError – If the value is not a list of valid AWS region names.
A list of AWS regions considered valid for this platform.
- Validated by:
- field aws_secret_access_key: HeldBy(pods=frozenset({'worker-infrastructure', 'api', 'worker', 'job-backup', 'bastion', 'job-init'}))] = None
The AWS secret access key for authentication.
Used if AWS_PROFILE is not set. Masked by pydantic SecretStr. This setting provides the secret access key used to authenticate with AWS services. It is used in conjunction with the AWS access key ID to sign requests to AWS APIs.
- Type:
SecretStr
- Default:
None- Raises:
SmarterConfigurationError – If the value is not a valid AWS secret access key
The AWS secret access key for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘worker-infrastructure’, ‘api’, ‘worker’, ‘job-backup’, ‘bastion’, ‘job-init’})
- Validated by:
- field platform_cloud_provider: str = 'aws'
The cloud provider of the platform’s infrastructure services.
The platform reaches DNS, TLS certificates, and its Kubernetes cluster’s credentials only through
smarter.apps.infrastructure.services, which uses this provider.awsis the only cloud that is implemented.memorykeeps everything in memory, for local development without a cloud account.- Type:
- Default:
aws- Raises:
SmarterConfigurationError – If the value is not a string.
The cloud provider of the platform’s infrastructure services: DNS, TLS certificates, and the Kubernetes cluster’s credentials.
- Validated by:
- field subsystem_k8s_cluster_name: str | None = None
The name of the Kubernetes cluster that hosts the platform:
SMARTER_SUBSYSTEM_K8S_CLUSTER_NAME.The platform deploys LLMClients and LLMHosts to it. On AWS it is an EKS cluster in the configured account, which the AWS infrastructure provider describes to build its kubeconfig.
It is optional. Without it, the platform runs, but LLMClients and LLMHosts are not deployed to Kubernetes, and the first attempt to reach the cluster logs how to set it.
- Type:
Optional[str]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a string.
The name of the Kubernetes cluster that hosts the platform, e.g. its EKS cluster on AWS.
- Validated by:
- validator validate_app_llmhost_node_subnet_ids » app_llmhost_node_subnet_ids[source]
Validates the llmhost_node_subnet_ids field: a list, or a comma-separated string.
- validator validate_aws_access_key_id » aws_access_key_id[source]
Validates the aws_access_key_id field.
Uses the field’s default if no value is received.
- validator validate_aws_profile » aws_profile[source]
Validates the aws_profile field.
Uses the field’s default if no value is received.
- validator validate_aws_region » aws_region[source]
Validates the aws_region field.
Uses the field’s default if no value is received.
- validator validate_aws_regions » aws_regions[source]
Validates the aws_regions field: a list, or a comma-separated string.
- validator validate_aws_secret_access_key » aws_secret_access_key[source]
Validates the aws_secret_access_key field.
Uses the field’s default if no value is received.
- validator validate_platform_cloud_provider » platform_cloud_provider[source]
Validates the cloud_provider field.
- validator validate_subsystem_k8s_cluster_name » subsystem_k8s_cluster_name[source]
Validates the k8s_cluster_name field.
- pydantic model smarter.common.conf.settings.branding.BrandingSettings[source]
The platform operator’s branding: name, address, contacts, links and logo.
Show JSON schema
{ "title": "BrandingSettings", "description": "The platform operator's branding: name, address, contacts, links and logo.", "type": "object", "properties": { "platform_branding_app_name": { "default": "Smarter", "description": "The application's name, which prefixes the names of the platform's Django apps in the admin and the web console.", "examples": [ "Acme AI" ], "title": "Branding App Name", "type": "string" }, "platform_branding_product_name": { "default": "The Smarter Project", "description": "The product's name, shown in the web console, emails and documentation.", "examples": [ "Acme AI Platform" ], "title": "Branding Product Name", "type": "string" }, "platform_branding_product_description": { "default": "An open source, no-code AI authoring platform designed for instructional use.", "description": "A one-sentence description of the product, shown in the web console and in page metadata.", "examples": [ "A no-code AI platform for Acme's teams." ], "title": "Branding Product Description", "type": "string" }, "platform_branding_cdn_url": { "default": "https://cdn.smarter.sh/", "description": "The CDN of the product's own static assets, e.g. its logo and Open Graph image.", "examples": [ "https://cdn.example.com" ], "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Branding CDN URL", "type": "string" }, "platform_branding_docs_url": { "default": "https://docs.smarter.sh/", "description": "The product's documentation site, linked from the web console and the api.", "examples": [ "https://docs.example.com" ], "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Branding Documentation URL", "type": "string" }, "platform_branding_blog_url": { "default": "https://blog.smarter.sh/", "description": "The product's blog, e.g. its release announcements.", "examples": [ "https://blog.example.com" ], "format": "uri", "maxLength": 2083, "minLength": 1, "title": "Branding Blog URL", "type": "string" }, "platform_branding_corporate_name": { "default": "Lawrence P. McDaniel", "description": "The corporate name used for branding purposes throughout the platform.", "examples": [ "Acme Corporation" ], "title": "Branding Corporate Name", "type": "string" }, "platform_branding_support_phone_number": { "default": "(###) 555-1212", "description": "The support phone number used for branding purposes throughout the platform.", "examples": [ "+1-800-555-1234" ], "title": "Branding Support Phone Number", "type": "string" }, "platform_branding_support_email": { "default": "lpm0073@gmail.com", "description": "The support email address used for branding purposes throughout the platform.", "format": "email", "title": "Branding Support Email", "type": "string" }, "platform_branding_address1": { "default": "123 Main St, Anytown, USA", "description": "The corporate address used for branding purposes throughout the platform.", "examples": [ "123 Main St, Anytown, USA" ], "title": "Branding Address", "type": "string" }, "platform_branding_address2": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "Suite 100", "description": "The second line of the corporate address used for branding purposes throughout the platform.", "examples": [ "Suite 100" ], "title": "Branding Address Line 2" }, "platform_branding_city": { "default": "Anytown", "description": "The corporate city used for branding purposes throughout the platform.", "examples": [ "Anytown" ], "title": "Branding City", "type": "string" }, "platform_branding_state": { "default": "CA", "description": "The corporate state used for branding purposes throughout the platform.", "examples": [ "CA" ], "title": "Branding State", "type": "string" }, "platform_branding_postal_code": { "default": "12345", "description": "The corporate postal code used for branding purposes throughout the platform.", "examples": [ "12345" ], "title": "Branding Postal Code", "type": "string" }, "platform_branding_country": { "default": "USA", "description": "The corporate country used for branding purposes throughout the platform.", "examples": [ "USA" ], "title": "Branding Country", "type": "string" }, "platform_branding_currency": { "default": "USD", "description": "The currency used for branding purposes throughout the platform.", "examples": [ "USD" ], "title": "Branding Currency", "type": "string" }, "platform_branding_timezone": { "default": "America/Denver", "description": "The timezone used for branding purposes throughout the platform.", "examples": [ "America/New_York" ], "title": "Branding Timezone", "type": "string" }, "platform_branding_contact_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://lawrencemcdaniel.com/", "description": "The contact URL used for branding purposes throughout the platform.", "examples": [ "https://www.example.com/contact" ], "title": "Branding Contact URL" }, "platform_branding_primary_contact": { "default": "Lawrence McDaniel", "description": "The name of the person who is the technical point of contact for this platform.", "examples": [ "Lawrence McDaniel" ], "title": "Branding Primary Contact", "type": "string" }, "platform_branding_support_hours": { "default": "MON-FRI 9:00 AM - 5:00 PM GMT-6 (CST)", "description": "The support hours used for branding purposes throughout the platform.", "examples": [ "Mon-Fri 9am-5pm EST" ], "title": "Branding Support Hours", "type": "string" }, "platform_branding_url_facebook": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://facebook.com/", "description": "The Facebook URL used for branding purposes throughout the platform.", "examples": [ "https://www.facebook.com/example" ], "title": "Branding URL Facebook" }, "platform_branding_url_twitter": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://x.com/fullstackwlarry", "description": "The Twitter URL used for branding purposes throughout the platform.", "examples": [ "https://www.twitter.com/example" ], "title": "Branding URL Twitter" }, "platform_branding_url_linkedin": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://www.linkedin.com/in/lawrencemcdaniel/", "description": "The LinkedIn URL used for branding purposes throughout the platform.", "examples": [ "https://www.linkedin.com/company/example" ], "title": "Branding URL LinkedIn" }, "platform_branding_url_slack": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": "https://join.slack.com/t/thesmarterproject/shared_invite/zt-4f0t6v46q-e2c5Of4hS4fBr_XwfQARCw", "description": "The invite link of the Slack workspace that the platform's emails invite users to.", "examples": [ "https://join.slack.com/t/example/shared_invite/zt-example" ], "title": "Branding URL Slack" }, "platform_branding_logo": { "anyOf": [ { "format": "uri", "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to the platform's logo image.", "examples": [ "https://cdn.example.com/logo.png" ], "title": "Platform Logo URL" }, "platform_branding_marketing_site_url": { "anyOf": [ { "format": "uri", "maxLength": 2083, "minLength": 1, "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to the platform's marketing site.", "examples": [ "https://www.example.com" ], "title": "Marketing Site URL" } } }
- Fields:
platform_branding_contact_url (pydantic.networks.HttpUrl | None)platform_branding_marketing_site_url (pydantic.networks.HttpUrl | None)platform_branding_support_email (pydantic.networks.EmailStr)platform_branding_url_facebook (pydantic.networks.HttpUrl | None)platform_branding_url_linkedin (pydantic.networks.HttpUrl | None)platform_branding_url_slack (pydantic.networks.HttpUrl | None)platform_branding_url_twitter (pydantic.networks.HttpUrl | None)
- Validators:
derive_branding_defaults»all fieldsvalidate_platform_branding_address2»platform_branding_address2validate_platform_branding_app_name»platform_branding_app_namevalidate_platform_branding_blog_url»platform_branding_blog_urlvalidate_platform_branding_cdn_url»platform_branding_cdn_urlvalidate_platform_branding_contact_url»platform_branding_contact_urlvalidate_platform_branding_corporate_name»platform_branding_corporate_namevalidate_platform_branding_country»platform_branding_countryvalidate_platform_branding_currency»platform_branding_currencyvalidate_platform_branding_docs_url»platform_branding_docs_urlvalidate_platform_branding_marketing_site_url»platform_branding_marketing_site_urlvalidate_platform_branding_postal_code»platform_branding_postal_codevalidate_platform_branding_primary_contact»platform_branding_primary_contactvalidate_platform_branding_product_description»platform_branding_product_descriptionvalidate_platform_branding_product_name»platform_branding_product_namevalidate_platform_branding_support_email»platform_branding_support_emailvalidate_platform_branding_support_hours»platform_branding_support_hoursvalidate_platform_branding_support_phone_number»platform_branding_support_phone_numbervalidate_platform_branding_timezone»platform_branding_timezonevalidate_platform_branding_url_facebook»platform_branding_url_facebookvalidate_platform_branding_url_linkedin»platform_branding_url_linkedinvalidate_platform_branding_url_slack»platform_branding_url_slackvalidate_platform_branding_url_twitter»platform_branding_url_twitter
- field platform_branding_address1: str = '123 Main St, Anytown, USA'
The corporate address used for branding purposes throughout the platform.
This setting specifies the physical address of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"123 Main St, Anytown, USA":raises SmarterConfigurationError: If the value is not a string.The corporate address used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_address2: str | None = 'Suite 100'
The second line of the corporate address used for branding purposes throughout the platform.
This setting specifies the second line of the physical address of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: Optional[str] :default:
"Suite 100":raises SmarterConfigurationError: If the value is not a string.The second line of the corporate address used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_app_name: str = 'Smarter'
The application’s name, which prefixes the names of the platform’s Django apps in the admin and the web console:
SMARTER_PLATFORM_BRANDING_APP_NAME.- Type:
- Default:
"Smarter"- Raises:
SmarterConfigurationError – If the value is not a string.
The application’s name, which prefixes the names of the platform’s Django apps in the admin and the web console.
- Validated by:
- field platform_branding_blog_url: HttpUrl = HttpUrl('https://blog.smarter.sh/')
The product’s blog, e.g. its release announcements:
SMARTER_PLATFORM_BRANDING_BLOG_URL.- Type:
HttpUrl
- Default:
"https://blog.smarter.sh"
The product’s blog, e.g. its release announcements.
- Validated by:
- field platform_branding_cdn_url: HttpUrl = HttpUrl('https://cdn.smarter.sh/')
The CDN of the product’s own static assets, e.g. its logo and Open Graph image:
SMARTER_PLATFORM_BRANDING_CDN_URL.- Type:
HttpUrl
- Default:
"https://cdn.smarter.sh"
The CDN of the product’s own static assets, e.g. its logo and Open Graph image.
- Validated by:
- field platform_branding_city: str = 'Anytown'
The corporate city used for branding purposes throughout the platform.
This setting specifies the city of the physical address of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"Anytown":raises SmarterConfigurationError: If the value is not a string.The corporate city used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_contact_url: HttpUrl | None = HttpUrl('https://lawrencemcdaniel.com/')
The contact URL used for branding purposes throughout the platform.
This setting specifies the URL that users can visit to contact the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"https://lawrencemcdaniel.com/":raises SmarterConfigurationError: If the value is not a string.The contact URL used for branding purposes throughout the platform.
- field platform_branding_corporate_name: str = 'Lawrence P. McDaniel'
The corporate name used for branding purposes throughout the platform.
This setting specifies the name of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"Lawrence P. McDaniel":raises SmarterConfigurationError: If the value is not a string.The corporate name used for branding purposes throughout the platform.
- field platform_branding_country: str = 'USA'
The corporate country used for branding purposes throughout the platform.
This setting specifies the country of the physical address of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"USA":raises SmarterConfigurationError: If the value is not a string.The corporate country used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_currency: str = 'USD'
The currency used for branding purposes throughout the platform.
This setting specifies the currency that is used in various branding contexts, such as email templates, user interfaces, and documentation. It can be used to indicate the currency in which prices, billing, or financial information is presented to users. :type: str :default:
"USD":raises SmarterConfigurationError: If the value is not a string.The currency used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_docs_url: HttpUrl = HttpUrl('https://docs.smarter.sh/')
The product’s documentation site, linked from the web console and the api:
SMARTER_PLATFORM_BRANDING_DOCS_URL.- Type:
HttpUrl
- Default:
"https://docs.smarter.sh"
The product’s documentation site, linked from the web console and the api.
- Validated by:
- field platform_branding_logo: AnyUrl | None = None
The URL to the platform’s logo image.
This setting specifies the web address of the logo image used in the platform’s user interface. It should be a valid URL pointing to an external image resource accessible by the frontend.
- Type:
Optional[AnyUrl]
- Default:
/images/logo/smarter-crop.pngonplatform_branding_cdn_url. Seederive_branding_defaults().- Raises:
SmarterConfigurationError – If the value is not a valid URL string.
The URL to the platform’s logo image.
- Validated by:
- field platform_branding_marketing_site_url: HttpUrl | None = None
The URL to the platform’s marketing site.
This setting specifies the web address of the marketing site associated with the platform. It should be a valid URL pointing to an external website.
- Type:
Optional[httpHttpUrl]
- Default:
https://the root domain, e.g.https://example.com. Seederive_branding_defaults().- Raises:
SmarterConfigurationError – If the value is not a valid URL string.
The URL to the platform’s marketing site.
- field platform_branding_postal_code: str = '12345'
The corporate postal code used for branding purposes throughout the platform.
This setting specifies the postal code of the physical address of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"12345":raises SmarterConfigurationError: If the value is not a string.The corporate postal code used for branding purposes throughout the platform.
- field platform_branding_primary_contact: str = 'Lawrence McDaniel'
The name of the person who is the technical point of contact for this platform.
This setting names the person who hosts the platform and answers its users’ questions. The welcome email is written from this person, and signed with this name. :type: str :default:
"Lawrence McDaniel":raises SmarterConfigurationError: If the value is not a string.The name of the person who is the technical point of contact for this platform.
- field platform_branding_product_description: str = 'An open source, no-code AI authoring platform designed for instructional use.'
A one-sentence description of the product, shown in the web console and in page metadata:
SMARTER_PLATFORM_BRANDING_PRODUCT_DESCRIPTION.- Type:
- Default:
"An open source, no-code AI authoring platform designed for instructional use."- Raises:
SmarterConfigurationError – If the value is not a string.
A one-sentence description of the product, shown in the web console and in page metadata.
- field platform_branding_product_name: str = 'The Smarter Project'
The product’s name, shown in the web console, emails and documentation:
SMARTER_PLATFORM_BRANDING_PRODUCT_NAME.- Type:
- Default:
"The Smarter Project"- Raises:
SmarterConfigurationError – If the value is not a string.
The product’s name, shown in the web console, emails and documentation.
- field platform_branding_state: str = 'CA'
The corporate state used for branding purposes throughout the platform.
This setting specifies the state of the physical address of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"CA":raises SmarterConfigurationError: If the value is not a string.The corporate state used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_support_email: EmailStr = 'lpm0073@gmail.com'
The support email address used for branding purposes throughout the platform.
This setting specifies the email address that users can contact for support or assistance related to the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: EmailStr :default:
"lpm0073@gmail.com":raises SmarterConfigurationError: If the value is not a EmailStr.The support email address used for branding purposes throughout the platform.
- field platform_branding_support_hours: str = 'MON-FRI 9:00 AM - 5:00 PM GMT-6 (CST)'
The support hours used for branding purposes throughout the platform.
This setting specifies the hours during which support is available for users of the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"MON-FRI 9:00 AM - 5:00 PM GMT-6 (CST)":raises SmarterConfigurationError: If the value is not a string.The support hours used for branding purposes throughout the platform.
- field platform_branding_support_phone_number: str = '(###) 555-1212'
The support phone number used for branding purposes throughout the platform.
This setting specifies the phone number that users can call for support or assistance related to the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: str :default:
"(###) 555-1212":raises SmarterConfigurationError: If the value is not a string.The support phone number used for branding purposes throughout the platform.
- field platform_branding_timezone: str = 'America/Denver'
The timezone used for branding purposes throughout the platform.
This setting specifies the timezone that is used in various branding contexts, such as email templates, user interfaces, and documentation. It can be used to indicate the timezone in which dates and times are presented to users. :type: str :default:
"America/Denver":raises SmarterConfigurationError: If the value is not a string.The timezone used for branding purposes throughout the platform.
- Validated by:
- field platform_branding_url_facebook: HttpUrl | None = HttpUrl('https://facebook.com/')
The Facebook URL used for branding purposes throughout the platform.
This setting specifies the Facebook page URL of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: Optional[HttpUrl] :default:
"https://facebook.com":raises SmarterConfigurationError: If the value is not a valid HttpUrl.The Facebook URL used for branding purposes throughout the platform.
- field platform_branding_url_linkedin: HttpUrl | None = HttpUrl('https://www.linkedin.com/in/lawrencemcdaniel/')
The LinkedIn URL used for branding purposes throughout the platform.
This setting specifies the LinkedIn profile URL of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: Optional[HttpUrl] :default:
"https://www.linkedin.com/in/lawrencemcdaniel/":raises SmarterConfigurationError: If the value is not a valid HttpUrl.The LinkedIn URL used for branding purposes throughout the platform.
- field platform_branding_url_slack: HttpUrl | None = HttpUrl('https://join.slack.com/t/thesmarterproject/shared_invite/zt-4f0t6v46q-e2c5Of4hS4fBr_XwfQARCw')
The invite link of the Slack workspace that the platform’s emails invite users to.
The welcome email links to it, and the Slack invitation email, which a Celery Beat task sends two days after the welcome email, is about it. The default is the invite link of The Smarter Project’s Slack workspace.
- Type:
Optional[HttpUrl]
- Default:
"https://join.slack.com/t/thesmarterproject/shared_invite/zt-4f0t6v46q-e2c5Of4hS4fBr_XwfQARCw"- Raises:
SmarterConfigurationError – If the value is not a valid HttpUrl.
The invite link of the Slack workspace that the platform’s emails invite users to.
- Validated by:
- field platform_branding_url_twitter: HttpUrl | None = HttpUrl('https://x.com/fullstackwlarry')
The Twitter URL used for branding purposes throughout the platform.
This setting specifies the Twitter profile URL of the organization or company that owns or operates the platform. It is used in various branding contexts, such as email templates, user interfaces, and documentation. :type: Optional[HttpUrl] :default:
"https://x.com/fullstackwlarry":raises SmarterConfigurationError: If the value is not a valid HttpUrl.The Twitter URL used for branding purposes throughout the platform.
- validator derive_branding_defaults » all fields[source]
Derive the logo and the marketing site’s url, unless they are set.
The logo is
/images/logo/smarter-crop.pngon the CDN, and the marketing site ishttps://the root domain, whichPlatformSettingsholds.
- validator validate_branding_address » platform_branding_address1[source]
Validates the branding_address1 field.
- validator validate_platform_branding_address2 » platform_branding_address2[source]
Validates the branding_address2 field.
- validator validate_platform_branding_app_name » platform_branding_app_name[source]
Validate
platform_branding_app_name: an empty value is the default.
- validator validate_platform_branding_blog_url » platform_branding_blog_url[source]
Validate
platform_branding_blog_url: an empty value is the default.- Parameters:
v (
HttpUrl|None) – The value.- Return type:
HttpUrl- Returns:
The value, or the default.
- validator validate_platform_branding_cdn_url » platform_branding_cdn_url[source]
Validate
platform_branding_cdn_url: an empty value is the default.- Parameters:
v (
HttpUrl|None) – The value.- Return type:
HttpUrl- Returns:
The value, or the default.
- validator validate_platform_branding_city » platform_branding_city[source]
Validates the branding_city field.
- validator validate_platform_branding_contact_url » platform_branding_contact_url[source]
Validates the branding_contact_url field.
- validator validate_platform_branding_corporate_name » platform_branding_corporate_name[source]
Validates the branding_corporate_name field.
- validator validate_platform_branding_country » platform_branding_country[source]
Validates the branding_country field.
- validator validate_platform_branding_currency » platform_branding_currency[source]
Validates the branding_currency field.
- validator validate_platform_branding_docs_url » platform_branding_docs_url[source]
Validate
platform_branding_docs_url: an empty value is the default.- Parameters:
v (
HttpUrl|None) – The value.- Return type:
HttpUrl- Returns:
The value, or the default.
- validator validate_platform_branding_logo » platform_branding_logo[source]
Validates the logo field.
- Parameters:
v (
AnyUrl|None) – The logo value to validate.- Returns:
The validated logo.
- Return type:
AnyUrl
- validator validate_platform_branding_marketing_site_url » platform_branding_marketing_site_url[source]
Validates the marketing_site_url field.
- Parameters:
v (
HttpUrl|None) – The marketing site URL value to validate.- Returns:
The validated marketing site URL.
- Return type:
HttpUrl
- validator validate_platform_branding_postal_code » platform_branding_postal_code[source]
Validates the branding_postal_code field.
- validator validate_platform_branding_primary_contact » platform_branding_primary_contact[source]
Validates the branding_primary_contact field.
- validator validate_platform_branding_product_description » platform_branding_product_description[source]
Validate
platform_branding_product_description: an empty value is the default.
- validator validate_platform_branding_product_name » platform_branding_product_name[source]
Validate
platform_branding_product_name: an empty value is the default.
- validator validate_platform_branding_state » platform_branding_state[source]
Validates the branding_state field.
- validator validate_platform_branding_support_email » platform_branding_support_email[source]
Validates the branding_support_email field.
- Parameters:
v (
EmailStr|None) – The branding support email value to validate.- Returns:
The validated branding support email.
- Return type:
EmailStr
- validator validate_platform_branding_support_hours » platform_branding_support_hours[source]
Validates the branding_support_hours field.
- validator validate_platform_branding_support_phone_number » platform_branding_support_phone_number[source]
Validates the branding_support_phone_number field.
- validator validate_platform_branding_timezone » platform_branding_timezone[source]
Validates the branding_timezone field.
- validator validate_platform_branding_url_facebook » platform_branding_url_facebook[source]
Validates the branding_url_facebook field.
- validator validate_platform_branding_url_linkedin » platform_branding_url_linkedin[source]
Validates the branding_url_linkedin field.
- validator validate_platform_branding_url_slack » platform_branding_url_slack[source]
Validates the branding_url_slack field.
- validator validate_platform_branding_url_twitter » platform_branding_url_twitter[source]
Validates the branding_url_twitter field.
- pydantic model smarter.common.conf.settings.cache.CacheSettings[source]
Redis’s password, and how long cached views, prompts, llmclients and responses are kept.
Show JSON schema
{ "title": "CacheSettings", "description": "Redis's password, and how long cached views, prompts, llmclients and responses are kept.", "type": "object", "properties": { "subsystem_redis_username": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The Redis ACL user that this process authenticates as, or empty for Redis's default user.", "examples": [ "tools" ], "title": "Redis Username" }, "subsystem_redis_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the platform's Redis: the Celery broker, the cache and the sessions.", "examples": [ "your-redis-password" ], "title": "Redis Password" }, "subsystem_cache_expiration": { "default": 60, "description": "The cache expiration time in seconds for cached data.", "exclusiveMinimum": 0, "title": "Cache Expiration", "type": "integer" }, "subsystem_cache_chat_expiration": { "default": 300, "description": "The prompt cache expiration time in seconds for cached prompt data.", "exclusiveMinimum": 0, "title": "Prompt Cache Expiration", "type": "integer" }, "subsystem_cache_prompt_response_expiration": { "default": 3600, "description": "Seconds to cache the LLM's answer to the first message of a conversation. 0 disables the cache.", "minimum": 0, "title": "Prompt Response Cache Expiration", "type": "integer" }, "subsystem_cache_listview_expiration": { "default": 3600, "description": "The cache expiration time in seconds for the pages of the web console's list views.", "exclusiveMinimum": 0, "title": "List View Cache Expiration", "type": "integer" }, "subsystem_cache_llm_client_expiration": { "default": 300, "description": "The llmclient cache expiration time in seconds for cached llmclient data.", "exclusiveMinimum": 0, "title": "LLMClient Cache Expiration", "type": "integer" } } }
- Fields:
- Validators:
derive_cache_defaults»all fieldsparse_subsystem_cache_chat_expiration»subsystem_cache_chat_expirationparse_subsystem_cache_expiration»subsystem_cache_expirationparse_subsystem_cache_listview_expiration»subsystem_cache_listview_expirationparse_subsystem_cache_llm_client_expiration»subsystem_cache_llm_client_expirationparse_subsystem_cache_prompt_response_expiration»subsystem_cache_prompt_response_expirationvalidate_subsystem_redis_password»subsystem_redis_passwordvalidate_subsystem_redis_username»subsystem_redis_username
- field subsystem_cache_chat_expiration: int = 300
The prompt cache expiration time in seconds for cached prompt data.
This setting defines how long cached prompt data should be considered valid before it is refreshed or invalidated. A shorter expiration time may lead to more frequent cache refreshes, while a longer expiration time can improve performance by reducing the number of cache lookups.
- Type:
- Default:
60 * 5- Raises:
SmarterConfigurationError – If the value is not a positive integer.
see:
smarter.apps.prompt.models.PromptHelperThe prompt cache expiration time in seconds for cached prompt data.
- Constraints:
gt = 0
- Validated by:
- field subsystem_cache_expiration: int = 60
Default cache expiration time for Django views that use page caching.
See: django.views.decorators.cache.cache_control and django.views.decorators.cache.cache_page
The cache expiration time in seconds for cached data. This setting defines how long cached data should be considered valid before it is refreshed or invalidated. A shorter expiration time may lead to more frequent cache refreshes, while a longer expiration time can improve performance by reducing the number of cache lookups. :type: int :default:
60 * 1:raises SmarterConfigurationError: If the value is not a positive integer.The cache expiration time in seconds for cached data.
- Constraints:
gt = 0
- Validated by:
- field subsystem_cache_listview_expiration: int = 3600
The cache expiration time in seconds for the pages of the web console’s list views.
Each list api caches the pages that it returns, per user. Saving or deleting a resource makes its list’s cached pages stale at once (see
smarter.lib.django.listview), so this expiration only bounds how long a change made without Django’s signals, such as aQuerySet.update(), can go unnoticed.- Type:
- Default:
60 * 60- Raises:
SmarterConfigurationError – If the value is not a positive integer.
The cache expiration time in seconds for the pages of the web console’s list views.
- Constraints:
gt = 0
- Validated by:
- field subsystem_cache_llm_client_expiration: int = 300
The llmclient cache expiration time in seconds for cached llmclient data.
This setting defines how long cached llmclient data should be considered valid before it is refreshed or invalidated. A shorter expiration time may lead to more frequent cache refreshes, while a longer expiration time can improve performance by reducing the number of cache lookups.
- Type:
- Default:
60 * 5- Raises:
SmarterConfigurationError – If the value is not a positive integer.
The llmclient cache expiration time in seconds for cached llmclient data.
- Constraints:
gt = 0
- Validated by:
- field subsystem_cache_prompt_response_expiration: int = 3600
Seconds to cache the LLM’s answer to the first message of a conversation.
0 disables the cache.
A first message has no conversation before it, so the same message, sent to the same LLMClient, gets the same answer, e.g. one of the LLMClient’s
appExamplePrompts. Later messages are never cached, because their answers depend on the conversation. Seesmarter.apps.provider.services.text_completion.lib.prompt_cache.- Type:
- Default:
one hour
- Raises:
SmarterConfigurationError – If the value is not a non-negative integer.
Seconds to cache the LLM’s answer to the first message of a conversation. 0 disables the cache.
- Constraints:
ge = 0
- Validated by:
- field subsystem_redis_password: HeldBy(pods=frozenset({'worker-infrastructure', 'api', 'worker-extensions', 'beat', 'worker', 'job-backup', 'bastion', 'job-init', 'worker-tools', 'job-migrate'}))] = None
The password of the platform’s Redis, which holds the Celery broker, RedBeat’s schedule, the cache and the.
sessions.
Set it with
SMARTER_SUBSYSTEM_REDIS_PASSWORD. On a cluster that smarter-infrastructure built, the Helm chart reads it from the Kubernetes Secretsmarter-redis-password, which smarter-infrastructure generates, and gives the same Secret to its Redis.smarter.settings.base_awsbuilds the broker’s, RedBeat’s and the caches’ urls from it, andrequire_redis_password()refuses to start without it outside the local environment (ADR-030, rule 5).In the local environment it defaults to the password of docker-compose.yml’s smarter-redis service. Elsewhere there is no default: a missing password, or a placeholder such as
SET-ME-PLEASE, is None.- Type:
Optional[SecretStr]
- Default:
"smarter"in the local environment, and None elsewhere. Seederive_cache_defaults().- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The password of the platform’s Redis: the Celery broker, the cache and the sessions.
- Constraints:
pods = frozenset({‘worker-infrastructure’, ‘api’, ‘worker-extensions’, ‘beat’, ‘worker’, ‘job-backup’, ‘bastion’, ‘job-init’, ‘worker-tools’, ‘job-migrate’})
- Validated by:
- field subsystem_redis_username: str | None = None
The Redis ACL user that this process authenticates as.
Every process but the tool worker uses Redis’s
defaultuser, which may do anything. The tool worker is given its own user,tools(RedisAclUsers.TOOL_WORKER), which may touch only its own queue, its results, Extensions’ archives and a few cache keys (ADR-030, rule 8), withsubsystem_redis_passwordset to that user’s password.Set it with
SMARTER_SUBSYSTEM_REDIS_USERNAME.- Type:
Optional[str]
- Default:
None, Redis’s
defaultuser.- Raises:
SmarterConfigurationError – If the value is not a string.
The Redis ACL user that this process authenticates as, or empty for Redis’s default user.
- Validated by:
- validator derive_cache_defaults » all fields[source]
Derive the local environment’s Redis password, unless it is set.
In the local environment, the password is docker-compose.yml’s smarter-redis service’s,
smarter. Elsewhere there is no default.
- validator parse_subsystem_cache_chat_expiration » subsystem_cache_chat_expiration[source]
Validates the ‘cache_chat_expiration’ field.
- validator parse_subsystem_cache_expiration » subsystem_cache_expiration[source]
Validates the ‘cache_expiration’ field.
- validator parse_subsystem_cache_listview_expiration » subsystem_cache_listview_expiration[source]
Validates the ‘cache_listview_expiration’ field.
- validator parse_subsystem_cache_llm_client_expiration » subsystem_cache_llm_client_expiration[source]
Validates the ‘cache_llm_client_expiration’ field.
- validator parse_subsystem_cache_prompt_response_expiration » subsystem_cache_prompt_response_expiration[source]
Validates the ‘cache_prompt_response_expiration’ field.
- validator validate_subsystem_redis_password » subsystem_redis_password[source]
Validate
subsystem_redis_password.
- validator validate_subsystem_redis_username » subsystem_redis_username[source]
Validate
subsystem_redis_username.
- pydantic model smarter.common.conf.settings.database.DatabaseSettings[source]
The platform’s MySQL (MariaDB) database.
Show JSON schema
{ "title": "DatabaseSettings", "description": "The platform's MySQL (MariaDB) database.", "type": "object", "properties": { "subsystem_sql_root_username": { "default": "root", "description": "The database server's administrator, whom manage.py load_from_github --run_scripts passes to a repository's scripts.", "examples": [ "root" ], "title": "MySQL Root Username", "type": "string" }, "subsystem_sql_root_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the database server's administrator, sql_root_username.", "examples": [ "your-root-password" ], "title": "MySQL Root Password" }, "subsystem_sql_backup_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the read-only account that the nightly database backup dumps the database as.", "examples": [ "your-backup-password" ], "title": "MySQL Backup Password" }, "subsystem_sql_host": { "default": "smarter-mariadb", "description": "The host name of the platform's database server.", "examples": [ "smarter-mariadb", "mysql.example.com" ], "title": "MySQL Host", "type": "string" }, "subsystem_sql_port": { "default": 3306, "description": "The TCP port of the platform's database server.", "examples": [ 3306 ], "maximum": 65535, "minimum": 1, "title": "MySQL Port", "type": "integer" }, "subsystem_sql_database": { "default": "smarter", "description": "The name of the platform's database.", "examples": [ "smarter" ], "title": "MySQL Database", "type": "string" }, "subsystem_sql_user": { "default": "smarter", "description": "The database user that the platform connects as.", "examples": [ "smarter" ], "title": "MySQL User", "type": "string" }, "subsystem_sql_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of sql_user, the database user that the platform connects as.", "examples": [ "your-database-password" ], "title": "MySQL Password" }, "database_read_timeout": { "default": 0, "description": "The seconds that a query of the platform's database may wait for the server's reply before it fails. 0 for no timeout.", "minimum": 0, "title": "Database Read Timeout", "type": "integer" }, "database_unavailable": { "default": false, "description": "True in a process that has no platform database: the tool worker. Waffle switches are then off, without a query.", "title": "Database Unavailable", "type": "boolean" } } }
- Fields:
- Validators:
- field database_read_timeout: int = 0
The seconds that a query of the platform’s database may wait for the server’s reply, and a write may.
wait to be sent, before it fails. 0, the default, is no timeout.
Without a timeout, a request whose query the database never answers holds its thread forever. The Helm chart sets it for the web server’s pods only: migrations and other management commands can legitimately run longer, and keep the default. Connecting always times out after
smarter.settings.base.DATABASE_CONNECT_TIMEOUTseconds.Set it with
SMARTER_DATABASE_READ_TIMEOUT.- Type:
- Default:
0 if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a non-negative integer.
The seconds that a query of the platform’s database may wait for the server’s reply before it fails. 0 for no timeout.
- Constraints:
ge = 0
- Validated by:
True in a process that is not given the platform’s database: the tool worker,
smarter-worker-tools.The tool worker runs LLM tool calls without the database or the platform’s credentials (ADR-038). Its network policy doesn’t let it reach the database, so a query would wait for the connection to time out. With this setting, every waffle switch is off, and is never read from the database, so that a switched logger, which checks its switch on each log call, costs nothing.
Set it with
SMARTER_DATABASE_UNAVAILABLE. The Helm chart sets it for the tool worker only.- Type:
- Default:
False
True in a process that has no platform database: the tool worker. Waffle switches are then off, without a query.
- Validated by:
- field subsystem_sql_backup_password: HeldBy(pods=frozenset({'job-backup', 'bastion', 'job-init'}))] = None
The password of the database’s read-only backup account,
smarter_backupby default.Set it with
SMARTER_SUBSYSTEM_SQL_BACKUP_PASSWORD. The Helm chart’s init Job creates the account with it, and its nightly backup Job dumps the database as that account; until it is set, the backup dumps as the administrator,subsystem_sql_root_password. Only the chart’s shell scripts use it, not Smarter’s Python code: it is a setting so that the credentials map (smarter.common.conf.credentials) says which pods hold it, and the chart gives it to no other pod.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The password of the read-only account that the nightly database backup dumps the database as.
- Constraints:
pods = frozenset({‘job-backup’, ‘bastion’, ‘job-init’})
- Validated by:
- field subsystem_sql_database: str = 'smarter'
The name of the platform’s database, Django’s
DATABASES["default"]["NAME"].Set it with
SMARTER_SUBSYSTEM_SQL_DATABASE.- Type:
- Default:
smarterif it is not set.- Raises:
SmarterConfigurationError – If the value is not a non-empty string.
The name of the platform’s database.
- Validated by:
- field subsystem_sql_host: str = 'smarter-mariadb'
The host name of the platform’s database server, Django’s
DATABASES["default"]["HOST"].Set it with
SMARTER_SUBSYSTEM_SQL_HOST.- Type:
- Default:
smarter-mariadb, the local docker-compose service, if it is not set.- Raises:
SmarterConfigurationError – If the value is not a non-empty string.
The host name of the platform’s database server.
- Validated by:
- field subsystem_sql_password: HeldBy(pods=frozenset({'worker-infrastructure', 'api', 'beat', 'worker', 'job-backup', 'bastion', 'job-init', 'job-migrate'}))] = None
The password of
sql_user, Django’sDATABASES["default"]["PASSWORD"].Set it with
SMARTER_SUBSYSTEM_SQL_PASSWORD. In the local environment it defaults to the password of docker-compose.yml’s smarter-mariadb service. Elsewhere there is no default: a missing password, or a placeholder such asSET-ME-PLEASE, is None, and the platform can’t connect to its database.- Type:
Optional[SecretStr]
- Default:
"smarter"in the local environment, and None elsewhere. Seederive_database_defaults().- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The password of sql_user, the database user that the platform connects as.
- Constraints:
pods = frozenset({‘worker-infrastructure’, ‘api’, ‘beat’, ‘worker’, ‘job-backup’, ‘bastion’, ‘job-init’, ‘job-migrate’})
- Validated by:
- field subsystem_sql_port: int = 3306
The TCP port of the platform’s database server, Django’s
DATABASES["default"]["PORT"].Set it with
SMARTER_SUBSYSTEM_SQL_PORT.- Type:
- Default:
3306 if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a port number, 1 to 65535.
The TCP port of the platform’s database server.
- Constraints:
ge = 1
le = 65535
- Validated by:
- field subsystem_sql_root_password: HeldBy(pods=frozenset({'job-backup', 'bastion', 'job-init'}))] = None
The password of the database server’s administrator,
sql_root_username.Set it with
SMARTER_SUBSYSTEM_SQL_ROOT_PASSWORD.manage.py load_from_github --run_scriptspasses it to a repository’s scripts in theMYSQL_PWDenvironment variable, where the MariaDB and MySQL clients read it, which keeps it off the command line. Without it, the scripts don’t receive it.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The password of the database server’s administrator, sql_root_username.
- Constraints:
pods = frozenset({‘job-backup’, ‘bastion’, ‘job-init’})
- Validated by:
- field subsystem_sql_root_username: str = 'root'
The database server’s administrator.
manage.py load_from_github --run_scriptspasses it to a repository’s scripts, inSMARTER_DATABASE_ADMIN_USERNAME, e.g. to the Stackademy script that creates its course database and its users, so it needs a user that may. Set it withSMARTER_SUBSYSTEM_SQL_ROOT_USERNAME.- Type:
- Default:
rootif it is not set.- Raises:
SmarterConfigurationError – If the value is not a non-empty string.
The database server’s administrator, whom manage.py load_from_github –run_scripts passes to a repository’s scripts.
- Validated by:
- field subsystem_sql_user: str = 'smarter'
The database user that the platform connects as, Django’s
DATABASES["default"]["USER"].Set it with
SMARTER_SUBSYSTEM_SQL_USER.- Type:
- Default:
smarterif it is not set.- Raises:
SmarterConfigurationError – If the value is not a non-empty string.
The database user that the platform connects as.
- Validated by:
- validator derive_database_defaults » all fields[source]
Derive the local environment’s database password, unless it is set.
In the local environment, the password is docker-compose.yml’s smarter-mariadb service’s,
smarter. Elsewhere there is no default.
- validator parse_database_read_timeout » database_read_timeout[source]
Validates the ‘database_read_timeout’ field.
- validator validate_subsystem_sql_backup_password » subsystem_sql_backup_password[source]
Validates the sql_backup_password field.
- validator validate_subsystem_sql_database » subsystem_sql_database[source]
Validates the sql_database field.
- validator validate_subsystem_sql_host » subsystem_sql_host[source]
Validates the sql_host field.
- validator validate_subsystem_sql_password » subsystem_sql_password[source]
Validates the sql_password field.
- validator validate_subsystem_sql_port » subsystem_sql_port[source]
Validates the sql_port field.
- validator validate_subsystem_sql_root_password » subsystem_sql_root_password[source]
Validates the sql_root_password field.
- validator validate_subsystem_sql_root_username » subsystem_sql_root_username[source]
Validates the sql_root_username field.
- pydantic model smarter.common.conf.settings.email.EmailSettings[source]
Outgoing email: SMTP, the administrator’s address, and the mailing list.
Show JSON schema
{ "title": "EmailSettings", "description": "Outgoing email: SMTP, the administrator's address, and the mailing list.", "type": "object", "properties": { "subsystem_logging_loki_url": { "default": "", "description": "The base url of the Loki that stores the platform's pod logs, e.g. http://smarter-loki:3100. Empty: there is none.", "examples": [ "http://smarter-loki:3100" ], "title": "Loki URL", "type": "string" }, "overrides_file": { "default": "/home/smarter_user/overrides/settings.yaml", "description": "The path of the YAML file of overrides, which overwrite Smarter's Django settings.", "examples": [ "/home/smarter_user/overrides/settings.yaml" ], "title": "Overrides File", "type": "string" }, "bootstrap_secrets_dir": { "default": "/home/smarter_user/bootstrap-secrets", "description": "The folder of files from which the init Job creates Smarter Secrets, one per file.", "examples": [ "/home/smarter_user/bootstrap-secrets" ], "title": "Bootstrap Secrets Folder", "type": "string" }, "SERVICE_TYPE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The kind of pod this process runs in, e.g. api or worker-tools. Empty: unknown.", "examples": [ "api" ], "title": "Service Type" }, "environment": { "default": "local", "description": "The deployment environment for the platform.", "examples": [ "local", "alpha", "beta", "next", "prod" ], "title": "Deployment Environment", "type": "string" }, "platform_subdomain": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "platform", "description": "The subdomain for the platform, used in constructing URLs and email addresses.", "examples": [ "platform", "ubc" ], "title": "Platform Subdomain" }, "platform_root_domain": { "default": "example.com", "description": "The root domain for the platform.", "examples": [ "example.com" ], "title": "Root Domain", "type": "string" }, "platform_settings_output": { "default": false, "description": "Flag to enable or disable output of settings for debugging purposes.", "examples": [ true, false ], "title": "Settings Output", "type": "boolean" }, "platform_shared_resource_identifier": { "default": "smarter", "description": "Smarter 1-word identifier to be used when naming any shared resource.", "examples": [ "smarter", "mycompany", "myproject" ], "title": "Shared Resource Identifier", "type": "string" }, "AWS_PROFILE": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The AWS profile to use for authentication. If present, this will take precedence over AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.", "examples": [ "default", "smarter-profile" ], "title": "AWS Profile" }, "AWS_ACCESS_KEY_ID": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The AWS access key ID for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.", "examples": [ "^AKIA[0-9A-Z]{16}$" ], "title": "AWS Access Key ID" }, "AWS_SECRET_ACCESS_KEY": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The AWS secret access key for authentication. Used if AWS_PROFILE is not set. Masked by pydantic SecretStr.", "examples": [ "^[0-9a-zA-Z/+]{40}$" ], "title": "AWS Secret Access Key" }, "aws_regions": { "default": [ "us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3", "ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-4", "ap-southeast-5", "ap-southeast-7", "ca-central-1", "ca-west-1", "eu-central-1", "eu-central-2", "eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3", "il-central-1", "me-central-1", "me-south-1", "mx-central-1", "sa-east-1" ], "description": "A list of AWS regions considered valid for this platform.", "examples": [ "us-east-1", "us-west-2", "eu-west-1" ], "items": { "type": "string" }, "title": "AWS Regions", "type": "array" }, "AWS_REGION": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The single AWS region in which all AWS service clients will operate.", "examples": [ "us-east-1", "us-west-2", "eu-west-1" ], "title": "AWS Region" }, "platform_cloud_provider": { "default": "aws", "description": "The cloud provider of the platform's infrastructure services: DNS, TLS certificates, and the Kubernetes cluster's credentials.", "examples": [ "aws", "memory" ], "title": "Cloud Provider", "type": "string" }, "subsystem_k8s_cluster_name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the Kubernetes cluster that hosts the platform, e.g. its EKS cluster on AWS.", "examples": [ "apps-hosting-service" ], "title": "Kubernetes Cluster Name" }, "app_llmhost_node_role_arn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The IAM role of the node groups that Smarter creates for LLMHosts.", "examples": [ "arn:aws:iam::123456789012:role/eks-node-role" ], "title": "LLMHost Node Role ARN" }, "app_llmhost_node_subnet_ids": { "default": [], "description": "The subnets of the node groups that Smarter creates for LLMHosts.", "examples": [ [ "subnet-0123456789abcdef0" ] ], "items": { "type": "string" }, "title": "LLMHost Node Subnet IDs", "type": "array" }, "platform_email_admin": { "default": "admin@example.com", "description": "The administrator email address used for system notifications and alerts.", "examples": [ "admin@example.com" ], "format": "email", "title": "Administrator Email Address", "type": "string" }, "subsystem_smtp_sender": { "anyOf": [ { "format": "email", "type": "string" }, { "type": "null" } ], "default": null, "description": "The sender email address for SMTP emails.", "examples": [ "sender@example.com" ], "title": "SMTP Sender Email Address" }, "subsystem_smtp_from_email": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The From address of outgoing email. Set with SMARTER_SUBSYSTEM_SMTP_FROM_EMAIL.", "examples": [ "no-reply@example.com" ], "title": "SMTP From Address" }, "subsystem_smtp_host": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The SMTP server. Set with SMARTER_SUBSYSTEM_SMTP_HOST.", "examples": [ "email-smtp.us-east-1.amazonaws.com" ], "title": "SMTP Host" }, "subsystem_smtp_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The SMTP password for authentication. Assumed to be an AWS SES-generated IAM keypair secret.", "examples": [ "your-smtp-password" ], "title": "SMTP Password" }, "subsystem_smtp_port": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": 587, "description": "The SMTP port for sending emails.", "examples": [ 25, 465, 587 ], "title": "SMTP Port Number" }, "subsystem_smtp_use_ssl": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": false, "description": "Whether to use SSL for SMTP connections.", "examples": [ true, false ], "title": "SMTP Use SSL" }, "subsystem_smtp_use_tls": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": true, "description": "Whether to use TLS for SMTP connections.", "examples": [ true, false ], "title": "SMTP Use TLS" }, "subsystem_smtp_username": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The SMTP username for authentication. Assumed to be an AWS SES-generatred IAM keypair username.", "examples": [ "your-smtp-username" ], "title": "SMTP Username" } } }
- Fields:
- Validators:
- field platform_email_admin: EmailStr = 'admin@example.com'
The administrator email address used for system notifications and alerts.
This email address is used as the primary contact for system notifications, alerts, and other administrative communications related to the platform.
- Type:
- Default:
"admin@example.com"- Raises:
SmarterConfigurationError – If the value is not a valid email address.
The administrator email address used for system notifications and alerts.
- Validated by:
- field subsystem_smtp_from_email: str | None = None
The email address that appears in the “From” field of outgoing SMTP emails.
Set it with
SMARTER_SUBSYSTEM_SMTP_FROM_EMAIL. Seederive_email_defaults().- Type:
Optional[str]
- Default:
no-reply@the platform’s domain, e.g.no-reply@platform.example.com
The From address of outgoing email. Set with SMARTER_SUBSYSTEM_SMTP_FROM_EMAIL.
- Validated by:
- field subsystem_smtp_host: str | None = None
The SMTP server that sends the platform’s email.
Set it with
SMARTER_SUBSYSTEM_SMTP_HOST. Seederive_email_defaults().- Type:
Optional[str]
- Default:
the AWS Simple Email Service endpoint of
aws_region, e.g.email-smtp.us-east-1.amazonaws.com, or None without a region
The SMTP server. Set with SMARTER_SUBSYSTEM_SMTP_HOST.
- Validated by:
- field subsystem_smtp_password: HeldBy(pods=frozenset({'worker-infrastructure', 'api', 'worker', 'job-backup', 'job-init'}))] = None
The SMTP password for authentication.
This setting provides the password used to authenticate with the SMTP server. It is required for sending emails through the SMTP server, which is optional.
- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a valid password.
The SMTP password for authentication. Assumed to be an AWS SES-generated IAM keypair secret.
- Constraints:
pods = frozenset({‘worker-infrastructure’, ‘api’, ‘worker’, ‘job-backup’, ‘job-init’})
- Validated by:
- field subsystem_smtp_port: int | None = 587
The SMTP port for sending emails.
This setting specifies the port number used to connect to the SMTP server for sending outgoing emails.
- Type:
Optional[int]
- Default:
587- Raises:
SmarterConfigurationError – If the value is not a valid port number.
The SMTP port for sending emails.
- Validated by:
- field subsystem_smtp_sender: EmailStr | None = None
The sender email address for SMTP emails.
This setting specifies the email address that will appear as the sender in outgoing SMTP emails sent by the platform.
- Type:
Optional[EmailStr]
- Default:
admin@the root domain, e.g.admin@example.com. Seederive_email_defaults().- Raises:
SmarterConfigurationError – If the value is not a valid email address.
The sender email address for SMTP emails.
- Validated by:
- field subsystem_smtp_use_ssl: bool | None = False
Whether to use SSL for SMTP connections.
This setting indicates whether SSL (Secure Sockets Layer) should be used when connecting to the SMTP server for sending emails.
- Type:
Optional[bool]
- Default:
False- Raises:
SmarterConfigurationError – If the value is not a boolean.
Whether to use SSL for SMTP connections.
- Validated by:
- field subsystem_smtp_use_tls: bool | None = True
Whether to use TLS for SMTP connections.
This setting indicates whether TLS (Transport Layer Security) should be used when connecting to the SMTP server for sending emails.
- Type:
Optional[bool]
- Default:
True- Raises:
SmarterConfigurationError – If the value is not a boolean.
Whether to use TLS for SMTP connections.
- Validated by:
- field subsystem_smtp_username: HeldBy(pods=frozenset({'worker-infrastructure', 'api', 'worker', 'job-backup', 'job-init'}))] = None
The SMTP username for authentication.
This setting provides the username used to authenticate with the SMTP server. It is required for sending emails through the SMTP server, which is optional.
- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a string.
The SMTP username for authentication. Assumed to be an AWS SES-generatred IAM keypair username.
- Constraints:
pods = frozenset({‘worker-infrastructure’, ‘api’, ‘worker’, ‘job-backup’, ‘job-init’})
- Validated by:
- validator derive_email_defaults » all fields[source]
Derive the SMTP sender, the From address and the host, unless they are set.
The sender is
admin@the root domain, the From addressno-reply@the platform’s domain, and the host the AWS Simple Email Service endpoint ofaws_region, if it has one.
- validator validate_platform_email_admin » platform_email_admin[source]
Validates the email_admin field.
- Parameters:
v (
EmailStr|None) – The administrator email address value to validate.- Returns:
The validated administrator email address.
- Return type:
EmailStr
- validator validate_subsystem_smtp_optional » subsystem_smtp_from_email, subsystem_smtp_host[source]
Validates the SMTP From address and host: None if it is missing, or a placeholder.
- validator validate_subsystem_smtp_password » subsystem_smtp_password[source]
Validates the smtp_password field.
- validator validate_subsystem_smtp_port » subsystem_smtp_port[source]
Validates the smtp_port field.
- validator validate_subsystem_smtp_sender » subsystem_smtp_sender[source]
Validates the smtp_sender field.
- validator validate_subsystem_smtp_use_ssl » subsystem_smtp_use_ssl[source]
Validates the smtp_use_ssl field.
- validator validate_subsystem_smtp_use_tls » subsystem_smtp_use_tls[source]
Validates the smtp_use_tls field.
- validator validate_subsystem_smtp_username » subsystem_smtp_username[source]
Validates the smtp_username field.
- pydantic model smarter.common.conf.settings.features.FeatureSettings[source]
Feature flags, debugging and logging.
Show JSON schema
{ "title": "FeatureSettings", "description": "Feature flags, debugging and logging.", "type": "object", "properties": { "debug_mode": { "default": false, "description": "True if debug mode is enabled. This enables verbose logging and other debug features.", "title": "Debug Mode", "type": "boolean" }, "dump_defaults": { "default": false, "description": "True if default values should be dumped for debugging purposes.", "title": "Dump Defaults", "type": "boolean" }, "developer_mode": { "default": false, "description": "True if developer mode is enabled. Used as a means to configure a production Docker container to run locally for student use.", "title": "Developer Mode", "type": "boolean" }, "app_dashboard_manifest_dropzone_enable": { "default": true, "description": "True if the file drop zone feature is enabled based on the current environment.", "title": "Enable File Drop Zone", "type": "boolean" }, "app_connection_enable": { "default": true, "description": "True if the web console serves the Connection pages. Set with SMARTER_APP_CONNECTION_ENABLE.", "title": "Enable Connection", "type": "boolean" }, "app_guardrail_enable": { "default": true, "description": "True if the web console serves the Guardrail pages. Set with SMARTER_APP_GUARDRAIL_ENABLE.", "title": "Enable Guardrail", "type": "boolean" }, "app_llmclient_enable": { "default": true, "description": "True if the web console serves the LLMClient pages. Set with SMARTER_APP_LLMCLIENT_ENABLE.", "title": "Enable LLMClient", "type": "boolean" }, "app_llmhost_enable": { "default": true, "description": "True if the web console serves the LLMHost pages. Set with SMARTER_APP_LLMHOST_ENABLE.", "title": "Enable LLMHost", "type": "boolean" }, "app_llmtool_enable": { "default": true, "description": "True if the web console serves the LLMTool and Extension pages. Set with SMARTER_APP_LLMTOOL_ENABLE.", "title": "Enable LLMTool", "type": "boolean" }, "app_mcpclient_enable": { "default": true, "description": "True if the web console serves the MCPClient pages. Set with SMARTER_APP_MCPCLIENT_ENABLE.", "title": "Enable MCPClient", "type": "boolean" }, "app_orchestrator_enable": { "default": true, "description": "True if the web console serves the Orchestrator pages. Set with SMARTER_APP_ORCHESTRATOR_ENABLE.", "title": "Enable Orchestrator", "type": "boolean" }, "app_provider_enable": { "default": true, "description": "True if the web console serves the Provider pages. Set with SMARTER_APP_PROVIDER_ENABLE.", "title": "Enable Provider", "type": "boolean" }, "app_secret_enable": { "default": true, "description": "True if the web console serves the Secret pages. Set with SMARTER_APP_SECRET_ENABLE.", "title": "Enable Secret", "type": "boolean" }, "app_vectorsearch_enable": { "default": true, "description": "True if the web console serves the VectorSearch pages. Set with SMARTER_APP_VECTORSEARCH_ENABLE.", "title": "Enable VectorSearch", "type": "boolean" }, "app_vectorstore_enable": { "default": true, "description": "True if the vectorstore feature is enabled based on the current environment.", "title": "Enable Vectorstore", "type": "boolean" }, "app_proxy_enable": { "default": true, "description": "True if the proxy feature is enabled based on the current environment.", "title": "Enable Proxy", "type": "boolean" }, "app_dashboard_server_logs_enable": { "default": true, "description": "True if the terminal app feature is enabled based on the current environment.", "title": "Enabled Terminal App", "type": "boolean" }, "app_dashboard_web_console_terminal_enable": { "default": false, "description": "True if superusers can open a bash shell inside the server's container from the web console's Terminal page. Off by default.", "title": "Enable Web Console Terminal", "type": "boolean" }, "platform_static_files_on_cdn": { "default": false, "description": "True if the platform's static files, the web console's scripts among them, are uploaded to the environment's S3 bucket and served from its CDN. Off by default: the server serves them.", "title": "Static Files on the CDN", "type": "boolean" }, "app_dashboard_passthrough_prompt_enable": { "default": true, "description": "True if the passthrough prompt feature is enabled based on the current environment.", "title": "Enable Passthrough Prompt", "type": "boolean" }, "log_level": { "default": 20, "description": "The platform's Python logging level: DEBUG, INFO, WARNING, ERROR or CRITICAL, or its number. Set with SMARTER_LOG_LEVEL.", "examples": [ "DEBUG", "INFO", 30 ], "maximum": 50, "minimum": 0, "title": "Logging Level", "type": "integer" }, "verbose_logging": { "default": false, "description": "Whether to enable verbose logging for debugging purposes.", "examples": [ true, false ], "title": "Verbose Logging", "type": "boolean" } } }
- Fields:
- Validators:
derive_log_level»all fieldsparse_app_dashboard_manifest_dropzone_enable»app_dashboard_manifest_dropzone_enableparse_app_dashboard_passthrough_prompt_enable»app_dashboard_passthrough_prompt_enableparse_app_dashboard_web_console_terminal_enable»app_dashboard_web_console_terminal_enableparse_enabled_terminal_app»app_dashboard_server_logs_enableparse_platform_static_files_on_cdn»platform_static_files_on_cdn
- field app_connection_enable: bool = True
True if the web console serves the Connection pages, under
/connection/.- Type:
- Default:
True unless
SMARTER_APP_CONNECTION_ENABLEis false.
True if the web console serves the Connection pages. Set with SMARTER_APP_CONNECTION_ENABLE.
- Validated by:
- field app_dashboard_manifest_dropzone_enable: bool = True
Determines if the file drop zone feature is enabled based on the current environment.
- Returns:
True if the file drop zone is enabled, False otherwise.
- Return type:
True if the file drop zone feature is enabled based on the current environment.
- Validated by:
- field app_dashboard_passthrough_prompt_enable: bool = True
Determines if the passthrough prompt feature is enabled based on the current environment.
- Returns:
True if the passthrough prompt is enabled, False otherwise.
- Return type:
True if the passthrough prompt feature is enabled based on the current environment.
- field app_dashboard_server_logs_enable: bool = True
Determines if the terminal app feature is enabled based on the current environment.
- Returns:
True if the terminal app is enabled, False otherwise.
- Return type:
True if the terminal app feature is enabled based on the current environment.
- Validated by:
- field app_dashboard_web_console_terminal_enable: bool = False
Determines whether superusers can open a bash shell inside the server’s container from the web console.
The shell runs as the server’s own operating system user, with the server’s environment and credentials, inside whichever server process (and so whichever pod or container) accepted the connection. See
smarter.apps.dashboard.views.terminal_emulator.api.consumers.Set with
SMARTER_APP_DASHBOARD_WEB_CONSOLE_TERMINAL_ENABLE. Defaults to False.- Returns:
True if the web console terminal is enabled, False otherwise.
- Return type:
True if superusers can open a bash shell inside the server’s container from the web console’s Terminal page. Off by default.
- field app_guardrail_enable: bool = True
True if the web console serves the Guardrail pages, under
/guardrail/.- Type:
- Default:
True unless
SMARTER_APP_GUARDRAIL_ENABLEis false.
True if the web console serves the Guardrail pages. Set with SMARTER_APP_GUARDRAIL_ENABLE.
- Validated by:
- field app_llmclient_enable: bool = True
True if the web console serves the LLMClient pages, under
/llmclient/.It doesn’t affect the chat and config endpoints of LLMClients on their custom domains.
- Type:
- Default:
True unless
SMARTER_APP_LLMCLIENT_ENABLEis false.
True if the web console serves the LLMClient pages. Set with SMARTER_APP_LLMCLIENT_ENABLE.
- Validated by:
- field app_llmhost_enable: bool = True
True if the web console serves the LLMHost pages, under
/llmhost/.- Type:
- Default:
True unless
SMARTER_APP_LLMHOST_ENABLEis false.
True if the web console serves the LLMHost pages. Set with SMARTER_APP_LLMHOST_ENABLE.
- Validated by:
- field app_llmtool_enable: bool = True
True if the web console serves the LLMTool pages, under
/llm-tools/, and the Extension pages.- Type:
- Default:
True unless
SMARTER_APP_LLMTOOL_ENABLEis false.
True if the web console serves the LLMTool and Extension pages. Set with SMARTER_APP_LLMTOOL_ENABLE.
- Validated by:
- field app_mcpclient_enable: bool = True
True if the web console serves the MCPClient pages, under
/mcpclient/.- Type:
- Default:
True unless
SMARTER_APP_MCPCLIENT_ENABLEis false.
True if the web console serves the MCPClient pages. Set with SMARTER_APP_MCPCLIENT_ENABLE.
- Validated by:
- field app_orchestrator_enable: bool = True
True if the web console serves the Orchestrator pages, under
/orchestrator/.- Type:
- Default:
True unless
SMARTER_APP_ORCHESTRATOR_ENABLEis false.
True if the web console serves the Orchestrator pages. Set with SMARTER_APP_ORCHESTRATOR_ENABLE.
- Validated by:
- field app_provider_enable: bool = True
True if the web console serves the Provider pages, under
/provider/.- Type:
- Default:
True unless
SMARTER_APP_PROVIDER_ENABLEis false.
True if the web console serves the Provider pages. Set with SMARTER_APP_PROVIDER_ENABLE.
- Validated by:
- field app_proxy_enable: bool = True
Determines if the proxy feature is enabled based on the current environment.
It mounts the Proxy web console pages, under
/proxy/, and its api endpoints.- Returns:
True if the proxy is enabled, False otherwise.
- Return type:
True if the proxy feature is enabled based on the current environment.
- Validated by:
- field app_secret_enable: bool = True
True if the web console serves the Secret pages, under
/secret/.- Type:
- Default:
True unless
SMARTER_APP_SECRET_ENABLEis false.
True if the web console serves the Secret pages. Set with SMARTER_APP_SECRET_ENABLE.
- Validated by:
- field app_vectorsearch_enable: bool = True
True if the web console serves the VectorSearch pages, under
/vectorsearch/.- Type:
- Default:
True unless
SMARTER_APP_VECTORSEARCH_ENABLEis false.
True if the web console serves the VectorSearch pages. Set with SMARTER_APP_VECTORSEARCH_ENABLE.
- Validated by:
- field app_vectorstore_enable: bool = True
Determines if the vectorstore feature is enabled based on the current environment.
It mounts the VectorStore web console pages, under
/vectorstore/, and its api endpoints.- Returns:
True if the vectorstore is enabled, False otherwise.
- Return type:
True if the vectorstore feature is enabled based on the current environment.
- Validated by:
- field debug_mode: bool = False
True if debug mode is enabled.
This enables verbose logging and other debug features.
When debug mode is enabled, the platform will log additional information useful for troubles hooting and development. This may include detailed error messages, stack traces, and other diagnostic data that can help identify issues during development or testing.
- Type:
- Default:
False- Raises:
SmarterConfigurationError – If the value is not a boolean.
True if debug mode is enabled. This enables verbose logging and other debug features.
- Validated by:
- field developer_mode: bool = False
True if developer mode is enabled.
Used as a means to configure a production Docker container to run locally for student use. When developer mode is enabled, certain restrictions or configurations that are typical of a production environment may be relaxed or altered to facilitate local development and testing. This allows developers to work with a production-like setup without the constraints that would normally apply in a live environment.
- Type:
- Default:
False- Raises:
SmarterConfigurationError – If the value is not a boolean.
True if developer mode is enabled. Used as a means to configure a production Docker container to run locally for student use.
- Validated by:
- field dump_defaults: bool = False
True if default values should be dumped for debugging purposes.
When enabled, the platform will log or output the default configuration values used during initialization. This can help developers and administrators understand the effective configuration of the system, especially when trouble shooting issues related to settings.
- Type:
- Default:
False- Raises:
SmarterConfigurationError – If the value is not a boolean.
True if default values should be dumped for debugging purposes.
- Validated by:
- field log_level: int = 20
The platform’s Python logging level, e.g.
logging.INFO.Set it with
SMARTER_LOG_LEVEL, a level’s name, e.g.DEBUG, or its number, e.g.10. Unless it is set, it is derived fromdebug_mode:logging.DEBUGin debug mode, andlogging.INFOotherwise. Seederive_log_level().- Type:
- Default:
logging.INFO, orlogging.DEBUGin debug mode- Raises:
SmarterConfigurationError – If the value is neither a level’s name nor its number.
The platform’s Python logging level: DEBUG, INFO, WARNING, ERROR or CRITICAL, or its number. Set with SMARTER_LOG_LEVEL.
- Constraints:
ge = 0
le = 50
- Validated by:
- field platform_static_files_on_cdn: bool = False
Determines whether the static files are served from the environment’s CDN, rather than by the server.
When true,
initialize_platformuploads them to the environment’s S3 bucket, understatic/, on each deployment, andSTATIC_URLis the CDN’s, e.g.https://cdn.platform.example.com/static/. Pages, cookies and the api stay on the platform’s own host: only static files come from the CDN. It needs AWS, and is ignored, with a warning, without it. See ADR-035.Set with
SMARTER_PLATFORM_STATIC_FILES_ON_CDN. Defaults to False.- Returns:
True if the static files are served from the CDN, False otherwise.
- Return type:
True if the platform’s static files, the web console’s scripts among them, are uploaded to the environment’s S3 bucket and served from its CDN. Off by default: the server serves them.
- Validated by:
- field verbose_logging: bool = False
Whether to enable verbose logging for debugging purposes.
If True, enables verbose logging throughout the Smarter platform for debugging purposes. :type: bool :default:
False:raises SmarterConfigurationError: If the value is not a boolean.Whether to enable verbose logging for debugging purposes.
- Validated by:
- validator derive_log_level » all fields[source]
Derive
log_levelfromdebug_mode, unless it is set.
- validator parse_app_dashboard_manifest_dropzone_enable » app_dashboard_manifest_dropzone_enable[source]
Validates the ‘app_dashboard_manifest_dropzone_enable’ field.
- validator parse_app_dashboard_passthrough_prompt_enable » app_dashboard_passthrough_prompt_enable[source]
Validates the ‘app_dashboard_passthrough_prompt_enable’ field.
- validator parse_app_dashboard_web_console_terminal_enable » app_dashboard_web_console_terminal_enable[source]
Validates the ‘app_dashboard_web_console_terminal_enable’ field.
- validator parse_debug_mode » debug_mode[source]
Validates the ‘debug_mode’ field.
- validator parse_developer_mode » developer_mode[source]
Validates the ‘developer_mode’ field.
- validator parse_dump_defaults » dump_defaults[source]
Validates the ‘dump_defaults’ field.
- validator parse_enable_sam_app » app_provider_enable, app_vectorsearch_enable, app_vectorstore_enable, app_proxy_enable, app_connection_enable, app_guardrail_enable, app_llmhost_enable, app_mcpclient_enable, app_secret_enable, app_llmclient_enable, app_llmtool_enable, app_orchestrator_enable[source]
Validate one of the SAM apps’
enable_<app>flags.An empty value falls back to the field’s default, True for every one of them.
- validator parse_enabled_terminal_app » app_dashboard_server_logs_enable[source]
Validates the ‘app_dashboard_server_logs_enable’ field.
- pydantic model smarter.common.conf.settings.integrations.IntegrationSettings[source]
The credentials of third-party services: Account Manager, GitHub, Slack, Stripe and social login.
Show JSON schema
{ "title": "IntegrationSettings", "description": "The credentials of third-party services: Account Manager, GitHub, Slack, Stripe and social login.", "type": "object", "properties": { "account_manager_api_key": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The platform's key for Account Manager's subscription status api, which multitenant authentication sends as 'Authorization: Platform <key>'. Masked by pydantic SecretStr.", "examples": [ "the key that Account Manager's create_platform_api_key command printed" ], "title": "Account Manager API Key" }, "GITHUB_TOKEN": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The platform's GitHub token, from GITHUB_TOKEN, for the GitHub REST api requests that retrieve remote SkillPlugin skills, and that open the bug reports of the platform's staff. Masked by pydantic SecretStr.", "examples": [ "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "GitHub Token" }, "subsystem_social_auth_google_oauth2_key": { "default": "**********", "description": "The OAuth2 key for Google social authentication. Masked by pydantic SecretStr.", "examples": [ "your-google-oauth2-key" ], "format": "password", "title": "Google OAuth2 Key", "type": "string", "writeOnly": true }, "subsystem_social_auth_google_oauth2_secret": { "default": "**********", "description": "The OAuth2 secret for Google social authentication. Masked by pydantic SecretStr.", "examples": [ "your-google-oauth2-secret" ], "format": "password", "title": "Google OAuth2 Secret", "type": "string", "writeOnly": true }, "subsystem_social_auth_github_key": { "default": "**********", "description": "The OAuth2 key for GitHub social authentication. Masked by pydantic SecretStr.", "examples": [ "your-github-oauth2-key" ], "format": "password", "title": "GitHub OAuth2 Key", "type": "string", "writeOnly": true }, "subsystem_social_auth_github_secret": { "default": "**********", "description": "The OAuth2 secret for GitHub social authentication. Masked by pydantic SecretStr.", "examples": [ "your-github-oauth2-secret" ], "format": "password", "title": "GitHub OAuth2 Secret", "type": "string", "writeOnly": true }, "subsystem_social_auth_linkedin_oauth2_key": { "default": "**********", "description": "The OAuth2 key for LinkedIn social authentication. Masked by pydantic SecretStr.", "examples": [ "your-linkedin-oauth2-key" ], "format": "password", "title": "LinkedIn OAuth2 Key", "type": "string", "writeOnly": true }, "subsystem_social_auth_linkedin_oauth2_secret": { "default": "**********", "description": "The OAuth2 secret for LinkedIn social authentication. Masked by pydantic SecretStr.", "examples": [ "your-linkedin-oauth2-secret" ], "format": "password", "title": "LinkedIn OAuth2 Secret", "type": "string", "writeOnly": true }, "subsystem_slack_bot_token": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "A Slack app's bot token, xoxb-..., which the platform posts its Kubernetes jobs' logs to Slack with. Masked by pydantic SecretStr.", "examples": [ "xoxb-xxxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Slack Bot Token" }, "subsystem_slack_app_token": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The Slack bot's app-level token, xapp-..., for Socket Mode. Only the Slack bot holds it.", "examples": [ "xapp-1-xxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Slack App Token" }, "stripe_live_secret_key": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": "**********", "description": "DEPRECATED: The secret key for Stripe live environment.", "examples": [ "sk_live_xxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Stripe Live Secret Key" }, "stripe_test_secret_key": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": "**********", "description": "DEPRECATED: The secret key for Stripe test environment.", "examples": [ "sk_test_xxxxxxxxxxxxxxxxxxxxxxxx" ], "title": "Stripe Test Secret Key" } } }
- Fields:
subsystem_social_auth_github_secret (pydantic.types.SecretStr)subsystem_social_auth_google_oauth2_key (pydantic.types.SecretStr)subsystem_social_auth_google_oauth2_secret (pydantic.types.SecretStr)subsystem_social_auth_linkedin_oauth2_key (pydantic.types.SecretStr)subsystem_social_auth_linkedin_oauth2_secret (pydantic.types.SecretStr)
- Validators:
validate_subsystem_slack_app_token»subsystem_slack_app_tokenvalidate_subsystem_slack_bot_token»subsystem_slack_bot_tokenvalidate_subsystem_social_auth_github_key»subsystem_social_auth_github_keyvalidate_subsystem_social_auth_github_secret»subsystem_social_auth_github_secretvalidate_subsystem_social_auth_google_oauth2_key»subsystem_social_auth_google_oauth2_keyvalidate_subsystem_social_auth_google_oauth2_secret»subsystem_social_auth_google_oauth2_secretvalidate_subsystem_social_auth_linkedin_oauth2_key»subsystem_social_auth_linkedin_oauth2_keyvalidate_subsystem_social_auth_linkedin_oauth2_secret»subsystem_social_auth_linkedin_oauth2_secret
- field account_manager_api_key: HeldBy(pods=frozenset({'api'}))] = None
The platform’s key for Account Manager’s subscription status api.
A multitenant platform asks Account Manager, when a user signs in, whether the user has an active subscription (see
smarter.lib.social_core.backends.multitenant). The key identifies the platform to Account Manager, which issues one per platform with itscreate_platform_api_keymanagement command. It is sent only to Account Manager, asAuthorization: Platform <key>.Without a key, the platform asks without one, which Account Manager answers until its
require_platform_keywaffle switch is on.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The platform’s key for Account Manager’s subscription status api, which multitenant authentication sends as ‘Authorization: Platform <key>’. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- field github_token: HeldBy(pods=frozenset({'worker', 'api'}))] = None
The platform’s GitHub token, from
GITHUB_TOKEN.GITHUB_TOKENis the name that GitHub Actions and most tools use. It is used for two things:SkillPlugin skills. A SkillPlugin whose skill is in a GitHub repository lists the skill’s files with the GitHub git trees api. Without a token those requests are anonymous, and GitHub limits them to 60 per hour per client IP address, which hosts that share an address, such as GitHub Actions runners, reach quickly. Any token raises the limit, with no scopes: in GitHub Actions, the workflow’s own
GITHUB_TOKENwill do. Seesmarter.apps.llmtool.plugin.skill_sources.list_github_skill_files().Bug reports. The MCPServer’s staff-only tool
create_bug_reportopens a GitHub issue in a repository of The Smarter Project with it, when Smarter Sysadmin has diagnosed a bug and the staff member agrees to report it. For that, it must be a classic personal access token,ghp_..., with thepublic_reposcope, and the issue is written as its owner. Seesmarter.apps.mcpserver.services.github.bug_reports.create_bug_report().
The token is sent only to
api.github.com, and is never logged.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The platform’s GitHub token, from GITHUB_TOKEN, for the GitHub REST api requests that retrieve remote SkillPlugin skills, and that open the bug reports of the platform’s staff. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘worker’, ‘api’})
- Validated by:
- field stripe_live_secret_key: Annotated[SecretStr | None, HeldBy(pods=frozenset())] = SecretStr('**********')
Deprecated since version 0.13.0.: This setting is deprecated and will be removed in a future release. Please use the new payment processing configuration settings.
The secret key for Stripe live environment. This setting provides the secret key used to authenticate with Stripe’s live environment. It is used for processing real transactions and payments.
- Type:
Optional[str]
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a string.
DEPRECATED: The secret key for Stripe live environment.
- Constraints:
pods = frozenset()
- Validated by:
- field stripe_test_secret_key: Annotated[SecretStr | None, HeldBy(pods=frozenset())] = SecretStr('**********')
Deprecated since version 0.13.0.: This setting is deprecated and will be removed in a future release. Please use the new payment processing configuration settings.
The secret key for Stripe test environment. This setting provides the secret key used to authenticate with Stripe’s test environment. It is used for processing test transactions and payments.
- Type:
Optional[str]
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a string.
DEPRECATED: The secret key for Stripe test environment.
- Constraints:
pods = frozenset()
- Validated by:
- field subsystem_slack_app_token: Annotated[SecretStr | None, HeldBy(pods=frozenset())] = None
The Slack bot’s app-level token,
xapp-..., with which it connects to Slack in Socket Mode.Set it with
SMARTER_SUBSYSTEM_SLACK_APP_TOKEN. Only the optional Slack bot, the Helm chart’sslack-botsubchart, uses it, from its own Secret,<appName>-env-slack-bot. No kind of Smarter pod holds it (HeldBy()): it is a setting so that the credentials map (smarter.common.conf.credentials) keeps it out of every pod’s environment.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The Slack bot’s app-level token, xapp-…, for Socket Mode. Only the Slack bot holds it.
- Constraints:
pods = frozenset()
- Validated by:
- field subsystem_slack_bot_token: HeldBy(pods=frozenset({'job-backup', 'job-init'}))] = None
A Slack app’s bot token,
xoxb-..., for the platform’s Slack service.The Helm chart’s init Job and nightly database backup post their outcome, and their log, to a Slack channel with it, when the chart’s
databaseInit.notifySlackChannelordatabaseScheduledBackup.notifySlackChannelnames one. The bot needs the scopeschat:writeandfiles:write, and must be a member of the channel. The optional Slack bot, the Helm chart’sslack-botsubchart, reads the same token from a Secret of its own,<appName>-env-slack-bot, which holds only its two tokens.The token is sent only to
slack.com. Seesmarter.apps.infrastructure.services.slack.SlackWebApiService.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
A Slack app’s bot token, xoxb-…, which the platform posts its Kubernetes jobs’ logs to Slack with. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘job-backup’, ‘job-init’})
- Validated by:
- field subsystem_social_auth_github_key: HeldBy(pods=frozenset({'api'}))] = SecretStr('**********')
The OAuth2 key for GitHub social authentication.
Masked by pydantic SecretStr. This setting provides the OAuth2 client ID used for GitHub social authentication. It is required for enabling users to log in using their GitHub accounts.
- Type:
SecretStr
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a valid OAuth2 client ID
The OAuth2 key for GitHub social authentication. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- field subsystem_social_auth_github_secret: HeldBy(pods=frozenset({'api'}))] = SecretStr('**********')
The OAuth2 secret for GitHub social authentication.
Masked by pydantic SecretStr. This setting provides the OAuth2 client secret used for GitHub social authentication. It is required for enabling users to log in using their GitHub accounts.
- Type:
SecretStr
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a valid OAuth2 client secret
The OAuth2 secret for GitHub social authentication. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- field subsystem_social_auth_google_oauth2_key: HeldBy(pods=frozenset({'api'}))] = SecretStr('**********')
The OAuth2 key for Google social authentication.
Masked by pydantic SecretStr. This setting provides the OAuth2 client ID used for Google social authentication. It is required for enabling users to log in using their Google accounts.
- Type:
SecretStr
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a valid OAuth2 client ID.
The OAuth2 key for Google social authentication. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- field subsystem_social_auth_google_oauth2_secret: HeldBy(pods=frozenset({'api'}))] = SecretStr('**********')
The OAuth2 secret for Google social authentication.
Masked by pydantic SecretStr. This setting provides the OAuth2 client secret used for Google social authentication. It is required for enabling users to log in using their Google accounts.
- Type:
SecretStr
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a valid OAuth2 client secret
The OAuth2 secret for Google social authentication. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- field subsystem_social_auth_linkedin_oauth2_key: HeldBy(pods=frozenset({'api'}))] = SecretStr('**********')
Deprecated since version 0.13.35.: This setting is deprecated and will be removed in a future release. LinkedIn social authentication is no longer supported or recommended for new deployments.
The OAuth2 key for LinkedIn social authentication. Masked by pydantic SecretStr. This setting provides the OAuth2 client ID used for LinkedIn social authentication. It was required for enabling users to log in using their LinkedIn accounts.
- Type:
SecretStr
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a valid OAuth2 client ID
The OAuth2 key for LinkedIn social authentication. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- field subsystem_social_auth_linkedin_oauth2_secret: HeldBy(pods=frozenset({'api'}))] = SecretStr('**********')
Deprecated since version 0.13.35.: This setting is deprecated and will be removed in a future release. LinkedIn social authentication is no longer supported or recommended for new deployments.
The OAuth2 secret for LinkedIn social authentication. Masked by pydantic SecretStr. This setting provides the OAuth2 client secret used for LinkedIn social authentication. It was required for enabling users to log in using their LinkedIn accounts.
- Type:
SecretStr
- Default:
not set, the
SET-ME-PLEASEplaceholder- Raises:
SmarterConfigurationError – If the value is not a valid OAuth2 client secret
The OAuth2 secret for LinkedIn social authentication. Masked by pydantic SecretStr.
- Constraints:
pods = frozenset({‘api’})
- Validated by:
- validator validate_account_manager_api_key » account_manager_api_key[source]
Validates the account_manager_api_key field.
- validator validate_github_token » github_token[source]
Validates the github_token field.
- validator validate_stripe_live_secret_key » stripe_live_secret_key[source]
Validates the stripe_live_secret_key field.
- Parameters:
v (
SecretStr|None) – The Stripe live secret key to validate.- Returns:
The validated Stripe live secret key.
- Return type:
SecretStr
- validator validate_stripe_test_secret_key » stripe_test_secret_key[source]
Validates the stripe_test_secret_key field.
- Parameters:
v (
SecretStr|None) – The Stripe test secret key to validate.- Returns:
The validated Stripe test secret key.
- Return type:
SecretStr
- validator validate_subsystem_slack_app_token » subsystem_slack_app_token[source]
Validates the slack_app_token field.
- validator validate_subsystem_slack_bot_token » subsystem_slack_bot_token[source]
Validates the slack_bot_token field.
- validator validate_subsystem_social_auth_github_key » subsystem_social_auth_github_key[source]
Validates the social_auth_github_key field.
- Parameters:
v (
SecretStr|None) – The GitHub OAuth2 key value to validate.- Returns:
The validated GitHub OAuth2 key.
- Return type:
SecretStr
- validator validate_subsystem_social_auth_github_secret » subsystem_social_auth_github_secret[source]
Validates the social_auth_github_secret field.
- Parameters:
v (
SecretStr|None) – The GitHub OAuth2 secret value to validate.- Returns:
The validated GitHub OAuth2 secret.
- Return type:
SecretStr
- validator validate_subsystem_social_auth_google_oauth2_key » subsystem_social_auth_google_oauth2_key[source]
Validates the social_auth_google_oauth2_key field.
- Parameters:
v (
SecretStr|None) – The Google OAuth2 key value to validate.- Returns:
The validated Google OAuth2 key.
- Return type:
SecretStr
- validator validate_subsystem_social_auth_google_oauth2_secret » subsystem_social_auth_google_oauth2_secret[source]
Validates the social_auth_google_oauth2_secret field.
- Parameters:
v (
SecretStr|None) – The Google OAuth2 secret value to validate.- Returns:
The validated Google OAuth2 secret.
- Return type:
SecretStr
- validator validate_subsystem_social_auth_linkedin_oauth2_key » subsystem_social_auth_linkedin_oauth2_key[source]
Validates the social_auth_linkedin_oauth2_key field.
- Parameters:
v (
SecretStr|None) – The LinkedIn OAuth2 key value to validate.- Returns:
The validated LinkedIn OAuth2 key.
- Return type:
SecretStr
- validator validate_subsystem_social_auth_linkedin_oauth2_secret » subsystem_social_auth_linkedin_oauth2_secret[source]
Validates the social_auth_linkedin_oauth2_secret field.
- Parameters:
v (
SecretStr|None) – The LinkedIn OAuth2 secret value to validate.- Returns:
The validated LinkedIn OAuth2 secret.
- Return type:
SecretStr
- pydantic model smarter.common.conf.settings.llm.LLMSettings[source]
LLM defaults, prompts, tools, plugins, extensions and the MCP server.
Show JSON schema
{ "title": "LLMSettings", "description": "LLM defaults, prompts, tools, plugins, extensions and the MCP server.", "type": "object", "properties": { "max_tool_rounds": { "default": 5, "description": "The most requests of one prompt that offer the LLM its tools.", "minimum": 1, "title": "Max Tool Rounds", "type": "integer" }, "prompt_history_max_age": { "default": 90, "description": "Days to keep chat sessions and their prompt history before they are deleted.", "minimum": 1, "title": "Prompt History Max Age", "type": "integer" }, "app_llmtool_plugin_max_data_results": { "default": 50, "description": "A global maximum number of data row results that can be returned by any Smarter plugin.", "exclusiveMinimum": 0, "title": "Plugin Max Data Results", "type": "integer" }, "app_llmtool_extension_registry_url": { "default": "https://smarter-sh.github.io/extensions-registry/index.json", "description": "The url of the Smarter Extension registry's signed index, index.json.", "examples": [ "https://smarter-sh.github.io/extensions-registry/index.json" ], "title": "Extension Registry URL", "type": "string" }, "app_llmtool_extension_registry_public_key": { "default": "", "description": "The base64 Ed25519 public key that verifies the extension registry's index. Empty disables the registry.", "title": "Extension Registry Public Key", "type": "string" }, "app_mcpserver_rate_limit": { "default": 1200, "description": "The maximum number of requests per minute that one client IP address may send to the MCPServer's endpoints. 0 disables the limit.", "minimum": 0, "title": "MCP Server Rate Limit", "type": "integer" }, "llm_default_provider": { "default": "openai", "description": "The default LLM provider to use for language model interactions.", "examples": [ "openai", "anthropic", "gemini", "llama" ], "title": "Default LLM Provider", "type": "string" }, "llm_default_model": { "default": "gpt-6-luna", "description": "The default model of the default LLM provider, for plugins whose manifests don't name one.", "examples": [ "gpt-6-luna" ], "title": "Default LLM Model", "type": "string" }, "llm_default_system_role": { "default": "You are a helpful llmclient. When given the opportunity to utilize function calling, you should always do so. This will allow you to provide the best possible responses to the user. If you are unable to provide a response, you should prompt the user for more information. If you are still unable to provide a response, you should inform the user that you are unable to help them at this time.", "description": "The default system role prompt to use for language model interactions.", "examples": [ "You are a helpful llmclient..." ], "title": "Default LLM System Role", "type": "string" }, "llm_default_temperature": { "default": 1.0, "description": "The default temperature to use for language model interactions.", "examples": [ 0.0, 0.5, 1.0 ], "title": "Default LLM Temperature", "type": "number" }, "llm_default_max_tokens": { "default": 2048, "description": "The default maximum number of tokens to generate for language model interactions.", "examples": [ 256, 512, 1024, 2048 ], "minimum": 1, "title": "Default LLM Max Tokens", "type": "integer" }, "prompt_threads": { "default": 32, "description": "The threads in each web server process that run streamed chat prompts.", "minimum": 1, "title": "Prompt Threads", "type": "integer" } } }
- Fields:
- Validators:
- field app_llmtool_extension_registry_public_key: str = ''
The Ed25519 public key, base64, that verifies the signature of the extension registry’s index.
It is public, not a secret. While it is empty, the registry is disabled: extensions can only be installed from uploaded archives, and updates are not checked. :type: str :default:
""The base64 Ed25519 public key that verifies the extension registry’s index. Empty disables the registry.
- field app_llmtool_extension_registry_url: str = 'https://smarter-sh.github.io/extensions-registry/index.json'
The url of the Smarter Extension registry’s index.
The registry lists the extensions that administrators may install from the Django admin console, their versions, and their publishers’ trust badges. The platform checks it daily for updates to installed extensions. Its signature, at the same url with
.sigappended, is verified withextension_registry_public_key. :type: str :default:"https://smarter-sh.github.io/extensions-registry/index.json"The url of the Smarter Extension registry’s signed index, index.json.
- Validated by:
- field app_llmtool_plugin_max_data_results: int = 50
A global maximum number of data row results that can be returned by any Smarter plugin.
This setting helps to prevent excessive data retrieval that could impact performance or lead to resource exhaustion. Plugins should respect this limit when querying data sources and returning results to ensure efficient operation of the platform. :type: int :default:
50:raises SmarterConfigurationError: If the value is not a positive integer.A global maximum number of data row results that can be returned by any Smarter plugin.
- Constraints:
gt = 0
- Validated by:
- field app_mcpserver_rate_limit: int = 1200
The maximum number of requests per minute that one client IP address may send to the MCPServer’s endpoints.
The MCPServer,
smarter.apps.mcpserver, serves its public tools without authentication, so the limit protects the platform’s database from a client that floods it. Requests beyond the limit are answered429 Too Many Requestsuntil the minute ends. The platform’s own MCPClients count too: they connect from the platform’s egress addresses, and each tool call is about three requests, so set the limit well above the platform’s own traffic. 0 disables the limit. :type: int :default:1200:raises SmarterConfigurationError: If the value is not a non-negative integer.The maximum number of requests per minute that one client IP address may send to the MCPServer’s endpoints. 0 disables the limit.
- Constraints:
ge = 0
- Validated by:
- field llm_default_max_tokens: int = 2048
The default maximum number of tokens to generate for language model interactions.
This setting specifies the upper limit on the number of tokens that the language model can generate in response to a single request. It helps control the length of the output and manage resource usage.
- Type:
- Default:
2048- Raises:
SmarterConfigurationError – If the value is not a positive integer.
The default maximum number of tokens to generate for language model interactions.
- Constraints:
ge = 1
- Validated by:
- field llm_default_model: str = 'gpt-6-luna'
The model of
llm_default_providerthat a plugin’s prompt uses when its manifest names none.- Type:
- Default:
"gpt-6-luna"- Raises:
SmarterConfigurationError – If the value is not a non-empty string.
The default model of the default LLM provider, for plugins whose manifests don’t name one.
- Validated by:
- field llm_default_provider: str = 'openai'
The default LLM provider to use for language model interactions.
This setting specifies which language model provider should be used by default for processing natural language tasks. It determines the backend service that will handle requests for language generation, understanding, and other related functions.
- Type:
- Default:
"openai"- Raises:
SmarterConfigurationError – If the value is not a valid LLM provider name
The default LLM provider to use for language model interactions.
- Validated by:
- field llm_default_system_role: str = 'You are a helpful llmclient. When given the opportunity to utilize function calling, you should always do so. This will allow you to provide the best possible responses to the user. If you are unable to provide a response, you should prompt the user for more information. If you are still unable to provide a response, you should inform the user that you are unable to help them at this time.'
The default system role prompt to use for language model interactions.
This setting provides the default system role prompt that guides the behavior of the language model during interactions. It helps define the context and tone of the responses generated by the model.
- Type:
- Default:
"You are a helpful llmclient. ...", which asks the LLM to call its tools- Raises:
SmarterConfigurationError – If the value is not a string.
The default system role prompt to use for language model interactions.
- Validated by:
- field llm_default_temperature: float = 1.0
The default temperature to use for language model interactions.
This setting controls the randomness of the language model’s output. A lower temperature (e.g., 0.0) results in more deterministic and focused responses, while a higher temperature (e.g., 1.0) produces more diverse and creative outputs.
- Type:
- Default:
1.0- Raises:
SmarterConfigurationError – If the value is not a float between 0.
The default temperature to use for language model interactions.
- Validated by:
- field max_tool_rounds: int = 5
The most requests of one prompt that offer the LLM its tools.
An LLM often needs more than one round of tool calls, e.g. a forecast, and then an image search with the forecast’s place, or a chain of MCP tool calls, each using the last one’s result. One round can hold several tool calls. After this many requests with tools, the LLM is sent the tool results without tools, so that it answers with what it has.
- Type:
- Default:
5
- Raises:
SmarterConfigurationError – If the value is not a positive integer.
The most requests of one prompt that offer the LLM its tools.
- Constraints:
ge = 1
- Validated by:
- field prompt_history_max_age: int = 90
Days to keep chat sessions and their prompt history before they are deleted.
Every prompt of a chat session (a
Prompt) saves aPromptHistoryrow with the request, the response and the conversation’s messages, plus aPromptToolCallorPromptPluginUsagerow for each tool or plugin it used. Celery Beat runspurge_prompt_history()once a day, which deletes these rows when they are older than this, then the sessions that are older than this and have none left. A session that is still in use keeps its recent rows.Set it with
SMARTER_PROMPT_HISTORY_MAX_AGE.- Type:
- Default:
90
- Raises:
SmarterConfigurationError – If the value is not a positive integer.
Days to keep chat sessions and their prompt history before they are deleted.
- Constraints:
ge = 1
- Validated by:
- field prompt_threads: int = 32
The threads in each web server process that run streamed chat prompts, at most.
A prompt holds its thread for as long as it runs, mostly waiting on the LLM and its tools, so the threads are cheap. A process runs this many prompts at once, and queues the next ones. The pool is the prompts’ own, apart from the event loop’s default executor, where Django renders error pages and asyncio resolves host names. See
smarter.apps.prompt.progress.prompt_executor().Set it with
SMARTER_PROMPT_THREADS.- Type:
- Default:
32 if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a positive integer.
The threads in each web server process that run streamed chat prompts.
- Constraints:
ge = 1
- Validated by:
- validator parse_app_llmtool_plugin_max_data_results » app_llmtool_plugin_max_data_results[source]
Validates the ‘plugin_max_data_results’ field.
- validator parse_app_mcpserver_rate_limit » app_mcpserver_rate_limit[source]
Validates the ‘mcpserver_rate_limit’ field.
- validator parse_max_tool_rounds » max_tool_rounds[source]
Validates the ‘max_tool_rounds’ field.
- validator parse_prompt_history_max_age » prompt_history_max_age[source]
Validates the ‘prompt_history_max_age’ field.
- validator parse_prompt_threads » prompt_threads[source]
Validates the ‘prompt_threads’ field.
- validator validate_app_llmtool_extension_registry_url » app_llmtool_extension_registry_url[source]
Validates the ‘extension_registry_url’ field: an https url, or the default if empty.
- validator validate_llm_default_model » llm_default_model[source]
Validates the llm_default_model field: the default if it is empty.
- validator validate_llm_default_provider » llm_default_provider[source]
Validates the llm_default_provider field.
- validator validate_llm_default_system_role » llm_default_system_role[source]
Validates the llm_default_system_role field.
- validator validate_openai_default_max_completion_tokens » llm_default_max_tokens[source]
Validates the llm_default_max_tokens field.
- pydantic model smarter.common.conf.settings.project.ProjectSettings[source]
Facts about the running software: versions, urls of the Smarter project, and paths.
Show JSON schema
{ "title": "ProjectSettings", "description": "Facts about the running software: versions, urls of the Smarter project, and paths.", "type": "object", "properties": {} }
- pydantic model smarter.common.conf.settings.security.SecuritySettings[source]
The superuser, encryption keys, trusted hosts and request throttling.
Show JSON schema
{ "title": "SecuritySettings", "description": "The superuser, encryption keys, trusted hosts and request throttling.", "type": "object", "properties": { "platform_admin_username": { "default": "admin", "description": "The username of the platform's superuser, which manage.py initialize_platform creates.", "examples": [ "admin" ], "title": "Administrator Username", "type": "string" }, "platform_admin_password": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "default": null, "description": "The password of the platform's superuser, which manage.py initialize_platform creates.", "examples": [ "your-admin-password" ], "title": "Administrator Password" }, "platform_fernet_encryption_key": { "description": "The Fernet encryption key used for encrypting Smarter Secrets data.", "examples": [ "gAAAAABh..." ], "format": "password", "title": "Fernet Encryption Key", "type": "string", "writeOnly": true }, "platform_internal_ip_prefixes": { "default": [ "192.168." ], "description": "A list of internal IP prefixes used for security and middleware features.", "examples": [ [ "192.168.", "10.0." ] ], "items": { "type": "string" }, "title": "Internal IP Prefixes", "type": "array" }, "DJANGO_SECRET_KEY": { "anyOf": [ { "format": "password", "type": "string", "writeOnly": true }, { "type": "null" } ], "description": "The Django secret key for cryptographic signing.", "examples": [ "your-django-secret-key" ], "title": "Django Secret Key" }, "app_api_throttle_rate_anon": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "120/minute", "description": "The request rate limit of each anonymous client, by IP address. None disables it.", "examples": [ "120/minute", "10/second", "none" ], "title": "Anonymous Throttle Rate" }, "app_api_throttle_rate_user": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": "600/minute", "description": "The request rate limit of each authenticated user. None disables it.", "examples": [ "600/minute", "20/second", "none" ], "title": "User Throttle Rate" } } }
- Fields:
- Validators:
- field app_api_throttle_rate_anon: str | None = '120/minute'
The request rate limit of each anonymous client, by IP address.
Applies to Django REST Framework views and to the apis that a deployed LLMClient serves, e.g. the prompt api of a page that embeds Smarter Chat. A client that exceeds it receives HTTP 429 Too Many Requests with a
Retry-Afterheader. Seesmarter.lib.drf.throttling.- Type:
Optional[str]
- Default:
"120/minute"- Raises:
SmarterConfigurationError – If the value is not a rate, e.g.
120/minute, ornone.
The request rate limit of each anonymous client, by IP address. None disables it.
- Validated by:
- field app_api_throttle_rate_user: str | None = '600/minute'
The request rate limit of each authenticated user.
Applies to Django REST Framework views and to the apis that a deployed LLMClient serves. A user who exceeds it receives HTTP 429 Too Many Requests with a
Retry-Afterheader. Seesmarter.lib.drf.throttling.- Type:
Optional[str]
- Default:
"600/minute"- Raises:
SmarterConfigurationError – If the value is not a rate, e.g.
600/minute, ornone.
The request rate limit of each authenticated user. None disables it.
- Validated by:
- field django_secret_key: HeldBy(pods=frozenset({'worker', 'worker-infrastructure', 'api', 'job-init'}))] [Optional]
The Django secret key for cryptographic signing.
This setting provides the secret key used by Django for cryptographic signing. It is essential for maintaining the security of sessions, cookies, and other cryptographic operations within the Django framework.
- Type:
Optional[str]
- Default:
a key that the process generates, with a warning: see
generated_django_secret_key()- Raises:
SmarterConfigurationError – If the value is not a string.
The Django secret key for cryptographic signing.
- Constraints:
pods = frozenset({‘worker’, ‘worker-infrastructure’, ‘api’, ‘job-init’})
- Validated by:
- field platform_admin_password: HeldBy(pods=frozenset({'job-init'}))] = None
The password of the platform’s superuser.
manage.py initialize_platformgives the superuser and the example users this password, unless--passwordgives another. Set it withSMARTER_PLATFORM_ADMIN_PASSWORD. Reading it from the environment keeps it off the command line, and out of the init Job’s log.- Type:
Optional[SecretStr]
- Default:
None if it is not set.
- Raises:
SmarterConfigurationError – If the value is not a SecretStr.
The password of the platform’s superuser, which manage.py initialize_platform creates.
- Constraints:
pods = frozenset({‘job-init’})
- Validated by:
- field platform_admin_username: str = 'admin'
The username of the platform’s superuser.
manage.py initialize_platformcreates this superuser, unless--usernamenames another. Set it withSMARTER_PLATFORM_ADMIN_USERNAME.- Type:
- Default:
adminif it is not set.- Raises:
SmarterConfigurationError – If the value is not a non-empty string.
The username of the platform’s superuser, which manage.py initialize_platform creates.
- Validated by:
- field platform_fernet_encryption_key: HeldBy(pods=frozenset({'worker', 'worker-infrastructure', 'api', 'job-init'}))] [Optional]
The Fernet encryption key used for encrypting Smarter Secrets data.
This setting provides the key used for symmetric encryption and decryption of sensitive data within the platform. The key should be a URL-safe base64-encoded 32-byte key.
- Type:
- Default:
a key that the process generates, with a warning: see
generated_fernet_encryption_key()- Raises:
SmarterConfigurationError – If the value is not a valid Fernet key.
The Fernet encryption key used for encrypting Smarter Secrets data.
- Constraints:
pods = frozenset({‘worker’, ‘worker-infrastructure’, ‘api’, ‘job-init’})
- Validated by:
- field platform_internal_ip_prefixes: List[str] = ['192.168.']
Supplemental list of internal IP prefixes used in smarter.apps.llmclient.middleware.security.SmarterSecurityMiddleware.
and smarter.lib.django.middleware security features.
The default value is based on the default internal IP range used by Kubernetes clusters by default unless otherwise configured.
A list of internal IP prefixes used for security and middleware features. This setting defines IP address prefixes that are considered internal to the platform. It is used to identify requests originating from trusted internal sources, enabling specific security measures and middleware behaviors.
- Type:
List[str]
- Default:
["192.168."]- Raises:
SmarterConfigurationError – If the value is not a list of strings
A list of internal IP prefixes used for security and middleware features.
- Validated by:
- validator validate_app_api_throttle_rate_anon » app_api_throttle_rate_anon[source]
Validates the throttle_rate_anon field.
- validator validate_app_api_throttle_rate_user » app_api_throttle_rate_user[source]
Validates the throttle_rate_user field.
- validator validate_platform_admin_password » platform_admin_password[source]
Validates the admin_password field.
- validator validate_platform_admin_username » platform_admin_username[source]
Validates the admin_username field.
- validator validate_platform_fernet_encryption_key » platform_fernet_encryption_key[source]
Validates the fernet_encryption_key field.
- Parameters:
v (
SecretStr|None) – The Fernet encryption key value to validate.- Raises:
ValueError – If the Fernet encryption key is invalid.
SmarterValueError – If the Fernet encryption key is not found.
- Returns:
The validated Fernet encryption key.
- Return type:
SecretStr|None
- validator validate_platform_internal_ip_prefixes » platform_internal_ip_prefixes[source]
Validates the internal_ip_prefixes field.
- validator validate_secret_key » django_secret_key[source]
Validates the django_secret_key field.
- Parameters:
v (
SecretStr|None) – The secret key value to validate.- Returns:
The validated secret key.
- Return type:
SecretStr
- pydantic model smarter.common.conf.settings.tasks.TaskSettings[source]
The Celery queues, retries and LLMClient deployment tasks.
Show JSON schema
{ "title": "TaskSettings", "description": "The Celery queues, retries and LLMClient deployment tasks.", "type": "object", "properties": { "app_llmclient_tasks_create_dns_record": { "default": true, "description": "True if DNS records should be created for llmclient tasks.", "title": "LLMClient Tasks Create DNS Record", "type": "boolean" }, "app_llmclient_tasks_create_ingress_manifest": { "default": true, "description": "True if ingress manifests should be created for llmclient tasks.", "title": "LLMClient Tasks Create Ingress Manifest", "type": "boolean" }, "app_llmclient_tasks_default_ttl": { "default": 600, "description": "Default TTL (time to live) for DNS records created in AWS Route53 during LLMClient deployment.", "minimum": 0, "title": "LLMClient Tasks Default TTL", "type": "integer" }, "app_llmclient_tasks_celery_max_retries": { "default": 3, "description": "Maximum number of retries for llmclient tasks in Celery.", "exclusiveMinimum": 0, "title": "LLMClient Tasks Celery Max Retries", "type": "integer" }, "app_llmclient_tasks_celery_retry_backoff": { "default": true, "description": "If True, enables exponential backoff for Celery task retries related to LLMClient deployment and management", "title": "LLMClient Tasks Celery Retry Backoff", "type": "boolean" }, "app_llmclient_tasks_celery_task_queue": { "default": "default_celery_task_queue", "description": "The Celery task queue name for llmclient tasks.", "title": "LLMClient Tasks Celery Task Queue", "type": "string" }, "app_infrastructure_tasks_celery_task_queue": { "default": "infrastructure_celery_task_queue", "description": "The Celery task queue name for infrastructure tasks, which deploy, verify and destroy cloud, Kubernetes and DNS resources.", "title": "Infrastructure Tasks Celery Task Queue", "type": "string" }, "app_tools_tasks_celery_task_queue": { "default": "tools_celery_task_queue", "description": "The Celery task queue name for LLM tool calls, which the tool worker, smarter-worker-tools, runs.", "title": "Tools Tasks Celery Task Queue", "type": "string" }, "app_extensions_tasks_celery_task_queue": { "default": "extensions_celery_task_queue", "description": "The Celery task queue name for Extensions' tool calls, which smarter-worker-extensions runs.", "title": "Extensions Tasks Celery Task Queue", "type": "string" }, "app_tools_worker_queue": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The queue that this tool worker consumes: the tools or the Extensions queue. Empty in every other process.", "title": "Tool Worker Queue" }, "app_llmtool_tool_runner": { "default": "in_process", "description": "Where LLM tool calls run: in_process, in the app's own process, or remote, in the tool worker, smarter-worker-tools, which holds no credentials.", "enum": [ "in_process", "remote" ], "title": "LLM Tool Runner", "type": "string" } } }
- Fields:
- Validators:
parse_app_llmclient_tasks_celery_max_retries»app_llmclient_tasks_celery_max_retriesparse_app_llmclient_tasks_celery_retry_backoff»app_llmclient_tasks_celery_retry_backoffparse_app_llmclient_tasks_create_dns_record»app_llmclient_tasks_create_dns_recordparse_app_llmclient_tasks_create_ingress_manifest»app_llmclient_tasks_create_ingress_manifestparse_app_llmclient_tasks_default_ttl»app_llmclient_tasks_default_ttlvalidate_app_extensions_tasks_celery_task_queue»app_extensions_tasks_celery_task_queuevalidate_app_infrastructure_tasks_celery_task_queue»app_infrastructure_tasks_celery_task_queuevalidate_app_llmclient_tasks_celery_task_queue»app_llmclient_tasks_celery_task_queuevalidate_app_tools_tasks_celery_task_queue»app_tools_tasks_celery_task_queue
- field app_extensions_tasks_celery_task_queue: str = 'extensions_celery_task_queue'
The Celery task queue name for Extensions’ tool calls, when
app_llmtool_tool_runnerisremote.The Extension worker,
smarter-worker-extensions, serves it, apart from the tool worker, which runs every other kind of tool call (issue #1077). An Extension is third-party code: in a worker of its own, each call in a process of its own, and with a Redis user that reaches only this queue, it can’t see the API, SQL and MCP calls’ credentials, neither in its process nor waiting in Redis. Its name doesn’t start withapp_tools_tasks_celery_task_queue’s, so that the tool worker’s Redis user, whose keys are that queue’s prefix, can’t read it either.- Type:
- Default:
"extensions_celery_task_queue"- Raises:
SmarterConfigurationError – If the value is not a string.
The Celery task queue name for Extensions’ tool calls, which smarter-worker-extensions runs.
- Validated by:
- field app_infrastructure_tasks_celery_task_queue: str = 'infrastructure_celery_task_queue'
The Celery task queue name for infrastructure tasks.
Infrastructure tasks deploy, verify and destroy cloud, Kubernetes and DNS resources, such as an LLMClient’s DNS record, ingress and certificate, an LLMHost’s node group, or a vectorstore’s database. They can take many minutes, so they run in their own queue, served by their own Celery worker, and never block the operational tasks of llmclient_tasks_celery_task_queue, such as prompt history, charges and budgets.
- Type:
- Default:
"infrastructure_celery_task_queue"- Raises:
SmarterConfigurationError – If the value is not a string.
The Celery task queue name for infrastructure tasks, which deploy, verify and destroy cloud, Kubernetes and DNS resources.
- Validated by:
- field app_llmclient_tasks_celery_max_retries: int = 3
Maximum number of retries for llmclient tasks in Celery.
- Type:
- Default:
3- Raises:
SmarterConfigurationError – If the value is not a non-negative integer.
Maximum number of retries for llmclient tasks in Celery.
- Constraints:
gt = 0
- Validated by:
- field app_llmclient_tasks_celery_retry_backoff: bool = True
If True, enables exponential backoff for Celery task retries related to LLMClient deployment and management.
- Type:
- Default:
True- Raises:
SmarterConfigurationError – If the value is not a boolean.
If True, enables exponential backoff for Celery task retries related to LLMClient deployment and management
- Validated by:
- field app_llmclient_tasks_celery_task_queue: str = 'default_celery_task_queue'
The Celery task queue name for llmclient tasks.
- Type:
- Default:
"default_celery_task_queue"- Raises:
SmarterConfigurationError – If the value is not a string.
The Celery task queue name for llmclient tasks.
- Validated by:
- field app_llmclient_tasks_create_dns_record: bool = True
Set these to true if we DO NOT place a wildcard A record in the customer API domain.
requiring that every llmclient have its own A record. This is the default behavior. For programmatically creating DNS records in AWS Route53 during LLMClient deployment.
- Type:
- Default:
True- Raises:
SmarterConfigurationError – If the value is not a boolean.
True if DNS records should be created for llmclient tasks.
- Validated by:
- field app_llmclient_tasks_create_ingress_manifest: bool = True
True if ingress manifests should be created for llmclient tasks.
For programmatically creating ingress manifests during LLMClient deployment. :type: bool :default:
True:raises SmarterConfigurationError: If the value is not a boolean.True if ingress manifests should be created for llmclient tasks.
- Validated by:
- field app_llmclient_tasks_default_ttl: int = 600
Default TTL (time to live) for DNS records created in AWS Route53 during LLMClient deployment.
- Type:
- Default:
600- Raises:
SmarterConfigurationError – If the value is not a non-negative integer.
Default TTL (time to live) for DNS records created in AWS Route53 during LLMClient deployment.
- Constraints:
ge = 0
- Validated by:
- field app_llmtool_tool_runner: Literal['in_process', 'remote'] = 'in_process'
Where LLM tool calls run.
in_process, the default: in the process that handles the chat, as they always have.remote: in the tool worker,smarter-worker-tools, through the Celery queueapp_tools_tasks_celery_task_queue. The worker holds no database, no Smarter Secret and no cloud credential: each call brings what it needs (ADR-038). The worker must be running.
Set it with
SMARTER_APP_LLMTOOL_TOOL_RUNNER. Seesmarter.apps.llmtool.runner.- Type:
- Default:
"in_process"
Where LLM tool calls run: in_process, in the app’s own process, or remote, in the tool worker, smarter-worker-tools, which holds no credentials.
- field app_tools_tasks_celery_task_queue: str = 'tools_celery_task_queue'
The Celery task queue name for LLM tool calls, when
app_llmtool_tool_runnerisremote.The tool worker,
smarter-worker-tools, serves it: it runs each tool call without the database or the platform’s credentials (ADR-038). Seesmarter.apps.llmtool.runner.- Type:
- Default:
"tools_celery_task_queue"- Raises:
SmarterConfigurationError – If the value is not a string.
The Celery task queue name for LLM tool calls, which the tool worker, smarter-worker-tools, runs.
- Validated by:
- field app_tools_worker_queue: str | None = None
The queue that this tool worker consumes, set in the tool worker and in the Extension worker only.
Both are workers without a database (
database_unavailable), and they differ only by their queue. Each keeps kombu’s in-flight messages under its queue’s name (CELERY_BROKER_TRANSPORT_OPTIONS), checks that its Redis user reaches that queue and no other, runs only that queue’s kind of tool call, and names it in the line that ends its startup checks. Empty, a worker without a database is the tool worker. Seetool_worker_queue.Set it with
SMARTER_APP_TOOLS_WORKER_QUEUE.- Type:
Optional[str]
- Default:
None
The queue that this tool worker consumes: the tools or the Extensions queue. Empty in every other process.
- Validated by:
- validator parse_app_llmclient_tasks_celery_max_retries » app_llmclient_tasks_celery_max_retries[source]
Validates the ‘llmclient_tasks_celery_max_retries’ field.
- validator parse_app_llmclient_tasks_celery_retry_backoff » app_llmclient_tasks_celery_retry_backoff[source]
Validates the ‘llmclient_tasks_celery_retry_backoff’ field.
- validator parse_app_llmclient_tasks_create_dns_record » app_llmclient_tasks_create_dns_record[source]
Validates the ‘llmclient_tasks_create_dns_record’ field.
- validator parse_app_llmclient_tasks_create_ingress_manifest » app_llmclient_tasks_create_ingress_manifest[source]
Validates the ‘llmclient_tasks_create_ingress_manifest’ field.
- validator parse_app_llmclient_tasks_default_ttl » app_llmclient_tasks_default_ttl[source]
Validates the ‘llmclient_tasks_default_ttl’ field.
- validator validate_app_extensions_tasks_celery_task_queue » app_extensions_tasks_celery_task_queue[source]
Validate
app_extensions_tasks_celery_task_queue.
- validator validate_app_infrastructure_tasks_celery_task_queue » app_infrastructure_tasks_celery_task_queue[source]
Validates the infrastructure_tasks_celery_task_queue field.
- validator validate_app_llmclient_tasks_celery_task_queue » app_llmclient_tasks_celery_task_queue[source]
Validates the llmclient_tasks_celery_task_queue field.
- validator validate_app_tools_tasks_celery_task_queue » app_tools_tasks_celery_task_queue[source]
Validate
app_tools_tasks_celery_task_queue.
Helpers
Utility functions for settings.
The field validators of the Settings use these, so that the same rule is written once.
- smarter.common.conf.util.THROTTLE_RATE_DISABLED = ('none', 'off', 'disabled')
The values that disable a throttle.
('none', 'off', 'disabled')
- smarter.common.conf.util.THROTTLE_RATE_PATTERN: Pattern = re.compile('^\\d+/(s|sec|second|m|min|minute|h|hour|d|day)$')
requests per second, minute, hour or day.
- Type:
A Django REST Framework throttle rate
- smarter.common.conf.util.before_field_validator(*args, **kwargs)[source]
Wrapper for pydantic field_validator with mode=’before’.
- smarter.common.conf.util.comma_separated(v)[source]
Split a comma-separated string into a list, e.g.
"a, b,"into["a", "b"].A list setting’s environment variable is a comma-separated string. Any other value is returned as it is, for its validator to judge.
- smarter.common.conf.util.field_default(model, field_name)[source]
Return a settings field’s default, as its declaration states it.
The validators use it for a value that is empty, e.g.
""passed to the constructor, so that a default is written once, on its field.- Parameters:
- Return type:
- Returns:
Its default, whose type is the field’s. A default that a factory makes is made.
- smarter.common.conf.util.input_value(model, data, field_name)[source]
Return the value that a field will be validated from: the one given, or else its default.
- Parameters:
- Return type:
- Returns:
Its value, not yet validated, which may be of any type the field accepts.
- smarter.common.conf.util.is_unset(data, field_name)[source]
Return True if the values to validate leave a field out, or set it to an empty value.
- smarter.common.conf.util.parse_int_setting(field_name, v, default, minimum=None, maximum=None)[source]
Parse an integer setting, e.g.
"300"from an environment variable.An empty value, or the placeholder of a missing one, is replaced by
default, which is parsed and checked like any other value.- Parameters:
field_name (
str) – The name of the field, for the error message.v (
object) – The value to parse: an int, or a string of one.default (
object) – The value to use ifvis empty.minimum (
int|None) – The smallest value allowed, or None for no lower bound.maximum (
int|None) – The largest value allowed, or None for no upper bound.
- Return type:
- Returns:
The value, as an int.
- Raises:
SmarterConfigurationError – If the value isn’t an integer, or is out of bounds.
- smarter.common.conf.util.validate_throttle_rate(field_name, v, default)[source]
Validate a Django REST Framework throttle rate.
- Parameters:
- Return type:
- Returns:
The rate, or None if the throttle is disabled.
- Raises:
SmarterConfigurationError – If the value is not a rate.
- smarter.common.conf.util.with_derived_default(data, field_name, value)[source]
Return the values to validate, with a derived default for a field that they leave unset.
A default that depends on another field, e.g. an address at the platform’s domain, can’t be written on its field. A
mode="before"model validator computes it instead, and passes it here.
Which settings are credentials, and which kinds of pod may hold each one (ADR-038, phase 3).
Every pod used to read one Secret with every credential, though most use few of them. Each credential now says
which kinds of pod (SERVICE_TYPE, smarter.common.const.SmarterKubernetesPodKinds.all) use it, with HeldBy in its annotation:
github_token: Annotated[Optional[SecretStr], HeldBy(SmarterKubernetesPodKinds.API, SmarterKubernetesPodKinds.WORKER)] = Field(...)
Every setting whose type is
SecretStris a credential, and must say who holds it, even nobody (HeldBy()): a test fails otherwise. Deriving the credentials from the type, rather than marking each one, means that a newSecretStrsetting can’t be left out.The Helm chart gives each pod only its own credentials, from
helm/charts/smarter/files/credentials.json, whichcredential_holders_by_variable()writes (make chart-credentials).When a pod starts,
smarter.common.conf.settings.Settings.check_pod_credentials()reports each credential it was given but doesn’t use (forbidden_credentials()). The tool worker and the Extension worker, which run code that the platform doesn’t control (ADR-038, issue #1077), refuse to start instead (check_restricted_worker_credentials()): they hold no credential but their own Redis user’s password.The converse holds too (ADR-007, “Sensitive values”): a setting whose name or value says it is a credential is a
SecretStr, whichmisdeclared_credentials()checks, so that a credential added asstrcan’t be printed in full by the settings dump.
- smarter.common.conf.credentials.CHART_CREDENTIALS_PATH = '/Users/mcdaniel/Desktop/gh/smarter-sh/smarter/smarter/smarter/common/conf/credentials.json'
The committed map of each credential’s environment variables to the kinds of pod that hold it.
manage.py export_chart_credentialswrites it, andmake chart-credentialscopies it to the Helm chart, ashelm/charts/smarter/files/credentials.json, which the chart reads to build each pod’s Secret. A test fails when it doesn’t match the settings, and the chart’s tests when the chart’s copy doesn’t match it.
- smarter.common.conf.credentials.CREDENTIAL_NAME_WORDS = frozenset({'credential', 'credentials', 'dsn', 'passwd', 'password', 'secret', 'token'})
The words of a setting’s name, split at underscores, that say it is a credential, e.g.
subsystem_smtp_password.
- smarter.common.conf.credentials.ENVIRONMENT_PREFIX = 'SMARTER_'
The prefix of a setting’s environment variable, as
Settings.model_config’senv_prefix.
- class smarter.common.conf.credentials.HeldBy(*pods)[source]
Marks a credential with the kinds of pod that may hold it.
- Parameters:
pods (
str) – The kinds of pod, fromsmarter.common.const.SmarterKubernetesPodKinds.all. None: no pod uses the credential, e.g. a setting that nothing reads yet.
- smarter.common.conf.credentials.NOT_CREDENTIALS: dict[str, str] = {'app_llmtool_extension_registry_public_key': "the Ed25519 public key that verifies the registry's index: public"}
The settings whose name says credential but which aren’t, each with the reason.
Keep it short.
{ 'app_llmtool_extension_registry_public_key': "the Ed25519 public key that verifies the registry's index: public", }
- smarter.common.conf.credentials.credential_holders(field)[source]
Return the kinds of pod that may hold a credential, from the
HeldByin its annotation.
- smarter.common.conf.credentials.credential_holders_by_variable(settings_class)[source]
Map each credential’s environment variables to the kinds of pod that may hold it: what the Helm chart reads.
make chart-credentialswrites it tohelm/charts/smarter/files/credentials.json, and a test fails when that file is out of date. The chart gives each pod’s Secret only the variables that name its kind.
- smarter.common.conf.credentials.embeds_password(value)[source]
Return whether a setting’s value is a url with a password in it, e.g.
redis://user:password@host:6379.
- smarter.common.conf.credentials.environment_variables(name, field)[source]
Return the environment variables that a setting is read from: its
validation_alias, orSMARTER_<NAME>.
- smarter.common.conf.credentials.forbidden_credentials(settings, environ, pod_kind='worker-tools')[source]
Return the names of the credentials that a kind of pod was given, but doesn’t use.
A credential counts only if the process’s environment sets one of its variables to a value. A value that the settings derive themselves, e.g. a generated Fernet key or the local environment’s default database password, is not one that the worker was given, and doesn’t count. Names only: never a value.
- smarter.common.conf.credentials.holds_text(field)[source]
Return whether a setting’s value can be plain text: its type is
str, or a union withstr.A credential is text, so a
boolor anintnamed like one, e.g.app_secret_enable, the switch of the Secret resource’s app, isn’t one.- Parameters:
field (
FieldInfo) – The setting’s field.- Return type:
- Returns:
True if the value can be a
str.
- smarter.common.conf.credentials.is_credential(field)[source]
Return whether a setting is a credential: its type is
SecretStr, orOptional[SecretStr].- Parameters:
field (
FieldInfo) – The setting’s field.- Return type:
- Returns:
True for a credential.
- smarter.common.conf.credentials.is_given(environ, variables)[source]
Return whether the environment sets one of a credential’s variables to a value, not empty and not a placeholder.
- smarter.common.conf.credentials.is_named_like_a_credential(name)[source]
Return whether a setting’s name says it is a credential (ADR-007, “Sensitive values”).
A name says so when one of its words is in
CREDENTIAL_NAME_WORDS, or when it ends with_key, e.g.django_secret_key,account_manager_api_keyoraws_secret_access_key. Whole words only, so thatllm_default_max_tokensandbootstrap_secrets_dirdon’t count.
- smarter.common.conf.credentials.may_hold(field, pod_kind)[source]
Return whether a kind of pod may hold a credential.
A credential that doesn’t say may be held by none.
- smarter.common.conf.credentials.misdeclared_credentials(settings_class, settings=None)[source]
Return the settings that should be a
SecretStrbut aren’t (ADR-007, “Sensitive values”).A
SecretStris masked inrepr(), in the settings dump and in a validation error, so a credential declared asstrwould be logged in full. A setting should be one when:its name says credential (
is_named_like_a_credential()), its type can be text (holds_text()), and it isn’t inNOT_CREDENTIALS; orits default, or its value in
settings, is a url that embeds a password (embeds_password()).
- Parameters:
settings_class (
type[BaseModel]) – The settings’ class, e.g.smarter.common.conf.Settings.settings (
BaseModel|None) – An instance whose values are checked for urls with passwords too, or None for the defaults only.
- Return type:
- Returns:
The names of the settings, sorted.
- smarter.common.conf.credentials.render_chart_credentials(settings_class)[source]
Return the text of
CHART_CREDENTIALS_PATH:credential_holders_by_variable(), as JSON.- Parameters:
settings_class (
type[BaseModel]) – The settings’ class,smarter.common.conf.settings.Settings.- Return type:
- Returns:
The JSON, indented, with a trailing newline, so that a change is a readable diff.
- smarter.common.conf.credentials.restricted_workers_may_hold(field)[source]
Return whether the tool worker and the Extension worker may hold a credential: their own Redis user’s password.
- Parameters:
field (
FieldInfo) – The setting’s field.- Return type:
- Returns:
True if both may.
- smarter.common.conf.credentials.write_chart_credentials(settings_class, path='/Users/mcdaniel/Desktop/gh/smarter-sh/smarter/smarter/smarter/common/conf/credentials.json')[source]
Write
render_chart_credentials()to a file.- Parameters:
settings_class (
type[BaseModel]) – The settings’ class.path (
str) – The file,CHART_CREDENTIALS_PATHby default.
- Return type:
- Returns:
The file’s path.
The environment
This module contains constants used for Pydantic Settings.
- smarter.common.conf.const.DEFAULT_MISSING_VALUE = 'SET-ME-PLEASE'
The placeholder of a setting that is not set, e.g. in
.env.example.
- smarter.common.conf.const.DOT_ENV_LOADED = True
True if .env file was loaded successfully.
- smarter.common.conf.const.LOCAL_HOSTS = ['localhost', '127.0.0.1', 'localhost:9357', '127.0.0.1:9357', 'localhost:5173', 'testserver']
the dev server, the React dev server, Django’s test client.
[ 'localhost', '127.0.0.1', 'localhost:9357', '127.0.0.1:9357', 'localhost:5173', 'testserver', ]
- Type:
The hosts of a developer’s own machine, which are always local
- smarter.common.conf.const.SENSITIVE_FILES_AMNESTY_PATTERNS = (re.compile('^/$', re.IGNORECASE), re.compile('^/static(/.*)?$', re.IGNORECASE), re.compile('^/api/v\\d+(\\.\\d+)?/.+', re.IGNORECASE), re.compile('^/api/web/.+', re.IGNORECASE), re.compile('^/dashboard(/.*)?$', re.IGNORECASE), re.compile('^/docs/manifest(/.*)?$', re.IGNORECASE), re.compile('^/docs/json-schema(/.*)?$', re.IGNORECASE), re.compile('^/config/?$', re.IGNORECASE), re.compile('^/login/?$', re.IGNORECASE), re.compile('^/admin/?$', re.IGNORECASE))
The paths that the sensitive files middleware never blocks, even when they end like a sensitive file, a.
static set that no setting changes: the home page, static files,.
the apis, the dashboard, the manifest and JSON Schema docs, an LLMClient’s
/config/, the sign-in page and the admin.( re.compile('^/$', re.IGNORECASE), re.compile('^/static(/.*)?$', re.IGNORECASE), re.compile('^/api/v\\d+(\\.\\d+)?/.+', re.IGNORECASE), re.compile('^/api/web/.+', re.IGNORECASE), re.compile('^/dashboard(/.*)?$', re.IGNORECASE), re.compile('^/docs/manifest(/.*)?$', re.IGNORECASE), re.compile('^/docs/json-schema(/.*)?$', re.IGNORECASE), re.compile('^/config/?$', re.IGNORECASE), re.compile('^/login/?$', re.IGNORECASE), re.compile('^/admin/?$', re.IGNORECASE), )
- smarter.common.conf.const.SERVICE_TYPE = None
The kind of pod this process runs in, unvalidated, from the
SERVICE_TYPEenvironment variable.Read the validated value,
smarter_settings.service_type, instead: its docstring, andsmarter.common.const.SmarterKubernetesPodKinds, list the kinds that the Helm chart and docker-compose set.
Smarter common environment variable utilities.
- smarter.common.conf.env.EnvValueType = str | bool | int | float | list[str] | dict[str, typing.Any] | None
The types of value that
get_env()returns.Which one is determined by the type of its
default.
- smarter.common.conf.env.cast_environment_value(var_name, val, default)[source]
Cast an environment variable’s value to the type of a default value.
A string stays a string, and
true,1,t,yoryesis a True bool. An int or a float is parsed, a list is split on commas, and a dict is parsed as JSON. A value that can’t be cast is logged, without the value, and replaced by the default.
- smarter.common.conf.env.get_env(var_name, default='SET-ME-PLEASE', is_secret=False, is_required=False)[source]
Retrieve a configuration value from the environment, with prefix fallback and type conversion.
- Overloads:
var_name (str), default (bool), is_secret (bool), is_required (bool) → bool
var_name (str), default (int), is_secret (bool), is_required (bool) → int
var_name (str), default (float), is_secret (bool), is_required (bool) → float
var_name (str), default (list[str]), is_secret (bool), is_required (bool) → list[str]
var_name (str), default (SmarterDictType), is_secret (bool), is_required (bool) → SmarterDictType
var_name (str), default (None), is_secret (bool), is_required (bool) → Optional[str]
var_name (str), default (str), is_secret (bool), is_required (bool) → str
This function attempts to obtain a configuration value from the environment using the key
<var_name>. If the environment variable is not set, it returns the provideddefaultvalue. The function also performs type conversion and validation based on the type of the default value, supporting strings, booleans, integers, floats, lists (comma-separated), and dictionaries (JSON-encoded).Behavior:
Checks for the presence of the environment variable
<var_name>.If found, attempts to convert the value to the type of
default.If not found, or if it holds the
SET-ME-PLEASEplaceholder, returns thedefaultvalue.Logs a message if the environment variable is missing or if type conversion fails.
This utility is used throughout the Smarter platform to provide a consistent and robust mechanism for loading configuration values from the environment, with sensible type handling and error reporting.
- Parameters:
- Returns:
The value from the environment (converted to the appropriate type), or the default if it is not set, holds the
SET-ME-PLEASEplaceholder, or cannot be converted. Only adefaultof None returns None.- Return type:
- smarter.common.conf.env.is_missing_value(value)[source]
Return True if a configuration value is missing.
A value is missing if it is None, empty, or a placeholder, such as
.env.example’sSET-ME-PLEASEorhelm/charts/smarter/values.yaml’sSET-ME-IN-helm/.... Apydantic.SecretStris unwrapped first.