Skip to main content

Environment Variables

Self-hosting Server File Online Generator

The latest version of the file is available here: docker-compose.yml. Please copy the latest document and modify the parameters as needed.

This file is used to configure global parameters, such as the global use of TTS (Text-to-Speech), LLM (Large Language Model), STT (Speech-to-Text), as well as server address, port, and other configurations.

If you want to set the voice type for TTS globally, you can add the following fields (please add the corresponding fields based on your TTS type):

  • OPENAI_TTS_VOICE_NAME (alloy, echo, fable, onyx, nova, shimmer)
  • AZURE_OPENAI_TTS_VOICE_NAME (alloy, echo, fable, onyx, nova, shimmer)
  • AZURE_TTS_VOICE_NAME (Voice List)
  • EDGE_TTS_VOICE_NAME (Voice List)
  • ELEVENLABS_TTS_VOICE_ID (Voice List)
  • ALIYUN_TTS_APP_KEY (App Key)
  • DIFY_TTS_KEY

If you want to set specific TTS for each role, please refer to Role Configuration

caution
  • Make sure to replace your_vps_ip with your own IP address. Modify the keys of various services to your own keys. Especially note that AUDIO_DOWNLOAD_URL starts with http://, and SPEECH_UDP_SERVER_HOST does not.

  • Make sure all used ports are open, 1883/tcp, 8082/tcp, 18083/tcp, 8083/tcp, 8085/udp, especially note that port 8085 is UDP. For some VPS, you may need to open them in the security group. Please ensure that the opening is successful, especially ensure that 8085 is UDP.

  • You only need to fill in your own set of TTS, LLM, STT, and the corresponding parameters. For example: If you choose openai-whisper for STT_TYPE, then you need to fill in the corresponding OPENAI_WHISPER_KEY, OPENAI_WHISPER_MODEL, OPENAI_WHISPER_API_BASE.

  • After each modification, a rebuild is required, execute the following command:

    docker compose up -d
  • The definitions of TTS, LLM, STT in this file have lower priority than those in roles.json. If TTS, LLM, STT are defined in roles.json, the definitions in this file will not take effect. After the setup is completed, if conflicts with the services defined here are found during testing, please check roles.json.

  • The ROLES_FILE_PATH field configures the path of roles.json. Please ensure that the path is correct.

FoloToy server accepts the following environment variables for runtime configuration:

