Getting started with DeepRails Monitor takes only a few minutes. It involves 3 simple steps:

1

Create a Monitor

Go to your Krino Console and create a new Monitor for your workflow. Define its purpose and select the Guardrail metrics you want to track. You can also create and manage Monitors using our API.

2

Integrate DeepRails in your code

Integrate DeepRails into your application using our RESTful API or Python SDK.

3

Analyze Monitor Activity in Krino Console

Go to the Krino Console to view activity logs for your Monitor. Explore logged runs, quality metrics, and performance patterns directly from the dashboard.

Get started with DeepRails Monitor

Get Access to DeepRails

To get started, you’ll need access to the DeepRails Krino Console and API.

Get Your API Key

1

Visit the Krino Console

Go to your organization’s Krino Console and select API Keys.

2

Select Create API Key

3

Give your key a distinct name and click Create Key

Install the DeepRails Client

  1. Open a Python notebook or any environment where you want to install DeepRails
  2. Install the python client via pip install deeprails
  3. Next, run the following code to setup DeepRails client. Replace DEEPRAILS_API_KEY with your API Key.
from deeprails import DeepRails

# Initialize the client (replace "YOUR_TOKEN" with a valid token)
client = DeepRails(token="DEEPRAILS_API_KEY")

Create Your Monitor

Go to your Krino Console and create a new Monitor for your workflow. Define its purpose and select the Guardrail metrics you want to track.

Alternatively, you can create a Monitor programmatically using the Python SDK:

name = "History Tutor"
description = "v2, World War II Unit"

monitor_data = {
    "name": name,
    "description": description,
    "metrics": ["correctness", "safety"]
}

monitor_resp = client.monitor.create(monitor_data)
monitor_id = monitor_resp["monitor_id"]

Make sure to save the monitor_id. You’ll need it when logging events associated with this Monitor.

Log Your First Event

After setting up the Monitor, run the following code in your Python environment. Replace the placeholders with your actual data.

prompt = "Why did World War 2 start?"
output = "World War II began because some countries wanted more power and land. Germany and Japan invaded other countries, which caused a big conflict."

event_data = {
    "model_input": {"user_prompt": prompt},
    "model_output": output,
    "temperature": 0.7,
    "top_p": 1.0,
    "model": "gpt-3.5-turbo"
}

event_resp = client.monitor.log(monitor_id, event_data)
print("Monitor event logged:", event_resp)

Explore Results in Krino Console

Once your evaluations are logged:

  1. Open your Krino Console
  2. Navigate to the Monitor you created
  3. View incoming events and track trends across prompt, model, and metric performance
  4. Investigate anomalies, regressions, or drops in quality with detailed Guardrail feedback.

Next Steps