Skip to main content

Construct Neptune URLs

You can construct Neptune app URLs based on run or experiment properties.

Constructing experiment URL

If a new run becomes the head of an experiment, Neptune automatically switches to visualizing the new run in the web app.

To construct a URL that opens the run for a given experiment:

  1. Navigate to the app section that the URL should open.

  2. In the URL, set runIdentificationKey to the experiment name:

    neptune.ai/{Workspace}/{Project}/runs/...&runIdentificationKey={ExperimentName}&type=experiment

    {ExperimentName} is the name passed to the experiment_name argument at run creation. It's displayed in the Name column of the experiments table.

Example link: https://scale.neptune.ai/o/neptune/org/LLM-training-example/runs/details?viewId=standard-view&runIdentificationKey=long_YFP0TJYE_d_0.99999_f_0.15_n_100&type=experiment

Constructing run URL

To construct a URL that opens a particular run:

  1. Navigate to the app section that the URL should open.

  2. In the URL, set runIdentificationKey to the run's Neptune ID:

    .../{Workspace}/{Project}/runs/details?runIdentificationKey={RunID}

    {RunID} is the auto-generated Neptune-identifier. It's displayed in the Id column of the experiments table.

Example link: https://scale.neptune.ai/o/neptune/org/LLM-training-example/runs/details?runIdentificationKey=LLMTRAIN-1486

Constructing URL for filtered view

To create a URL that leads you to a filtered table view, use the query parameter:

.../{Workspace}/{Project}/runs/table?viewId=standard-view&query=(...)

For example, to see all runs with the trial tag:

query=((%60sys%2Ftags%60%3AstringSet%20CONTAINS%20%22trial%22))

To see all runs with either the trial or script tag:

query=((%60sys%2Ftags%60%3AstringSet%20CONTAINS%20%22trial%22)%20OR%20(%60sys%2Ftags%60%3AstringSet%20CONTAINS%20%22script%22))

To see all runs with both the trial and script tags:

query=((%60sys%2Ftags%60%3AstringSet%20CONTAINS%20%22trial%22)%20AND%20(%60sys%2Ftags%60%3AstringSet%20CONTAINS%20%22script%22))

Example link: https://scale.neptune.ai/o/neptune/org/LLM-training-example/runs/table?viewId=standard-view&query=((%60sys%2Ftags%60%3AstringSet%20CONTAINS%20%22large%22))

Constructing URL in code

If you have the run ID set to run_id and the project path set to the NEPTUNE_PROJECT environment variable, you can generate the URL with the following Python string:

f"https://scale.neptune.ai/{os.getenv('NEPTUNE_PROJECT')}/runs/details?viewId=standard-view&detailsTab=metadata&runIdentificationKey={run_id}"

Get URL to latest run

To get and print the URL of the latest run in your project, you need the neptune-fetcher package. To install it:

pip install -U neptune-fetcher

Then, to fetch the latest run:

from neptune_fetcher import ReadOnlyProject

project = ReadOnlyProject()
latest_run_id = project.fetch_runs()["sys/id"][0]
print(latest_run_id) # the auto-generated Neptune ID, e.g. "PX-30"

To apply a filter, use fetch_runs_df(). For example, to filter out runs created by someone else:

from neptune_fetcher import ReadOnlyProject

project = ReadOnlyProject()
latest_run_id = project.fetch_runs_df(
columns=["sys/id"],
owners=["YOUR_NEPTUNE_USERNAME"],
limit=1,
)["sys/id"].values[0]

print(latest_run_id) # the auto-generated Neptune ID, e.g. "PX-30"

To get the URL for your run:

import os
from random import random
from neptune_scale import Run
from neptune_fetcher import ReadOnlyProject

project = ReadOnlyProject()

run = Run(run_id=str(random()))
latest_run_id = project.fetch_runs()["sys/id"][0] # the auto-generated Neptune ID, e.g. "PX-30"

print(
f"Run URL: https://scale.neptune.ai/{os.getenv('NEPTUNE_PROJECT')}/runs/details?viewId=standard-view&detailsTab=metadata&runIdentificationKey={latest_run_id}"
)
Result
Run URL: https://scale.neptune.ai/team-alpha/project-x/runs/details?viewId=standard-view&detailsTab=metadata&runIdentificationKey=PX-30