Back to Fastgpt

Environment Variables

document/content/self-host/config/env.en.mdx

4.15.554.1 KB
Original Source

This page describes the environment variables commonly used in a self-hosted FastGPT deployment. projects/app and pro/admin both reuse many settings from packages/service/env.ts, so database, secret, object storage, vector database, and service-level variables are documented together. Variables that are only read by projects/app or pro/admin are listed separately.

Notes

  • projects/app: the main Next.js application, including pages, API routes, workflows, Knowledge Bases, object storage, and vector storage.
  • pro/admin: the commercial Admin service. Besides its own Admin variables, it also reuses App/Service settings such as database, secrets, object storage, models, and logging.
  • projects/code-sandbox: the code execution sandbox service. It exposes the /sandbox endpoint and is called by App through CODE_SANDBOX_URL.
  • packages/service/env.ts exports serviceEnv; projects/app/src/env.ts exports appEnv.
  • Shared App/Admin boolean variables use true, 1, yes, or y to enable a feature. Other values are treated as disabled.
  • FILE_TOKEN_KEY, AES256_SECRET_KEY, and INVOKE_TOKEN_SECRET are required at runtime. Use strong random secrets and do not use the example values in production.

Shared App/Admin Variables

These variables are mainly validated by packages/service/env.ts and apply to projects/app and to pro/admin when it imports @fastgpt/service. A few App-side switches are still defined in packages/service/env.ts; they are also called out in the App-specific section below.

Basics and Secrets

