Run Flask server on Gradient Notebook

Hello everyone,

While speaking with the gradient Team, I’ve been told that it is possible to use the Tensorboard port to run a Flask server instead. I’m preparing an ML course for students and want them to quickly setup a Test API on a GPU model to test things.

Here is the code that I run, which works in the cell.

from flask import Flask
import threading

app = Flask(__name__)

def hello():
    return "Hello World!"

threading.Thread(, kwargs={'host':'','port':6006}).start()

It’s not clear to me what is the NOTEBOOK id and CLUSTER id for the public URL.
I tried all combinations unsuccessfully.

Here is the URL of my notebook:

Thank you for your help

Hi @kikohs

The notebook ID can be found on the notebook list view or from the notebook page in the URL. The ID is after /notebook/.... The notebook ID in this case is rkkr56dfsi967qw.

The default notebook cluster ID is clw6rxq2s. (If using a private cluster, you can grab the ID from the clusters page.)

The URL would be:

Hi Daniel,
Thank you for your response.
I’m not sure why but I have a 404 not found and a certificate error. The certificate I could understand but the URL doesn’t seem right.
I recreated another notebook from scratch to be sure.

Here it is:


Hi @kikohs,

Sorry about that - we were mistaken. The ID is not rkkr56dfsi967qw, which is your Repo ID, which doesn’t change. It’s sort of like a project ID. You would need the notebook ID of the current running notebook. You would find it here:

The rest is correct. Let us know how you get on.


No luck…

Anyways the HTTPS is an issue for sure if you want to use it from a client-side thing.