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]

Litellm dev 01 02 2025 p2 (#7512)

Krish Dholakia25e6f4691086
diff --git a/docs/my-website/docs/proxy/logging.md b/docs/my-website/docs/proxy/logging.md
index d665b4a3318..cd89a756a41 100644
--- a/docs/my-website/docs/proxy/logging.md
+++ b/docs/my-website/docs/proxy/logging.md
@@ -109,6 +109,73 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
Removes any field with `user_api_key_*` from metadata.
+
+### Turn off all tracking/logging
+
+For some use cases, you may want to turn off all tracking/logging. You can do this by passing `no-log=True` in the request body.
+
+<Tabs>
+<TabItem value="Curl" label="Curl Request">
+
+```bash
+curl -L -X POST 'http://0.0.0.0:4000/v1/chat/completions' \
+-H 'Content-Type: application/json' \
+-H 'Authorization: Bearer <litellm-api-key>' \
+-d '{
+ "model": "openai/gpt-3.5-turbo",
+ "messages": [
+ {
+ "role": "user",
+ "content": [
+ {
+ "type": "text",
+ "text": "What'\''s in this image?"
+ }
+ ]
+ }
+ ],
+ "max_tokens": 300,
+ "no-log": true # 👈 Key Change
+}'
+```
+
+</TabItem>
+<TabItem value="OpenAI" label="OpenAI">
+
+```python
+import openai
+client = openai.OpenAI(
+ api_key="anything",
+ base_url="http://0.0.0.0:4000"
+)
+
+# request sent to model set on litellm proxy, `litellm --model`
+response = client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages = [
+ {
+ "role": "user",
+ "content": "this is a test request, write a short poem"
+ }
+ ],
+ extra_body={
+ "no-log": True # 👈 Key Change
+ }
+)
+
+print(response)
+```
+
+</TabItem>
+</Tabs>
+
+**Expected Console Log**
+
+```
+LiteLLM.Info: "no-log request, skipping logging"
+```
+
+
## What gets logged?
Found under `kwargs["standard_logging_object"]`. This is a standard payload, logged for every response.
diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py
index 1be9bbf2e12..851fc3f55c1 100644
--- a/litellm/litellm_core_utils/litellm_logging.py
+++ b/litellm/litellm_core_utils/litellm_logging.py
@@ -1005,7 +1005,7 @@ class Logging(LiteLLMLoggingBaseClass):
isinstance(callback, CustomLogger)
and "_PROXY_" in callback.__class__.__name__
):
- print_verbose("no-log request, skipping logging")
+ verbose_logger.info("no-log request, skipping logging")
continue
if callback == "promptlayer" and promptLayerLogger is not None:
print_verbose("reaches promptlayer for logging!")
diff --git a/litellm/llms/deepgram/audio_transcription/transformation.py b/litellm/llms/deepgram/audio_transcription/transformation.py
index 5464888bbee..c8dbd688cc0 100644
--- a/litellm/llms/deepgram/audio_transcription/transformation.py
+++ b/litellm/llms/deepgram/audio_transcription/transformation.py
@@ -106,7 +106,9 @@ class DeepgramAudioTranscriptionConfig(BaseAudioTranscriptionConfig):
stream: Optional[bool] = None,
) -> str:
if api_base is None:
- api_base = "https://api.deepgram.com/v1"
+ api_base = (
+ get_secret_str("DEEPGRAM_API_BASE") or "https://api.deepgram.com/v1"
+ )
api_base = api_base.rstrip("/") # Remove trailing slash if present
return f"{api_base}/listen?model={model}"