Introduction

The “Omit Logs” feature is designed for users who may not want to have Helicone store or log their request body or response body. This can be particularly useful for those concerned with privacy, data sensitivity, or simply wanting to keep their data footprint minimal.

Omit requests, responses or both in your logs.

Why Omit Logs

  • Privacy Concerns: Your logs may contain sensitive information such as personally identifiable information (PII) or proprietary data. Omitting certain logs can help maintain privacy and security.
  • Focus on Key Metrics: Omitting requests and responses allows you to focus on capturing key metrics and making it easier to discern the most relevant information related to your LLM application.
  • Regulatory Compliance: In certain industries or regions, there may be regulations or compliance requirements regarding the logging and storage of data. Omitting certain logs may be necessary to ensure compliance with these regulations.

All responses and requests are only stored in memory and never in long-term storage.

There are two ways to omit logs:

  1. Headers: Use this if you’re not using Helicone’s Python Asynchronous Logging.
  2. Helicone Python Async Logging: Use this if you’re using Helicone’s Python Asynchronous Logging and don’t want to send the request or response to our backend.

Headers

Note: This method does not store the request or response but it still sends it to our backend.

To omit logging requests, set Helicone-Omit-Request to true.

To omit logging responses, set Helicone-Omit-Response to true.

Python Async Logging

If you are using Helicone’s Asynchronous Logging, you have the option to not even send the request or response to our backend.

from helicone_async import HeliconeAsyncLogger
from openai import OpenAI

logger = HeliconeAsyncLogger(
  api_key=HELICONE_API_KEY,
)

logger.init()

client = OpenAI(api_key=OPENAI_API_KEY)

logger.disable_content_tracing() # This will omit the request and response from being sent to our backend till the time you call logger.enable_content_tracing()

# Make the OpenAI call
response = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[{"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Who won the world series in 2020?"},
            {"role": "assistant",
             "content": "The Los Angeles Dodgers won the World Series in 2020."},
            {"role": "user", "content": "Where was it played?"}]
)

print(response.choices[0])
logger.enable_content_tracing() # All future requests will be sent with the request and response

Request View

You can still see the key metrics for each request, without the request or response contents.

Focus on capturing key metrics and ignore the noise of the request and response.