docs(prod.md): add 'disable load_dotenv' tutorial to docs

This commit is contained in:
Krrish Dholakia 2024-05-14 19:13:22 -07:00
parent 1ab4974773
commit 9eee2f3889
3 changed files with 8 additions and 2 deletions

View file

@ -64,6 +64,12 @@ router_settings:
redis_password: os.environ/REDIS_PASSWORD redis_password: os.environ/REDIS_PASSWORD
``` ```
## 4. Disable 'load_dotenv'
Set `export LITELLM_MODE="PRODUCTION"`
This disables the load_dotenv() functionality, which will automatically load your environment credentials from the local `.env`.
## Extras ## Extras
### Expected Performance in Production ### Expected Performance in Production

View file

@ -15,7 +15,7 @@ from litellm.proxy._types import (
import httpx import httpx
import dotenv import dotenv
litellm_mode = os.getenv("LITELLM_PRODUCTION_MODE", "DEV") # "PRODUCTION", "DEV" litellm_mode = os.getenv("LITELLM_MODE", "DEV") # "PRODUCTION", "DEV"
if litellm_mode == "DEV": if litellm_mode == "DEV":
dotenv.load_dotenv() dotenv.load_dotenv()
############################################# #############################################

View file

@ -11,7 +11,7 @@ sys.path.append(os.getcwd())
config_filename = "litellm.secrets" config_filename = "litellm.secrets"
litellm_mode = os.getenv("LITELLM_PRODUCTION_MODE", "DEV") # "PRODUCTION", "DEV" litellm_mode = os.getenv("LITELLM_MODE", "DEV") # "PRODUCTION", "DEV"
if litellm_mode == "DEV": if litellm_mode == "DEV":
load_dotenv() load_dotenv()
from importlib import resources from importlib import resources