mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(openai-proxy): add set_verbose flag for proxy to see logs
This commit is contained in:
parent
5cf1f346e5
commit
91f691cd8b
2 changed files with 9 additions and 2 deletions
|
@ -20,12 +20,15 @@ COHERE_API_KEY = ""
|
||||||
|
|
||||||
## LOGGING ##
|
## LOGGING ##
|
||||||
|
|
||||||
|
SET_VERBOSE = "False" # set to 'True' to see detailed input/output logs
|
||||||
|
|
||||||
### LANGFUSE
|
### LANGFUSE
|
||||||
LANGFUSE_PUBLIC_KEY = ""
|
LANGFUSE_PUBLIC_KEY = ""
|
||||||
LANGFUSE_SECRET_KEY = ""
|
LANGFUSE_SECRET_KEY = ""
|
||||||
# Optional, defaults to https://cloud.langfuse.com
|
# Optional, defaults to https://cloud.langfuse.com
|
||||||
LANGFUSE_HOST = "" # optional
|
LANGFUSE_HOST = "" # optional
|
||||||
|
|
||||||
|
|
||||||
## CACHING ##
|
## CACHING ##
|
||||||
|
|
||||||
### REDIS
|
### REDIS
|
||||||
|
|
|
@ -4,16 +4,20 @@ dotenv.load_dotenv() # load env variables
|
||||||
|
|
||||||
def set_callbacks():
|
def set_callbacks():
|
||||||
## LOGGING
|
## LOGGING
|
||||||
|
if len(os.getenv("SET_VERBOSE")) > 0:
|
||||||
|
if os.getenv("SET_VERBOSE") == "True":
|
||||||
|
litellm.set_verbose = True
|
||||||
|
else:
|
||||||
|
litellm.set_verbose = False
|
||||||
|
|
||||||
### LANGFUSE
|
### LANGFUSE
|
||||||
if (len(os.getenv("LANGFUSE_PUBLIC_KEY", "")) > 0 and len(os.getenv("LANGFUSE_SECRET_KEY", ""))) > 0 or len(os.getenv("LANGFUSE_HOST", "")) > 0:
|
if (len(os.getenv("LANGFUSE_PUBLIC_KEY", "")) > 0 and len(os.getenv("LANGFUSE_SECRET_KEY", ""))) > 0 or len(os.getenv("LANGFUSE_HOST", "")) > 0:
|
||||||
print(f"sets langfuse integration")
|
|
||||||
litellm.success_callback = ["langfuse"]
|
litellm.success_callback = ["langfuse"]
|
||||||
|
|
||||||
## CACHING
|
## CACHING
|
||||||
### REDIS
|
### REDIS
|
||||||
print(f"redis host: {len(os.getenv('REDIS_HOST', ''))}; redis port: {len(os.getenv('REDIS_PORT', ''))}; redis password: {len(os.getenv('REDIS_PASSWORD'))}")
|
print(f"redis host: {len(os.getenv('REDIS_HOST', ''))}; redis port: {len(os.getenv('REDIS_PORT', ''))}; redis password: {len(os.getenv('REDIS_PASSWORD'))}")
|
||||||
if len(os.getenv("REDIS_HOST", "")) > 0 and len(os.getenv("REDIS_PORT", "")) > 0 and len(os.getenv("REDIS_PASSWORD", "")) > 0:
|
if len(os.getenv("REDIS_HOST", "")) > 0 and len(os.getenv("REDIS_PORT", "")) > 0 and len(os.getenv("REDIS_PASSWORD", "")) > 0:
|
||||||
print(f"sets caching integration")
|
|
||||||
from litellm.caching import Cache
|
from litellm.caching import Cache
|
||||||
litellm.cache = Cache(type="redis", host=os.getenv("REDIS_HOST"), port=os.getenv("REDIS_PORT"), password=os.getenv("REDIS_PASSWORD"))
|
litellm.cache = Cache(type="redis", host=os.getenv("REDIS_HOST"), port=os.getenv("REDIS_PORT"), password=os.getenv("REDIS_PASSWORD"))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue