This repo contains an open source implementation of NotebookLM that runs on Union. This repo
adapts the NotebookLlama example in Meta's
llama-cookbook
repo.
- 🌠 Workshop slides: https://go.union.ai/odsc-ai-builders-2025
- 📱 Example app: https://square-sound-0c70d.apps.serverless-1.us-east-2.s.union.ai/
To run this workshop, first you need a Github account.
Then, create Union Serverless account here.
Once you've signed up, going to the Union dashboard should look something like this:
On the bottom right, you should see that you have $ 30
in credits, which is
sufficient for running this workshop.
Next, if you don't already have one, create a HuggingFace account. On the HuggingFace website, then, create a HuggingFace API key here.
If you don't already, request access to the Llama 3.2 3B model and Llama 3.2 1B model.
We'll be running this workshop in a Union workspace. To start the default
workspace,
click on the Workspaces button on the left and click on the start switch.
Once started, you can click on Open in VSCode
to open the workspace in your browser.
Pull the repo:
$ git clone https://github.com/unionai-oss/notebook-llama
$ cd notebook-llama
Create a virtual environment
$ python3 -m venv .venv
$ source .venv/bin/activate
Install the requirements:
$ pip install -r requirements.txt
This will install the union
SDK.
Authenticate the workspace session:
$ union create login --auth device-flow --serverless
Then create Union secret for the HuggingFace API key we created in the step above:
$ union create secret huggingface_api_key
You should see a Enter secret value:
prompt to paste on the secret value.
his will create a secret in Union with the name huggingface_api_key
.
Run the workflow with a PDF file from a URL:
$ union run --remote notebook_llama/pdf_to_podcast.py pdf_to_podcast --pdf_path https://www.biorxiv.org/content/10.1101/544593v2.full.pdf
Run the workflow with a local PDF file:
$ union run --remote notebook_llama/pdf_to_podcast.py pdf_to_podcast --pdf_path data/544593v2.full.pdf
First, create Union API key called notebook-llama
for app serving
$ union create api-key admin --name notebook-llama
You can list the api keys you have with:
$ union get api-key admin
Then, create an Union API key for the notebook-llama
app:
$ union create secret union_api_key
Deploy the streamlit app:
$ union deploy apps app.py notebook-llama