From 70accb754ec1ceb4f8c12b10a6cfa8a438d4e1a4 Mon Sep 17 00:00:00 2001 From: Krish Dholakia Date: Tue, 29 Apr 2025 18:55:22 -0700 Subject: [PATCH] fix(langsmith.py): respect langsmith batch size param (#10411) * fix(langsmith.py): respect langsmith batch size param * build(model_prices_and_context_window.json): add missing tgai models Fixes https://github.com/BerriAI/litellm/issues/8921 Fixes https://github.com/BerriAI/litellm/issues/8278 --- litellm/integrations/langsmith.py | 6 +-- ...odel_prices_and_context_window_backup.json | 49 +++++++++++++++++++ model_prices_and_context_window.json | 49 +++++++++++++++++++ 3 files changed, 101 insertions(+), 3 deletions(-) diff --git a/litellm/integrations/langsmith.py b/litellm/integrations/langsmith.py index 0914150db9..7035aa3a81 100644 --- a/litellm/integrations/langsmith.py +++ b/litellm/integrations/langsmith.py @@ -41,6 +41,8 @@ class LangsmithLogger(CustomBatchLogger): langsmith_base_url: Optional[str] = None, **kwargs, ): + self.flush_lock = asyncio.Lock() + super().__init__(**kwargs, flush_lock=self.flush_lock) self.default_credentials = self.get_credentials_from_env( langsmith_api_key=langsmith_api_key, langsmith_project=langsmith_project, @@ -61,13 +63,11 @@ class LangsmithLogger(CustomBatchLogger): _batch_size = ( os.getenv("LANGSMITH_BATCH_SIZE", None) or litellm.langsmith_batch_size ) + if _batch_size: self.batch_size = int(_batch_size) self.log_queue: List[LangsmithQueueObject] = [] asyncio.create_task(self.periodic_flush()) - self.flush_lock = asyncio.Lock() - - super().__init__(**kwargs, flush_lock=self.flush_lock) def get_credentials_from_env( self, diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index ba199516e3..6e71a296f3 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -10235,6 +10235,55 @@ "mode": "chat", "supports_tool_choice": true }, + "together_ai/meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/meta-llama/Llama-4-Scout-17B-16E-Instruct": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/meta-llama/Llama-3.2-3B-Instruct-Turbo": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/Qwen/Qwen2.5-7B-Instruct-Turbo": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/Qwen/Qwen2.5-72B-Instruct-Turbo": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/deepseek-ai/DeepSeek-V3": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/mistralai/Mistral-Small-24B-Instruct-2501": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, "ollama/codegemma": { "max_tokens": 8192, "max_input_tokens": 8192, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index ba199516e3..6e71a296f3 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -10235,6 +10235,55 @@ "mode": "chat", "supports_tool_choice": true }, + "together_ai/meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/meta-llama/Llama-4-Scout-17B-16E-Instruct": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/meta-llama/Llama-3.2-3B-Instruct-Turbo": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/Qwen/Qwen2.5-7B-Instruct-Turbo": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/Qwen/Qwen2.5-72B-Instruct-Turbo": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/deepseek-ai/DeepSeek-V3": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, + "together_ai/mistralai/Mistral-Small-24B-Instruct-2501": { + "litellm_provider": "together_ai", + "supports_function_calling": true, + "supports_parallel_function_calling": true, + "mode": "chat", + "supports_tool_choice": true + }, "ollama/codegemma": { "max_tokens": 8192, "max_input_tokens": 8192,