VariableDefaultDescription
DB_MAX_LINK5Maximum connection pool size for MongoDB, PG, OceanBase, openGauss, and other databases.
SYNC_INDEXtrueWhether to create missing MongoDB indexes and remove explicitly declared deprecated indexes at startup. Maintain indexes manually when disabled.
FILE_TOKEN_KEYNone, requiredSecret for file read and file authorization flows. Must be at least 6 characters.
AES256_SECRET_KEYNone, requiredSecret used by AES encryption and decryption. Must be at least 6 characters.
INVOKE_TOKEN_SECRETNone, requiredJWT secret for Invoke reverse calls. Must be at least 32 characters.
ROOT_KEYfastgpt_root_keyAdmin API key for the current system. It can call /api/admin/** APIs and must be at least 6 characters.
PRO_TOKENEmptyToken for FastGPT app server calls to pro/admin internal APIs. It must match the pro/admin configuration and is required when App configures PRO_URL.
PRO_URLEmptyCommercial service URL. When set, App can call Pro APIs, and the domain is allowed by file URL validation.

Service URLs and Integrations

VariableDefaultDescription
PLUGIN_BASE_URLhttp://localhost:3004FastGPT Plugin service URL. Deployment templates usually set this to the internal Plugin service URL.
PLUGIN_TOKENtokenAuthentication token for calling the Plugin service. It must match the Plugin service configuration.
CODE_SANDBOX_URLhttp://localhost:3002Code Sandbox service URL. Deployment templates usually set this to the internal Code Sandbox service URL.
CODE_SANDBOX_TOKENcodesandboxToken used by App when calling Code Sandbox. It must match the sandbox service SANDBOX_TOKEN.
AIPROXY_API_ENDPOINTEmptyAI Proxy service URL. When configured, model requests prefer AI Proxy.
AIPROXY_API_TOKENEmptyToken for calling AI Proxy.
OPENAI_BASE_URLhttps://api.openai.com/v1Default OpenAI-compatible model endpoint when AI Proxy is not configured.
CHAT_API_KEYEmptyDefault OpenAI-compatible model API key when AI Proxy token is not configured.
CRM_API_URLEmptyLead attribution CRM API base URL (including /api/v1). Empty disables identity reporting.
CRM_API_KEYEmptyCRM admin API key used to bind a FastGPT user to visitor_id after registration or login.
MARKETPLACE_URLhttps://v2.marketplace.fastgpt.cnPlugin marketplace API URL.
FEISHU_BASE_URLhttps://open.feishu.cnLark Open Platform URL. Use your private Lark domain when self-hosting Lark.
DINGTALK_BASE_URLhttps://api.dingtalk.comDingTalk new API base URL.
DINGTALK_OAPI_BASE_URLhttps://oapi.dingtalk.comDingTalk OAPI base URL.
YUQUE_DATASET_BASE_URLhttps://www.yuque.comYuque Knowledge Base URL.

Agent Sandbox

VariableDefaultDescription
AGENT_SANDBOX_PROVIDEREmptyAgent sandbox provider. Supported values are sealosdevbox, opensandbox, and e2b. Empty disables sandbox. Once set, the matching provider required env vars, AGENT_SANDBOX_PROXY_SECRET, and AGENT_SANDBOX_PROXY_URL must also be configured, otherwise service startup fails.
AGENT_SANDBOX_E2B_API_KEYEmptyE2B sandbox API key.
AGENT_SANDBOX_SEALOS_BASEURLEmptySealos Devbox service URL.
AGENT_SANDBOX_SEALOS_TOKENEmptySealos Devbox access token.
AGENT_SANDBOX_SEALOS_WORK_DIRECTORY/home/devbox/workspaceWorking directory inside the Sealos Devbox sandbox.
AGENT_SANDBOX_SEALOS_IMAGEEmptyRuntime image used by Sealos Devbox. Required when sealosdevbox is enabled.
AGENT_SANDBOX_OPENSANDBOX_BASEURLEmptyOpenSandbox service URL.
AGENT_SANDBOX_OPENSANDBOX_API_KEYEmptyOpenSandbox API key. Required when OpenSandbox is enabled, and must match OpenSandbox server [server].api_key.
AGENT_SANDBOX_OPENSANDBOX_RUNTIMEdockerOpenSandbox runtime, either docker or kubernetes.
AGENT_SANDBOX_OPENSANDBOX_IMAGE_REPOfastgpt-agent-sandboxImage repository used by OpenSandbox.
AGENT_SANDBOX_OPENSANDBOX_IMAGE_TAGlatestImage tag used by OpenSandbox.
AGENT_SANDBOX_OPENSANDBOX_USE_SERVER_PROXYtrueWhether OpenSandbox access goes through the server proxy.
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_URLEmptyRequired in OpenSandbox mode. Volume Manager service URL.
AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKENEmptyRequired in OpenSandbox mode. Volume Manager authentication token.
AGENT_SANDBOX_PROXY_SECRETEmptyShared HMAC secret for the app and agent-sandbox-proxy. Required when Agent Sandbox is enabled; must be at least 32 bytes.
AGENT_SANDBOX_PROXY_URLEmptyBrowser-accessible WebSocket URL for agent-sandbox-proxy. Must start with ws:// or wss://.
AGENT_SANDBOX_FREE_TIPfalseWhether the frontend shows the Agent Sandbox free-use hint.
AGENT_SANDBOX_DISK_MB1024Agent Sandbox disk-size baseline, in MB. Cold archive packages use the full value; Skill packages and IDE single-file operations use half the value, rounded to the nearest MB.
AGENT_SANDBOX_MAX_EDIT_DEBUG100Limit for Agent edit/debug sandboxes.
AGENT_SANDBOX_NPM_REGISTRYEmptynpm registry used by npm, yarn, pnpm, and bun inside Agent sandboxes.
AGENT_SANDBOX_PYPI_INDEX_URLEmptyPyPI index URL used by pip, python -m pip, and uv inside Agent sandboxes.

Databases, Cache, and Vector Stores

VariableDefaultDescription
REDIS_URLredis://default:mypassword@localhost:6379Redis connection URL.
STREAM_RESUME_TTL_SECONDS300TTL for an active stream resume mirror, in seconds.
STREAM_RESUME_POST_COMPLETE_TTL_SECONDS30Shortened TTL after a stream completes, in seconds.
STREAM_RESUME_REDIS_MAXMEMORY_RATIO0.5When Redis used memory divided by maxmemory reaches this ratio, new stream resume mirrors are skipped.
STREAM_RESUME_REDIS_MEMORY_CHECK_INTERVAL_MS5000Redis memory watermark cache duration, in milliseconds.
MONGODB_URILocal MongoDB example URLMain business MongoDB connection URL.
MONGODB_LOG_URISame example as MONGODB_URIMongoDB connection URL for logs. If unset, it can reuse the main database.
VECTOR_VQ_LEVEL32Vector quantization level. Supported ranges depend on the vector store.
PG_URLEmptyPostgreSQL/pgvector connection URL.
OCEANBASE_URLEmptyOceanBase vector store connection URL.
SEEKDB_URLEmptySeekDB vector store connection URL.
MILVUS_ADDRESSEmptyMilvus/Zilliz address.
MILVUS_TOKENEmptyMilvus/Zilliz access token.
OPENGAUSS_URLEmptyopenGauss vector store connection URL.

Object Storage

VariableDefaultDescription
STORAGE_VENDORminioObject storage vendor. Supported values are minio, aws-s3, r2, cos, and oss.
STORAGE_PUBLIC_BUCKETfastgpt-publicPublic file bucket.
STORAGE_PRIVATE_BUCKETfastgpt-privatePrivate file bucket.
STORAGE_REGIONus-east-1Object storage region.
STORAGE_EXTERNAL_ENDPOINTEmptyExternally reachable object storage endpoint for browsers or external services.
STORAGE_R2_PUBLIC_ENDPOINTEmptyPublic HTTPS domain for a Cloudflare R2 bucket; required when STORAGE_VENDOR=r2.
STORAGE_S3_CDN_ENDPOINTEmptyCDN endpoint used for temporary short-redirect download URLs. Requires STORAGE_EXTERNAL_ENDPOINT.
STORAGE_DOWNLOAD_URL_MODEshort-proxyDownload mode: short-proxy or short-redirect. External URLs are always FastGPT short links.
STORAGE_DOWNLOAD_REDIRECT_TTL_SECONDS300Lifetime of the temporary object storage or CDN URL used by short-redirect, in seconds.
STORAGE_S3_ENDPOINThttp://localhost:9000S3/MinIO-compatible API endpoint.
STORAGE_PUBLIC_ACCESS_EXTRA_SUB_PATHEmptyExtra sub-path for public file access URLs.
STORAGE_ACCESS_KEY_IDminioadminObject storage access key.
STORAGE_SECRET_ACCESS_KEYminioadminObject storage secret key.
STORAGE_S3_FORCE_PATH_STYLEfalseWhether S3 path-style access is forced. MinIO usually requires this.
STORAGE_S3_MAX_RETRIES3Maximum S3 client retry count.
STORAGE_COS_PROTOCOLhttps:Tencent Cloud COS protocol, either https: or http:.
STORAGE_COS_USE_ACCELERATEfalseWhether Tencent Cloud COS acceleration domain is used.
STORAGE_COS_CNAME_DOMAINEmptyTencent Cloud COS custom CNAME domain.
STORAGE_COS_PROXYEmptyTencent Cloud COS proxy URL.
STORAGE_OSS_ENDPOINTEmptyAlibaba Cloud OSS endpoint.
STORAGE_OSS_CNAMEfalseWhether Alibaba Cloud OSS uses CNAME.
STORAGE_OSS_INTERNALfalseWhether Alibaba Cloud OSS uses an internal endpoint.
STORAGE_OSS_SECUREfalseWhether Alibaba Cloud OSS uses HTTPS.
STORAGE_OSS_ENABLE_PROXYtrueWhether Alibaba Cloud OSS proxy access is enabled.

Logging, Metrics, and Tracing

VariableDefaultDescription
LOG_ENABLE_CONSOLEtrueWhether console logging is enabled.
LOG_CONSOLE_LEVELdebugConsole log level. Supported values are trace, debug, info, warning, error, and fatal.
LOG_DEPTH3Legacy template variable for log object depth. New structured logging mainly uses log-level settings.
LOG_ENABLE_OTELfalseWhether OpenTelemetry log export is enabled.
LOG_OTEL_LEVELinfoOTEL log level.
LOG_OTEL_SERVICE_NAMEfastgpt-clientOTEL log service name.
LOG_OTEL_URLEmptyOTEL log export URL.
METRICS_ENABLE_OTELfalseWhether OpenTelemetry metrics export is enabled.
METRICS_EXPORT_INTERVAL30000Metrics export interval, in milliseconds.
METRICS_OTEL_SERVICE_NAMEfastgpt-clientOTEL metrics service name.
METRICS_OTEL_URLEmptyOTEL metrics export URL.
TRACING_ENABLE_OTELfalseWhether OpenTelemetry tracing is enabled.
TRACING_OTEL_SERVICE_NAMEfastgpt-clientOTEL tracing service name.
TRACING_OTEL_URLEmptyOTEL tracing export URL.
TRACING_OTEL_SAMPLE_RATIOEmptyTrace sampling ratio from 0 to 1.
CHAT_LOG_URLEmptyChat log push service URL. Empty disables pushing.
CHAT_LOG_INTERVALEmptyChat log batch push interval, in milliseconds.
CHAT_LOG_SOURCE_ID_PREFIXfastgpt-Prefix for chat log source IDs.
TRACK_BATCH_UPDATE_TIME10000Event counter batch write interval, in milliseconds.

Domains, Frontend, and Runtime

VariableDefaultDescription
FE_DOMAINRequiredThe origin clients use to access FastGPT, including the scheme, host, and optional port. It completes file and image URLs. Local development can use http://localhost:3000.
FILE_DOMAINEmptyFile access domain. It usually points to FastGPT, but a separate domain can isolate file risk.
NEXT_PUBLIC_BASE_URLEmptyNext.js sub-path deployment prefix, such as /fastgpt. It must be fixed when building the image.
HOSTNAMElocalhostService host used for internal URLs and SSRF local-address detection. Containers commonly set it to 0.0.0.0.
PORT3000Next.js listening port. Also used for local-address detection.
NODE_ENVEmptyStandard Node/Next.js runtime environment. Production images set it to production.
NEXT_TELEMETRY_DISABLED1Disables Next.js Telemetry in production images.
NODE_OPTIONS--max-old-space-size=4096Node options used during production image builds to increase the build memory limit.

Security

VariableDefaultDescription
USE_IP_LIMITfalseWhether IP rate limiting is enabled for selected APIs.
CHECK_INTERNAL_IPfalseWhether internal IP checks are enabled to reduce SSRF risk.
AUTH_COOKIE_SECUREfalseWhether login cookies use the Secure attribute. Enable only when the site is HTTPS-only.
TRUSTED_PROXY_ENABLEfalseWhether trusted reverse proxy client IP validation is enabled. Disabled keeps legacy behavior.
TRUSTED_PROXY_IPSEmptyTrusted reverse proxy IP/CIDR list, separated by commas or whitespace.
PASSWORD_LOGIN_LOCK_SECONDS120Lock duration after failed password login attempts, in seconds.
MAX_LOGIN_SESSION10Maximum login clients per account.
ALLOWED_ORIGINSEmptyAllowed CORS origins. Use commas to separate multiple origins. Empty allows all origins by default.
MULTIPLE_DATA_TO_BASE64falseWhether images are forced into base64 before being sent to models.
DISABLE_CACHEfalseWhether system cache hits are disabled, mainly for debugging.
HTTP_PROXYEmptyOutbound HTTP proxy for Node and workers.
HTTPS_PROXYEmptyOutbound HTTPS proxy for Node and workers.
NO_PROXYEmptyAddress list that bypasses proxies.
ALL_PROXYEmptyGeneral outbound proxy.

Feature Flags and Limits

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 dataset 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 conversion. Larger content is not converted.

Additional App Variables

These variables are mainly read by projects/app. Some are currently defined in packages/service/env.ts for shared validation, but their actual consumers are still App-side code.

VariableDefaultDescription
DEFAULT_ROOT_PSW123456Default password for initializing the root user.
SYSTEM_NAMEAIDefault system name for the page title.
SYSTEM_DESCRIPTIONEmptyPage meta description. If unset, the default i18n text is used.
SYSTEM_FAVICONEmptyPage favicon URL. If unset, the favicon from system config is used.
CHINESE_IP_REDIRECT_URLEmptyChina IP redirect URL in frontend config.
PAY_FORM_URLEmptyPayment form URL in frontend config.
SHOW_COUPONfalseWhether redemption codes are shown.
SHOW_DISCOUNT_COUPONfalseWhether discount coupons are shown.
HIDE_CHAT_COPYRIGHT_SETTINGfalseWhether copyright settings are hidden.
WECOM_LOGIN_AUTO_REDIRECTfalseWhether WeCom terminals automatically redirect to login.
APP_REGISTRATION_URLEmptyApp registration application URL. Currently kept mostly for compatibility.
PASSWORD_EXPIRED_MONTHEmptyPassword expiration period in months. Empty means passwords do not expire.
OPENAPI_KEY_MAX_COUNT100Maximum number of system API Keys one team member can create. Minimum is 1.
SSE_MCP_SERVER_PROXY_ENDPOINTEmptyMCP SSE server proxy URL. Do not include a trailing slash. Required when publishing an SSE MCP App.

Open-Source Only

Starting with v4.15.0, the open-source edition no longer reads config.json. When upgrading from an earlier version, remove the file's volume mount and migrate the old settings to environment variables using the table below. If you did not use these optional settings, you do not need to add them.

Former config.json fieldCurrent environment variableDefaultDescription
systemEnv.customPdfParse.urlCUSTOM_PDF_PARSE_URLEmptyCustom PDF parsing service URL.
systemEnv.customPdfParse.keyCUSTOM_PDF_PARSE_KEYEmptyCustom PDF parsing service key.
systemEnv.customPdfParse.doc2xKeyDOC2X_KEYEmptyDoc2x PDF parsing service key.
systemEnv.customPdfParse.textinAppIdTEXTIN_APP_IDEmptyTextIn service App ID.
systemEnv.customPdfParse.textinSecretCodeTEXTIN_SECRET_CODEEmptyTextIn service Secret Code.
systemEnv.hnswEfSearchHNSW_EF_SEARCH100The hnsw.ef_search vector search parameter for PG, OceanBase, and openGauss.
systemEnv.hnswMaxScanTuplesHNSW_MAX_SCAN_TUPLES100000Maximum number of tuples scanned during vector search. Applies only to PG.
systemEnv.datasetParseMaxProcessDATASET_PARSE_MAX_PROCESS10Maximum concurrency for the Knowledge Base file parsing queue.
systemEnv.vectorMaxProcessVECTOR_MAX_PROCESS10Maximum concurrency for the vector training queue.
systemEnv.qaMaxProcessQA_MAX_PROCESS10Maximum concurrency for the Q&A splitting queue.
systemEnv.vlmMaxProcessVLM_MAX_PROCESS10Maximum concurrency for the image understanding model queue.

Enhanced PDF Parsing

The open-source edition supports custom PDF parsing services, SoMark, TextIn, and Doc2x. Configure only one service. If you configure more than one, FastGPT uses this priority order: custom PDF parsing service, SoMark, TextIn, then Doc2x.

Use the Sealos PDF Parsing Service
  1. Open Sealos AI Proxy and create an API key.
  2. Add the API key to FastGPT:
dotenv
CUSTOM_PDF_PARSE_URL=https://aiproxy.hzh.sealos.run/v1/parse/pdf?model=parse-pdf
CUSTOM_PDF_PARSE_KEY=your-sealos-api-key
Use SoMark
  1. Open SoMark Studio and create an API key.
  2. Add the API key to FastGPT:
dotenv
SOMARK_API_KEY=sk-your-api-key

The SoMark synchronous parsing endpoint accepts files up to 200 MB and 300 pages. See the SoMark API documentation for the complete limits and error codes.

Use Another Custom PDF Parsing Service
dotenv
CUSTOM_PDF_PARSE_URL=https://your-pdf-parser.example.com/v2/parse/file
CUSTOM_PDF_PARSE_KEY=your-service-key

CUSTOM_PDF_PARSE_KEY is optional. When set, FastGPT sends it to the parsing service as Authorization: Bearer <CUSTOM_PDF_PARSE_KEY>. The service must accept a multipart/form-data POST request with a file field and return JSON in this format:

json
{
  "pages": 10,
  "markdown": "Parsed Markdown content"
}
Use TextIn
dotenv
TEXTIN_APP_ID=your-app-id
TEXTIN_SECRET_CODE=your-secret-code
Use Doc2x
dotenv
DOC2X_KEY=your-api-key

Restart FastGPT after changing the environment variables. Then enable Enhanced PDF Parsing when importing files into a Knowledge Base or configuring App file uploads. PDFs use the configured enhanced parsing service only when this option is enabled; otherwise, FastGPT uses its built-in parser.

Admin-Specific Variables

These variables are mainly read by pro/admin. Admin also uses the shared App/Admin variables above.

VariableDefaultDescription
PRO_TOKENNone, requiredService-to-service token for FastGPT app calls to pro/admin internal APIs. Must be at least 32 characters and match App.
EVAL_LINE_LIMIT1000Maximum number of rows allowed when creating one evaluation task. Also sent to frontend config.
BATCH_UPDATE_TIME3000Wallet balance batch update interval, in milliseconds.
INVOICE_FEISHU_WEBHOOK_URLEmptyLark webhook URL for invoice application notifications.
INVOICE_FEISHU_WEBHOOK_CALLBACK_URLEmptyCallback URL for buttons in invoice notifications.
SMS_PROXYEmptySMS sending proxy service URL.
MAX_CRAWL_PAGE2000Maximum number of pages to crawl during website sync.
CRAWL_MAX_HTML_SIZE10Estimated maximum HTML size for one static crawled page, in MB.
CRAWL_EXCLUDE_LISTEmptyCrawler exclusion rules for domains or paths. Use commas to separate values.
SHOW_GITfalseWhether Git information is shown in Admin.
CLEAR_FREE_ACCOUNTfalseWhether free account resource cleanup is enabled.
SYNC_MEMBER_CRONEmptyCron expression for automatic member sync. Empty disables the sync task.
WORKORDER_BASE_URLEmptyWork order system URL. When set, the frontend shows work order entry points.
WORKORDER_JWT_SECRETEmptySecret used to sign JWTs when creating work orders.
EXTERNAL_USER_SYSTEM_BASE_URLEmptyExternal user system URL.
EXTERNAL_USER_SYSTEM_AUTH_TOKENEmptyAuthentication token for the external user system.
BAIDU_CONVERSION_TOKENEmptyBaidu conversion tracking token.
BAIDU_CONVERSION_BASE_URLEmptyBaidu conversion tracking API URL.
BING_ADS_DEVELOPER_TOKENEmptyBing Ads developer token.
BING_ADS_CUSTOMER_IDEmptyBing Ads customer ID.
BING_ADS_CUSTOMER_ACCOUNT_IDEmptyBing Ads customer account ID.
BING_ADS_CONVERSION_NAMEfastgptcnBing Ads conversion goal name.
BING_OAUTH_CLIENT_IDEmptyBing OAuth client ID.
BING_OAUTH_CLIENT_SECRETEmptyBing OAuth client secret.
BING_OAUTH_REFRESH_TOKENEmptyBing OAuth refresh token.
SHOW_WECOM_CONFIGfalseWhether WeCom configuration is shown.
WECOM_DEVfalseDevelopment mode switch for WeCom Pay.

Code Sandbox Variables

These variables are loaded and validated by projects/code-sandbox/src/env.ts. When App calls the sandbox, CODE_SANDBOX_TOKEN must match SANDBOX_TOKEN.

VariableDefaultDescription
SANDBOX_PORT3000Code Sandbox listening port.
SANDBOX_TOKENEmptyBearer token for the /sandbox endpoint. Empty disables API authentication. It only allows printable ASCII characters and cannot contain spaces.
SANDBOX_POOL_SIZE20Number of pre-warmed JS/Python workers, from 1 to 100.
SANDBOX_QUEUE_ID_CONCURRENCYEmptyNumber of requests with the same queueId that may enter execution concurrently. Empty disables queueId queueing. Range: 1 to 100.
SANDBOX_API_MAX_BODY_MB8Maximum /sandbox API JSON body size, including variables, in MB. Range: 1 to 100.
SANDBOX_MAX_TIMEOUT60000Timeout for one code execution, in milliseconds. Range: 1000 to 600000.
SANDBOX_MAX_MEMORY_MB256Maximum memory for one sandbox, in MB. Range: 32 to 4096. The runtime reserves an extra 50 MB for overhead.
SANDBOX_MAX_OUTPUT_MB10Maximum output JSON size for one code execution, including return values and logs, in MB. Range: 1 to 100.
CHECK_INTERNAL_IPtrueWhether internal IP checks are enabled for sandbox network requests.
SANDBOX_REQUEST_MAX_COUNT30Maximum number of network requests allowed during one code execution. Range: 1 to 1000.
SANDBOX_REQUEST_TIMEOUT60000Timeout for one network request from inside the sandbox, in milliseconds. Range: 1000 to 300000.
SANDBOX_REQUEST_MAX_RESPONSE_MB10Maximum response body size for one sandbox network request, in MB. Range: 1 to 100.
SANDBOX_REQUEST_MAX_BODY_MB5Maximum request body size for one sandbox network request, in MB. Range: 1 to 100.
SANDBOX_JS_ALLOWED_MODULESlodash,dayjs,moment,uuid,crypto-js,qs,url,querystringModule allowlist for JavaScript code. Use commas to separate modules.
SANDBOX_PYTHON_ALLOWED_MODULESCommon standard libraries plus numpy,pandas,matplotlibModule allowlist for Python code. Use commas to separate modules.
NODE_ENVEmptyStandard Node environment variable. Internal address checks are relaxed in development.
HOSTNAMElocalhostSandbox service host used for local-address detection.
PORT3000Sandbox local service port used for local-address detection. Actual listening uses SANDBOX_PORT first.

Volume Manager Variables

These variables are loaded and validated by projects/volume-manager/src/env.ts. The AGENT_SANDBOX_OPENSANDBOX_VOLUME_MANAGER_TOKEN used by FastGPT for persistent OpenSandbox volumes must match VM_AUTH_TOKEN.

VariableDefaultDescription
PORT3000Volume Manager listening port.
VM_AUTH_TOKENNone, requiredAPI authentication token for Volume Manager.
VM_RUNTIMEkubernetesRuntime type, either docker or kubernetes.
VM_DOCKER_SOCKET/var/run/docker.sockDocker socket path. Required only in docker mode.
VM_DOCKER_API_VERSIONv1.44Docker API version. Required only in docker mode.
VM_K8S_NAMESPACEopensandboxKubernetes namespace. Required only in kubernetes mode.
VM_K8S_PVC_STORAGE_CLASSstandardKubernetes PVC StorageClass. Required only in kubernetes mode.
VM_K8S_PVC_STORAGE_SIZE1GiKubernetes PVC size. Required only in kubernetes mode.
VM_VOLUME_NAME_PREFIXfastgpt-sessionVolume/PVC name prefix. The final name includes the sessionId hash.
VM_LOG_LEVELinfoLog level. Supported values are debug, info, and none.