From 23e20facb62423d9e4708e516160154912906d76 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 11 Apr 2026 17:43:07 -0700 Subject: [PATCH] feat(advisor): add ADVISOR_MAX_USES, ADVISOR_NATIVE_PROVIDERS, ADVISOR_TOOL_DESCRIPTION constants --- litellm/constants.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/litellm/constants.py b/litellm/constants.py index 337cb1243fb..28bb7747224 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -1421,7 +1421,7 @@ APSCHEDULER_REPLACE_EXISTING = os.getenv( "1", ] # always replace existing jobs -# The number of tag entries are higher than number of user, team entries. This leads to a higher QPS. +# The number of tag entries are higher than number of user, team entries. This leads to a higher QPS. # This will run tag spcific tasks at a later time to smooth QPS DAILY_TAG_SPEND_BATCH_MULTIPLIER = 2.3 @@ -1581,3 +1581,16 @@ MAX_PAYLOAD_SIZE_FOR_DEBUG_LOG = int( MAX_COMPETITOR_NAMES = int(os.getenv("MAX_COMPETITOR_NAMES", 100)) COMPETITOR_LLM_TEMPERATURE = float(os.getenv("COMPETITOR_LLM_TEMPERATURE", 0.3)) DEFAULT_COMPETITOR_DISCOVERY_MODEL = "gpt-4o-mini" + +# Advisor tool orchestration +# Providers that support advisor_20260301 natively (no LiteLLM orchestration needed). +# Add vertex_ai here once verified. +ADVISOR_NATIVE_PROVIDERS: frozenset = frozenset({"anthropic"}) +# Hard cap on advisor iterations per request to prevent runaway loops. +ADVISOR_MAX_USES: int = 5 +# Description injected into the synthetic advisor tool definition sent to non-native providers. +ADVISOR_TOOL_DESCRIPTION: str = ( + "Consult a highly intelligent advisor model when you need expert guidance, " + "want to verify your reasoning, or face a complex decision. " + "Describe your question or challenge clearly in the 'question' field." +)