Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

use vars for batch size and flush interval seconds

Ishaan Jaffe681619381d1
diff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.py
index 505f1ba78d3..ec5632e2783 100644
--- a/litellm/integrations/langsmith.py
+++ b/litellm/integrations/langsmith.py
@@ -24,6 +24,9 @@ from litellm.llms.custom_httpx.http_handler import (
httpxSpecialProvider,
)
+DEFAULT_BATCH_SIZE = 512
+DEFAULT_FLUSH_INTERVAL_SECONDS = 5
+
class LangsmithInputs(BaseModel):
model: Optional[str] = None
@@ -71,11 +74,12 @@ class LangsmithLogger(CustomLogger):
)
_batch_size = (
- os.getenv("LANGSMITH_BATCH_SIZE", 100) or litellm.langsmith_batch_size
+ os.getenv("LANGSMITH_BATCH_SIZE", DEFAULT_BATCH_SIZE)
+ or litellm.langsmith_batch_size
)
self.batch_size = int(_batch_size)
self.log_queue = []
- self.flush_interval = 10 # 5 seconds
+ self.flush_interval = DEFAULT_FLUSH_INTERVAL_SECONDS # 10 seconds
self.last_flush_time = time.time()
asyncio.create_task(self.periodic_flush())
self.flush_lock = asyncio.Lock()
diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml
index 98ca86db3d3..a0e22451b6f 100644
--- a/litellm/proxy/proxy_config.yaml
+++ b/litellm/proxy/proxy_config.yaml
@@ -16,4 +16,6 @@ general_settings:
master_key: sk-1234
litellm_settings:
- success_callback: ["langsmith"]
+ success_callback: ["langsmith", "prometheus"]
+ service_callback: ["prometheus_system"]
+ callbacks: ["otel"]