Variable NameDescriptionDefault Value
HTTPX_TIMEOUTHttp Timeout5
ROLES_FILE_PATHRole configuration fileroles.json
STT_TYPESpeech-to-Text Engine Type: openai-whisper, azure-stt, azure-whisper, dify-stt, aliyun-asropenai-whisper
OPENAI_WHISPER_API_BASEOpenAI Whisper API Base Urlhttps://api.openai.com/v1
OPENAI_WHISPER_KEYOpenAI Whisper API Keysk-AAAAAAAAA
OPENAI_WHISPER_MODELOpenAI Whipser Modelwhisper-1
AZURE_WHISPER_API_BASEAzure Whisper API Base Url,Regions availability: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models#model-summary-table-and-region-availability
AZURE_WHISPER_KEYAzure Whisper API Key
AZURE_WHISPER_DEPLOYMENT_NAMEDeploy Name
AZURE_WHISPER_API_VERSIONAPI Version, Details: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#request-a-speech-to-text-transcription2023-09-01-preview
AZURE_STT_KEYAzure Speech Services Key, Details: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/overview
AZURE_STT_SERVICE_REGIONAzure Speech Services Region
DIFY_STT_API_BASEDify Sound-to-Text API Base Url. You need to enable sound-to-text feature in Dify configurationshttp://192.168.52.164/v1
DIFY_STT_KEYDify Sound-to-Text API Keysk-AAAAAAAA
ALIYUN_ASR_ACCESS_KEY_IDAliyun Access Key IDFor token retrieval, refer: https://help.aliyun.com/document_detail/450514.html
ALIYUN_ASR_ACCESS_KEY_SECRETAliyun Access Secret KeyFor token retrieval, refer: https://help.aliyun.com/document_detail/450514.html
ALIYUN_ASR_APP_KEYAliyun App KeyFor app key retrieval, refer: https://help.aliyun.com/document_detail/72214.html
LLM_TYPELarge Language Model Type: openai, azure-openai, gemini, dify, qianfan, xiaodu, moonshot, groq, ollama, anthropicopenai
OPENAI_OPENAI_API_BASEOpenAI API Base Urlhttps://api.openai.com/v1
OPENAI_OPENAI_KEYOpenAI API Keysk-AAAAAAAA
OPENAI_OPENAI_MODELOpenAI Modelgpt-3.5-turbo
AZURE_OPENAI_KEYAzure OpenAI API Key
AZURE_OPENAI_ENDPOINTAzure OpenAI API Endpoint
AZURE_OPENAI_API_VERSIONAzure OpenAI API Version, ,Available versions: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#completions2023-05-15
AZURE_OPENAI_MODELOpenAI Modelgpt-35-turbo
DIFY_API_BASEDify API Base Urlhttp://192.168.52.164/v1
DIFY_KEYDify API Keysk-AAAAAAAA
GEMINI_API_BASEGemini API Base Urlhttps://generativelanguage.googleapis.com
GEMINI_KEYGemini API Keysk-AAAAAAAA
QIANFAN_CLIENT_IDQianfan API Key13rBTgx*e03XE
QIANFAN_SECRETQianfan Secret Key KeyzYxtMI***QLerLgQ2W5e
QIANFAN_MODELQianfan Model Keyyi_34b_chat
MOONSHOT_API_BASEMoonshot API Base Urlhttps://api.moonshot.cn/v1
MOONSHOT_KEYsk-xxxxx
MOONSHOT_MODELmoonshot-v1-8k
OLLAMA_API_BASEOllama API Base Urlhttp://localhost:11434
OLLAMA_MODELgemma:2b
GROQ_API_BASEGroq API Base Urlhttps://api.groq.com/openai/v1
GROQ_MODELGroq Modelmixtral-8x7b-32768
GROQ_KEYGroq API Key
ANTHROPIC_API_BASEhttps://api.anthropic.com
ANTHROPIC_KEYsk-ant-api03-xx
ANTHROPIC_MODELclaude-3-sonnet-20240229
ANTHROPIC_MAX_TOKENS1024
VOICE_EXECUTOR_MAX_WORKERSVoice task thread pool max size2
TTS_TYPEText-to-Speech Engine Type: openai-tts, azure-tts, azure-openai-tts, aliyun-tts, elevenlabs, edge-ttsedge-tts
AZURE_TTS_KEYAzure Speech Services Key
AZURE_TTS_SERVICE_REGIONAzure Speech Services Region
ELEVENLABS_TTS_KEYelevenlabs.io API Key
ELEVENLABS_TTS_MODELelevenlabs.io Modeleleven_multilingual_v2
OPENAI_TTS_API_BASEOpenAI API Base Urlhttps://api.openai.com/v1
OPENAI_TTS_KEYOpenAI API Keysk-AAAAAA
OPENAI_TTS_MODELOpenAI Text to speech modeltts-1
ALIYUN_TTS_ACCESS_KEY_IDAliyun Access Key IDFor token retrieval, refer: https://help.aliyun.com/document_detail/450514.html
ALIYUN_TTS_ACCESS_KEY_SECRETAliyun Access Secret KeyFor token retrieval, refer: https://help.aliyun.com/document_detail/450514.html
ALIYUN_TTS_APP_KEYAliyun App KeyFor app key retrieval, refer: https://help.aliyun.com/document_detail/72214.html
DIFY_TTS_API_BASEDify Base Urlhttps://api.dify.ai/v1
DIFY_TTS_KEYDify App key
AZURE_OPENAI_TTS_API_BASEhttps://xxx.openai.azure.com/
AZURE_OPENAI_TTS_API_VERSION2024-02-15-preview
AZURE_OPENAI_TTS_DEPLOYMENT_NAMEtts
AZURE_OPENAI_TTS_KEYDetails: https://learn.microsoft.com/en-us/azure/ai-services/openai/text-to-speech-quickstart?tabs=command-line#rest-api
AZURE_OPENAI_TTS_MODELtts-1
AUDIO_DOWNLOAD_URLDirectory for downloading recordings and generated voices
AUDIO_SAVE_PATHDirectory for saving recordings and generated voices
MQTT_BROKER_HOSTMQTT Broker Host
MQTT_BROKER_PORTMQTT Broker Port1883
MQTT_CLIENT_IDMQTT Client ID for user server loginfolotoy
MQTT_USERNAMEMQTT Username for user server loginfolotoy
MQTT_PASSWORDMQTT Password for user server loginfolotoy
SPEECH_UDP_SERVER_HOSTHost address of the UDP server that receives speech data
SPEECH_UDP_SERVER_PORTPort of the UDP server that receives speech data8085
LOG_LEVELLog Level: INFO,DEBUG,WARNINGDEBUG
INTEGRATION_MQTTWhether to enable MQTT integration interfacefalse
SENTENCE_SEPARATORSPunctuation marks used for sentence separation,!。?,!.?
TZUsed to establish local timezone, for example, to use local time in logs. Check List of Timezone Codes.Asia/Shanghai

Translated directly into English.