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]

allow using litellm.messages.acreate and litellm.messages.create

Ishaan Jaff07dce8bed324
diff --git a/litellm/__init__.py b/litellm/__init__.py
index a59484b0351..0080e9551cf 100644
--- a/litellm/__init__.py
+++ b/litellm/__init__.py
@@ -26,6 +26,7 @@ from litellm._logging import (
log_level,
)
import re
+from .messages import *
from litellm.constants import (
DEFAULT_BATCH_SIZE,
DEFAULT_FLUSH_INTERVAL_SECONDS,
diff --git a/litellm/messages/__init__.py b/litellm/messages/__init__.py
new file mode 100644
index 00000000000..1274f768ba7
--- /dev/null
+++ b/litellm/messages/__init__.py
@@ -0,0 +1,16 @@
+"""
+Interface for Anthropic's messages API
+
+Use this to call LLMs in Anthropic /messages Request/Response format
+"""
+
+from litellm.llms.anthropic.experimental_pass_through.handler import (
+ anthropic_messages as _async_anthropic_messages,
+)
+
+
+async def acreate(*args, **kwargs):
+ """
+ Wrapper around Anthropic's messages API
+ """
+ return await _async_anthropic_messages(*args, **kwargs)