llama.serve.jupyter package

Launch a Jupyter Notebook server. Specify the domain using environment variable LLAMA_DOMAIN (default: localhost) and the port as LLAMA_JUP_PORT (default: 8080).

llama.serve.jupyter.load_notebook(remote, local, readonly=True, clobber=True)

Copy a distribution LLAMA JUPYTER notebook to the output directory (fetching it first from LLAMA S3 if necessary), set it as trusted, and set its permissions to readonly. Deletes the old notebook if present.

Parameters
  • remote (RemoteFileCacher) – A RemoteFileCacher instance pointing to the file you want to load.

  • local (str or Path) – Local path relative to the OUTPUT_DIR that you’d like to save the remote file as.

  • readonly (bool, optional) – If True, set the notebook to readonly mode so that user’s can’t accidentally break it. Set this to False to allow editing when making changes to the notebook notebook (and remember to commit those changes with llama dev upload).

  • clobber (bool, optional) – If True, overwrite any existing notebook files. In production, you usually want this to be True since it will ensure you get the latest version of the documentation. While developing, you probably want this to be False so that you can keep incrementally modifying your notebook until you’re ready to commit the changes to LLAMA S3.

Returns

local – The path to the local Jupyter notebook.

Return type

pathlib.Path

llama.serve.jupyter.running_servers()

Get a list of running servers as stored in SERVER_LIST_FILE. Returns a list of tuples of the form (server_url, mounted_path) where server_url is the URL that can be used to access the server and mounted_path is the path on the server that the jupyter notebook has mounted. Returns None if SERVER_LIST_FILE does not exist.

Submodules