forked from phoenix/litellm-mirror
docs(prod.md): add 'disable load_dotenv' tutorial to docs
This commit is contained in:
parent
1ab4974773
commit
9eee2f3889
3 changed files with 8 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
#############################################
|
#############################################
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue