> ## Documentation Index
> Fetch the complete documentation index at: https://doc.rapida.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LLM Logs

> Monitor and analyze Language Model (LLM) interactions in the Rapida platform

The LLM Logs feature provides detailed information about Language Model (LLM) requests and responses, allowing you to monitor and analyze the performance and behavior of LLM interactions within your system.

## Log Overview

<Frame>
  <img src="https://mintcdn.com/rapidaai/46HA5tZEH71HSx2n/images/activity/llm-logs.png?fit=max&auto=format&n=46HA5tZEH71HSx2n&q=85&s=e3ece6caba05df35731267645347a304" alt="LLM Logs Overview Table" width="3598" height="2018" data-path="images/activity/llm-logs.png" />
</Frame>

The main log view displays a table with the following columns:

* **Source**: Unique identifier for each log entry
* **Provider Name**: The LLM provider (e.g., azure-openai)
* **Model Name**: The specific model used (e.g., gpt-4.1-nano)
* **Created Date**: Timestamp of when the request was made
* **Status**: Current status of the request (e.g., Complete)
* **Time Taken**: Processing time for the request
* **HTTP Status**: Response status code (e.g., 200 for success)

## Detailed Log Entry

Clicking on a log entry reveals more detailed information, divided into several tabs:

### Metadata

<Frame>
  <img src="https://mintcdn.com/rapidaai/46HA5tZEH71HSx2n/images/activity/llm-metadata.png?fit=max&auto=format&n=46HA5tZEH71HSx2n&q=85&s=0bb429a0ff173c534ad8ec83bfc085f0" alt="LLM Logs Metadata Tab" width="1620" height="2022" data-path="images/activity/llm-metadata.png" />
</Frame>

Key performance indicators and request details:

* **LLM\_REQUEST\_ID**: Unique identifier for the request
* **STATUS**: Outcome of the request (e.g., SUCCESS)
* **OUTPUT\_TOKEN**: Number of tokens in the output
* **INPUT\_TOKEN**: Number of tokens in the input
* **TOTAL\_TOKEN**: Total tokens used in the request
* **TIME\_TAKEN**: Processing time in milliseconds

### Request

<Frame>
  <img src="https://mintcdn.com/rapidaai/46HA5tZEH71HSx2n/images/activity/llm-request.png?fit=max&auto=format&n=46HA5tZEH71HSx2n&q=85&s=b8566be2cae08e067aaf027215f7e660" alt="LLM Logs Request Tab" width="1618" height="2020" data-path="images/activity/llm-request.png" />
</Frame>

Contains the original prompt and configuration sent to the LLM:

* **frequency\_penalty**: Adjusts the model's likelihood to repeat itself
* **max\_tokens**: Maximum number of tokens the model can generate
* **messages**: The input prompt and any context provided

### Response

<Frame>
  <img src="https://mintcdn.com/rapidaai/46HA5tZEH71HSx2n/images/activity/llm-response.png?fit=max&auto=format&n=46HA5tZEH71HSx2n&q=85&s=450863edc3aa9c134911f93a1ace989e" alt="LLM Logs Response Tab" width="1616" height="2020" data-path="images/activity/llm-response.png" />
</Frame>

Shows the LLM's output and related metadata:

* **finish\_reason**: Why the LLM stopped generating (e.g., "stop")
* **index**: Position of the response in case of multiple outputs
* **content**: The actual text generated by the LLM

### Metrics

<Frame>
  <img src="https://mintcdn.com/rapidaai/46HA5tZEH71HSx2n/images/activity/llm-metrics.png?fit=max&auto=format&n=46HA5tZEH71HSx2n&q=85&s=0978a121a3d8361976a07a9eaa4a33e6" alt="LLM Logs Metrics Tab" width="1616" height="2022" data-path="images/activity/llm-metrics.png" />
</Frame>

Provides additional metadata about the request:

* **Status**: Final status of the request
* **Time Taken**: Processing duration
* **Request Created Time**: When the request was initiated
* **Response Body**: HTTP status of the response
* **Endpoint Id**: Identifier for the LLM endpoint used
* **Model Id**: Identifier for the specific model
* **Provider Name**: Name of the LLM service provider
* **Vault Id**: Security-related identifier

## Using LLM Logs

1. **Performance Monitoring**: Track response times and token usage to optimize your LLM integration.
2. **Debugging**: Investigate failed requests or unexpected outputs by examining the full request and response details.
3. **Quality Assurance**: Review LLM responses to ensure they meet your application's standards.
4. **Cost Management**: Monitor token usage to manage expenses related to LLM API calls.

## Use Cases

<CardGroup cols={2}>
  <Card title="Optimize Prompts" icon="brain">
    Analyze input-output pairs to refine your prompts for better results and
    efficiency.
  </Card>

  <Card title="Troubleshoot Errors" icon="bug" iconType="duotone">
    Quickly identify and resolve issues by examining detailed error logs and
    response data.
  </Card>

  <Card title="Track Performance" icon="trending-up" iconType="duotone">
    Monitor response times and token usage to ensure optimal system performance.
  </Card>

  <Card title="Ensure Compliance" icon="shield-check" iconType="duotone">
    Review LLM interactions to maintain compliance with internal policies and
    external regulations.
  </Card>
</CardGroup>
