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:
-
Navigate to the app section that the URL should open.
-
In the URL, set
runIdentificationKey
to the experiment name:...neptune.ai/{Workspace}/{Project}/runs/...&runIdentificationKey={ExperimentName}&type=experiment
{ExperimentName}
is the name passed to theexperiment_name
argument at run creation. It's displayed in the Name column of the runs table.
Constructing run URL
To construct a URL that opens a particular run, use the following schema:
...neptune.ai/{Workspace}/{Project}/-/run/?customId={CustomRunID}
{CustomRunID}
is the identifier you pass torun_id
at initialization. It's stored in thesys/custom_run_id
attribute.
Example: https://scale.neptune.ai/o/neptune/org/LLM-training-example/-/run/?customId=QFEKX7LGHW
Point URL to specific tab
To target a specific tab in the focused run view, append:
&detailsTab={TabName}
where {TabName}
is one of the following:
metadata
→ All metadata tabcharts
→ Charts tabdashboard
→ Dashboards tab
Constructing URL for filtered view
To create a URL that leads you to a filtered table view, use the query
parameter:
...neptune.ai/{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))
Constructing URL in code
If you have the custom 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')}/-/run/?customId={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/custom_run_id"][0]
print(latest_run_id)
To apply a filter, use
fetch_runs_df()
. For example, to get the latest run created by yourself:from neptune_fetcher import ReadOnlyProject
project = ReadOnlyProject()
latest_run_id = project.fetch_runs_df(
columns=["sys/custom_run_id"],
owners=["YOUR_NEPTUNE_USERNAME"], # replace with your username
)["sys/custom_run_id"].values[0]
print(latest_run_id)
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="PX30SG002")
# Once the run has synchronized, you can fetch its ID from the server
latest_run_id = project.fetch_runs()["sys/custom_run_id"][0] # returns PX30SG002
print(
f"https://scale.neptune.ai/{os.getenv('NEPTUNE_PROJECT')}/-/run/?customId={latest_run_id}"
)
https://scale.neptune.ai/team-alpha/project-x/-/run/?customId=PX30SG002