mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
Merge pull request #5052 from BerriAI/litellm_stability_fixes
fix: bump default allowed_fails + reduce default db pool limit
This commit is contained in:
commit
2f304c92e4
2 changed files with 11 additions and 3 deletions
|
|
@ -271,7 +271,7 @@ default_fallbacks: Optional[List] = None
|
|||
fallbacks: Optional[List] = None
|
||||
context_window_fallbacks: Optional[List] = None
|
||||
content_policy_fallbacks: Optional[List] = None
|
||||
allowed_fails: int = 0
|
||||
allowed_fails: int = 3
|
||||
num_retries_per_request: Optional[int] = (
|
||||
None # for the request overall (incl. fallbacks + model retries)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,11 +19,17 @@ litellm_mode = os.getenv("LITELLM_MODE", "DEV") # "PRODUCTION", "DEV"
|
|||
if litellm_mode == "DEV":
|
||||
load_dotenv()
|
||||
import shutil
|
||||
from enum import Enum
|
||||
from importlib import resources
|
||||
|
||||
telemetry = None
|
||||
|
||||
|
||||
class LiteLLMDatabaseConnectionPool(Enum):
|
||||
database_connection_pool_limit = 10
|
||||
database_connection_pool_timeout = 60
|
||||
|
||||
|
||||
def append_query_params(url, params) -> str:
|
||||
from litellm._logging import verbose_proxy_logger
|
||||
|
||||
|
|
@ -526,10 +532,12 @@ def run_server(
|
|||
)
|
||||
database_url = general_settings.get("database_url", None)
|
||||
db_connection_pool_limit = general_settings.get(
|
||||
"database_connection_pool_limit", 100
|
||||
"database_connection_pool_limit",
|
||||
LiteLLMDatabaseConnectionPool.database_connection_pool_limit.value,
|
||||
)
|
||||
db_connection_timeout = general_settings.get(
|
||||
"database_connection_timeout", 60
|
||||
"database_connection_timeout",
|
||||
LiteLLMDatabaseConnectionPool.database_connection_pool_timeout.value,
|
||||
)
|
||||
if database_url and database_url.startswith("os.environ/"):
|
||||
original_dir = os.getcwd()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue