2023-09-09 16:21:38 -06:00
|
|
|
# To customize your server, make a copy of this file to `.env` and edit any
|
|
|
|
# values you want to change. Be sure to remove the `#` at the beginning of each
|
|
|
|
# line you want to modify.
|
2023-04-08 05:02:59 -06:00
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# All values have reasonable defaults, so you only need to change the ones you
|
|
|
|
# want to override.
|
|
|
|
|
2024-01-17 01:36:21 -07:00
|
|
|
# Use production mode unless you are developing locally.
|
|
|
|
NODE_ENV=production
|
|
|
|
|
2024-09-16 09:17:57 -06:00
|
|
|
# Detail level of diagnostic logging. (trace | debug | info | warn | error)
|
|
|
|
# LOG_LEVEL=info
|
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# General settings:
|
|
|
|
|
|
|
|
# The title displayed on the info page.
|
2023-05-15 15:47:30 -06:00
|
|
|
# SERVER_TITLE=Coom Tunnel
|
2023-09-09 16:21:38 -06:00
|
|
|
|
2024-02-26 17:20:34 -07:00
|
|
|
# The route name used to proxy requests to APIs, relative to the Web site root.
|
|
|
|
# PROXY_ENDPOINT_ROUTE=/proxy
|
|
|
|
|
2023-11-13 22:41:19 -07:00
|
|
|
# Text model requests allowed per minute per user.
|
|
|
|
# TEXT_MODEL_RATE_LIMIT=4
|
|
|
|
# Image model requests allowed per minute per user.
|
|
|
|
# IMAGE_MODEL_RATE_LIMIT=2
|
2023-09-09 16:21:38 -06:00
|
|
|
|
2023-11-07 19:50:19 -07:00
|
|
|
# Max number of context tokens a user can request at once.
|
|
|
|
# Increase this if your proxy allow GPT 32k or 128k context
|
2024-09-16 09:17:57 -06:00
|
|
|
# MAX_CONTEXT_TOKENS_OPENAI=32768
|
|
|
|
# MAX_CONTEXT_TOKENS_ANTHROPIC=32768
|
2023-11-07 19:50:19 -07:00
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# Max number of output tokens a user can request at once.
|
2024-09-16 09:17:57 -06:00
|
|
|
# MAX_OUTPUT_TOKENS_OPENAI=1024
|
|
|
|
# MAX_OUTPUT_TOKENS_ANTHROPIC=1024
|
2023-09-09 16:21:38 -06:00
|
|
|
|
|
|
|
# Whether to show the estimated cost of consumed tokens on the info page.
|
|
|
|
# SHOW_TOKEN_COSTS=false
|
|
|
|
|
|
|
|
# Whether to automatically check API keys for validity.
|
2024-09-16 09:17:57 -06:00
|
|
|
# Disabled by default in local development mode, but enabled in production.
|
2023-05-15 15:47:30 -06:00
|
|
|
# CHECK_KEYS=true
|
2023-09-09 16:21:38 -06:00
|
|
|
|
|
|
|
# Which model types users are allowed to access.
|
2023-11-13 22:41:19 -07:00
|
|
|
# The following model families are recognized:
|
2024-09-12 21:55:45 -06:00
|
|
|
# turbo | gpt4 | gpt4-32k | gpt4-turbo | gpt4o | o1 | dall-e | claude
|
|
|
|
# | claude-opus | gemini-flash | gemini-pro | gemini-ultra | mistral-tiny |
|
|
|
|
# | mistral-small | mistral-medium | mistral-large | aws-claude |
|
|
|
|
# | aws-claude-opus | gcp-claude | gcp-claude-opus | azure-turbo | azure-gpt4
|
|
|
|
# | azure-gpt4-32k | azure-gpt4-turbo | azure-gpt4o | azure-o1 | azure-dall-e
|
2024-08-05 08:27:51 -06:00
|
|
|
|
2024-09-12 21:55:45 -06:00
|
|
|
# By default, all models are allowed except for dall-e and o1.
|
2024-03-09 12:03:50 -07:00
|
|
|
# To allow DALL-E image generation, uncomment the line below and add 'dall-e' or
|
|
|
|
# 'azure-dall-e' to the list of allowed model families.
|
2024-08-05 08:27:51 -06:00
|
|
|
# ALLOWED_MODEL_FAMILIES=turbo,gpt4,gpt4-32k,gpt4-turbo,gpt4o,claude,claude-opus,gemini-flash,gemini-pro,gemini-ultra,mistral-tiny,mistral-small,mistral-medium,mistral-large,aws-claude,aws-claude-opus,gcp-claude,gcp-claude-opus,azure-turbo,azure-gpt4,azure-gpt4-32k,azure-gpt4-turbo,azure-gpt4o
|
2023-09-09 16:21:38 -06:00
|
|
|
|
2024-06-07 11:09:43 -06:00
|
|
|
# Which services can be used to process prompts containing images via multimodal
|
|
|
|
# models. The following services are recognized:
|
2024-08-05 08:27:51 -06:00
|
|
|
# openai | anthropic | aws | gcp | azure | google-ai | mistral-ai
|
2024-06-07 11:09:43 -06:00
|
|
|
# Do not enable this feature unless all users are trusted, as you will be liable
|
|
|
|
# for any user-submitted images containing illegal content.
|
|
|
|
# By default, no image services are allowed and image prompts are rejected.
|
2024-06-09 10:36:20 -06:00
|
|
|
# ALLOWED_VISION_SERVICES=
|
2024-06-07 11:09:43 -06:00
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# Whether prompts should be logged to Google Sheets.
|
|
|
|
# Requires additional setup. See `docs/google-sheets.md` for more information.
|
|
|
|
# PROMPT_LOGGING=false
|
|
|
|
|
2024-09-16 09:17:57 -06:00
|
|
|
# Specifies the number of proxies or load balancers in front of the server.
|
|
|
|
# For Cloudflare or Hugging Face deployments, the default of 1 is correct.
|
|
|
|
# For any other deployments, please see config.ts as the correct configuration
|
|
|
|
# depends on your setup. Misconfiguring this value can result in problems
|
|
|
|
# accurately tracking IP addresses and enforcing rate limits.
|
|
|
|
# TRUSTED_PROXIES=1
|
2023-09-09 16:21:38 -06:00
|
|
|
|
2024-09-16 09:17:57 -06:00
|
|
|
# Whether cookies should be set without the Secure flag, for hosts that don't
|
|
|
|
# support SSL. True by default in development, false in production.
|
2023-11-03 14:24:53 -06:00
|
|
|
# USE_INSECURE_COOKIES=false
|
|
|
|
|
2024-09-16 09:17:57 -06:00
|
|
|
# Reorganizes requests in the queue according to their token count, placing
|
|
|
|
# larger prompts further back. The penalty is determined by (promptTokens *
|
|
|
|
# TOKENS_PUNISHMENT_FACTOR). A value of 1.0 adds one second per 1000 tokens.
|
|
|
|
# When there is no queue or it is very short, the effect is negligible (this
|
|
|
|
# setting only reorders the queue, it does not artificially delay requests).
|
|
|
|
# TOKENS_PUNISHMENT_FACTOR=0.0
|
2023-09-09 16:21:38 -06:00
|
|
|
|
2024-05-19 10:31:56 -06:00
|
|
|
# Captcha verification settings. Refer to docs/pow-captcha.md for guidance.
|
|
|
|
# CAPTCHA_MODE=none
|
|
|
|
# POW_TOKEN_HOURS=24
|
|
|
|
# POW_TOKEN_MAX_IPS=2
|
2024-05-21 11:38:41 -06:00
|
|
|
# POW_DIFFICULTY_LEVEL=low
|
|
|
|
# POW_CHALLENGE_TIMEOUT=30
|
2024-05-19 10:31:56 -06:00
|
|
|
|
2024-09-16 09:17:57 -06:00
|
|
|
# -------------------------------------------------------------------------------
|
|
|
|
# Blocking settings:
|
|
|
|
# Allows blocking requests depending on content, referers, or IP addresses.
|
|
|
|
# This is a convenience feature; if you need more robust functionality it is
|
|
|
|
# highly recommended to put this application behind nginx or Cloudflare, as they
|
|
|
|
# will have better performance.
|
|
|
|
|
|
|
|
# IP addresses or CIDR blocks from which requests will be blocked.
|
|
|
|
# IP_BLACKLIST=10.0.0.1/24
|
|
|
|
# URLs from which requests will be blocked.
|
|
|
|
# BLOCKED_ORIGINS=reddit.com,9gag.com
|
|
|
|
# Message to show when requests are blocked.
|
|
|
|
# BLOCK_MESSAGE="You must be over the age of majority in your country to use this service."
|
|
|
|
# Destination to redirect blocked requests to.
|
|
|
|
# BLOCK_REDIRECT="https://roblox.com/"
|
|
|
|
# Comma-separated list of phrases that will be rejected. Surround phrases with
|
|
|
|
# quotes if they contain commas. You can use regular expression tokens.
|
|
|
|
# Avoid overly broad phrases as will trigger on any match in the entire prompt.
|
|
|
|
# REJECT_PHRASES="phrase one,phrase two,"phrase three, which has a comma",phrase four"
|
|
|
|
# Message to show when requests are rejected.
|
|
|
|
# REJECT_MESSAGE="You can't say that here."
|
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Optional settings for user management, access control, and quota enforcement:
|
|
|
|
# See `docs/user-management.md` for more information and setup instructions.
|
|
|
|
# See `docs/user-quotas.md` to learn how to set up quotas.
|
2023-04-14 19:21:04 -06:00
|
|
|
|
2023-10-02 14:39:30 -06:00
|
|
|
# Which access control method to use. (none | proxy_key | user_token)
|
2023-05-13 22:26:08 -06:00
|
|
|
# GATEKEEPER=none
|
2023-09-09 16:21:38 -06:00
|
|
|
# Which persistence method to use. (memory | firebase_rtdb)
|
2023-05-14 13:30:32 -06:00
|
|
|
# GATEKEEPER_STORE=memory
|
2023-09-09 16:21:38 -06:00
|
|
|
|
|
|
|
# Maximum number of unique IPs a user can connect from. (0 for unlimited)
|
|
|
|
# MAX_IPS_PER_USER=0
|
2023-11-05 10:49:20 -07:00
|
|
|
# Whether user_tokens should be automatically disabled when reaching the IP limit.
|
|
|
|
# MAX_IPS_AUTO_BAN=true
|
2023-09-09 16:21:38 -06:00
|
|
|
|
|
|
|
# With user_token gatekeeper, whether to allow users to change their nickname.
|
|
|
|
# ALLOW_NICKNAME_CHANGES=true
|
|
|
|
|
|
|
|
# Default token quotas for each model family. (0 for unlimited)
|
2024-09-16 09:17:57 -06:00
|
|
|
# Specify as TOKEN_QUOTA_MODEL_FAMILY=value (replacing dashes with underscores).
|
|
|
|
# eg. TOKEN_QUOTA_TURBO=0, TOKEN_QUOTA_GPT4=1000000, TOKEN_QUOTA_GPT4_32K=100000
|
2024-06-07 11:09:43 -06:00
|
|
|
# "Tokens" for image-generation models are counted at a rate of 100000 tokens
|
|
|
|
# per US$1.00 generated, which is similar to the cost of GPT-4 Turbo.
|
|
|
|
# DALL-E 3 costs around US$0.10 per image (10000 tokens).
|
|
|
|
# See `docs/dall-e-configuration.md` for more information.
|
|
|
|
# TOKEN_QUOTA_DALL_E=0
|
2023-05-13 22:26:08 -06:00
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# How often to refresh token quotas. (hourly | daily)
|
|
|
|
# Leave unset to never automatically refresh quotas.
|
|
|
|
# QUOTA_REFRESH_PERIOD=daily
|
2023-04-14 19:21:04 -06:00
|
|
|
|
2024-09-16 09:17:57 -06:00
|
|
|
# -------------------------------------------------------------------------------
|
|
|
|
# HTTP agent settings:
|
|
|
|
# If you need to change how the proxy makes requests to other servers, such
|
|
|
|
# as when checking keys or forwarding users' requests to external services,
|
|
|
|
# you can configure an alternative HTTP agent. Otherwise the default OS settings
|
|
|
|
# will be used.
|
|
|
|
|
|
|
|
# The name of the network interface to use. The first external IPv4 address
|
|
|
|
# belonging to this interface will be used for outgoing requests.
|
|
|
|
# HTTP_AGENT_INTERFACE=enp0s3
|
|
|
|
|
|
|
|
# The URL of a proxy server to use. Supports SOCKS4, SOCKS5, HTTP, and HTTPS.
|
|
|
|
# Note that if your proxy server issues a self-signed certificate, you may need
|
|
|
|
# NODE_EXTRA_CA_CERTS set to the path to your certificate. You will need to set
|
|
|
|
# that variable in your environment, not in this file.
|
|
|
|
# HTTP_AGENT_PROXY_URL=http://test:test@127.0.0.1:8000
|
2024-01-08 15:41:30 -07:00
|
|
|
|
2023-04-14 19:21:04 -06:00
|
|
|
# ------------------------------------------------------------------------------
|
2023-09-09 16:21:38 -06:00
|
|
|
# Secrets and keys:
|
2024-01-17 01:36:21 -07:00
|
|
|
# For Huggingface, set them via the Secrets section in your Space's config UI. Dp not set them in .env.
|
2023-05-15 15:47:30 -06:00
|
|
|
# For Render, create a "secret file" called .env using the Environment tab.
|
2023-04-14 19:21:04 -06:00
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# You can add multiple API keys by separating them with a comma.
|
2023-09-30 19:40:18 -06:00
|
|
|
# For AWS credentials, separate the access key ID, secret key, and region with a colon.
|
2024-08-05 08:27:51 -06:00
|
|
|
# For GCP credentials, separate the project ID, client email, region, and private key with a colon.
|
2023-04-14 19:21:04 -06:00
|
|
|
OPENAI_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
2023-05-29 21:13:17 -06:00
|
|
|
ANTHROPIC_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
2024-08-03 20:53:32 -06:00
|
|
|
GOOGLE_AI_KEY=AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
2023-10-07 19:58:04 -06:00
|
|
|
# See `docs/aws-configuration.md` for more information, there may be additional steps required to set up AWS.
|
2023-09-30 19:40:18 -06:00
|
|
|
AWS_CREDENTIALS=myaccesskeyid:mysecretkey:us-east-1,anotheraccesskeyid:anothersecretkey:us-west-2
|
2023-12-03 21:21:18 -07:00
|
|
|
# See `docs/azure-configuration.md` for more information, there may be additional steps required to set up Azure.
|
|
|
|
AZURE_CREDENTIALS=azure-resource-name:deployment-id:api-key,another-azure-resource-name:another-deployment-id:another-api-key
|
2024-08-05 08:27:51 -06:00
|
|
|
GCP_CREDENTIALS=project-id:client-email:region:private-key
|
2023-04-14 19:21:04 -06:00
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# With proxy_key gatekeeper, the password users must provide to access the API.
|
2023-04-14 19:21:04 -06:00
|
|
|
# PROXY_KEY=your-secret-key
|
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# With user_token gatekeeper, the admin password used to manage users.
|
2023-05-13 22:26:08 -06:00
|
|
|
# ADMIN_KEY=your-very-secret-key
|
2024-09-16 09:17:57 -06:00
|
|
|
# Restrict access to the admin interface to specific IP addresses, specified
|
|
|
|
# as a comma-separated list of CIDR ranges.
|
2024-05-19 10:31:56 -06:00
|
|
|
# ADMIN_WHITELIST=0.0.0.0/0
|
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# With firebase_rtdb gatekeeper storage, the Firebase project credentials.
|
2023-05-13 22:26:08 -06:00
|
|
|
# FIREBASE_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
# FIREBASE_RTDB_URL=https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.firebaseio.com
|
|
|
|
|
2023-09-09 16:21:38 -06:00
|
|
|
# With prompt logging, the Google Sheets credentials.
|
2023-04-14 19:21:04 -06:00
|
|
|
# GOOGLE_SHEETS_SPREADSHEET_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
# GOOGLE_SHEETS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|