Deployment and upgradesOfficial documentation15 min readDeployment and upgrades

Set Up FastGPT Shared Environment Variables

Shared environment variables for self-hosted FastGPT deployments control core platform behaviors, including feature flags, resource limits, and operationa…

Overview

Shared environment variables for self-hosted FastGPT deployments control core platform behaviors, including feature flags, resource limits, and operational concurrency. These values are configured via the platform’s root .env file, and changes require a service restart to take effect. All variables include documented default values and, where applicable, valid range constraints to prevent misconfiguration.

Full Environment Variable Reference

VariableDefaultDescription
AGENT_ENGINEfastAgentAgent engine. Supported values are fastAgent and piAgent.
SKIP_FILE_TYPE_CHECKfalseWhether upload file type checks are skipped.
WECHAT_CHANNEL_CONCURRENCY1000WeChat channel poll worker concurrency. Minimum value is 10.
PARSE_FILE_WORKERS5Resident file parsing worker count.
HTML_TO_MARKDOWN_WORKERS10Resident HTML-to-Markdown worker count.
TEXT_TO_CHUNKS_WORKERS10Resident text chunking worker count.
PARSE_FILE_TIMEOUT_SECONDS600Timeout for one file parsing task, in seconds.
WORKFLOW_MAX_RUN_TIMES500Maximum workflow run count to avoid extreme infinite loops.
WORKFLOW_MAX_LOOP_TIMES100Maximum input array length for loop and parallel nodes.
WORKFLOW_PARALLEL_MAX_CONCURRENCY10Parallel node concurrency limit. It must not exceed WORKFLOW_MAX_LOOP_TIMES.
SYSTEM_MAX_STRING_LENGTH_M100Maximum character length for synchronous system string operations such as variable replacement, in M characters. 1 means 1,000,000 characters. Valid range: 1 to 100.
CHAT_MAX_QPM5000Chat QPM limit. User plan limits take precedence when configured.
SERVICE_REQUEST_MAX_CONTENT_LENGTH10Maximum request body size accepted by the service, in MB.
MAX_FOLDER_DEPTH4Maximum folder depth. The default allows up to 4 folder levels under the root. Valid range: 2 to 20.
APP_FOLDER_MAX_AMOUNT1000Maximum number of App folders.
DATASET_FOLDER_MAX_AMOUNT1000Maximum number of Collection folders.
UPLOAD_FILE_MAX_SIZE1000Maximum upload file size, in MB.
UPLOAD_FILE_MAX_AMOUNT1000Maximum upload file count.
LLM_REQUEST_TRACKING_RETENTION_HOURS6LLM request tracking retention, in hours.
MAX_HTML_TRANSFORM_CHARS1000000Maximum number of characters for HTML-to-Markdown

Configuration Steps

  1. Navigate to the root directory of your self-hosted FastGPT deployment.
  2. Open the .env file in a text editor.
  3. Locate the target variable, or add it if missing, using the format VARIABLE_NAME=value.
  4. Save the .env file and restart all FastGPT services to apply the new configuration.

Note that some variables have mandatory minimum or range constraints; for example, WECHAT_CHANNEL_CONCURRENCY cannot be set lower than 10, and MAX_FOLDER_DEPTH must be between 2 and 20.

Key Usage Constraints

Several variables have interdependent rules to ensure platform stability:

  • WORKFLOW_PARALLEL_MAX_CONCURRENCY must not exceed WORKFLOW_MAX_LOOP_TIMES to avoid resource oversubscription.
  • User-specific plan limits will override the global CHAT_MAX_QPM value if configured.
  • The SYSTEM_MAX_STRING_LENGTH_M unit is 1,000,000 characters per unit, so a value of 1 equals 1,000,000 total characters.

Source: FastGPT official source

Applicability and version scope

Use this page for the documented Deployment and upgrades scenario. Confirm the FastGPT, dependency, API, and deployment versions in the official source before applying a change.

Safety guardrails

Use [REDACTED_CREDENTIAL] for credentials and private data. Confirm the documented environment and version before review.

Rollback guidance

Restore the prior technical-content authority snapshot. Restore saved configuration and data snapshots, then repeat the smallest verification scenario.