Build an Open-NotebookLM with Inferless
In this tutorial you’ll build a serverless Open-NotebookLM that turns any research paper or article into a lively, two-host audio podcast using Inferless.
Key Components of the Application
- Qwen3-32B LLM – Alibaba’s Qwen3-32B dense model(32,768-token context) with state-of-the-art reasoning and open weights.
- Kokoro-82M TTS – 82M parameter multilingual voice model delivering fast, high-fidelity speech from a single GPU.
- PyPDF2 Extraction Layer – lightweight parser that extract text from the PDF.
Crafting Your Application
- Document Intake – The user submits a
pdf_url
, thenextract_pdf_content
fetches the file and supplies the full raw text (often 10k+ tokens) to the LLM. - Deep Summary –
SUMMARIZATION_PROMPT
directs Qwen3 to produce a five‑part breakdown: core ideas, context, challenging concepts, standout facts, and unanswered questions. - Dialogue Generation –
PODCAST_CONVERSION_PROMPT
transforms that summary into a conversation, labeled turn‑by‑turn asAlex:
andRomen:
. - Voice Rendering – Kokoro voices each line alternately using “am_adam” and “af_heart,” inserting 0.5‑second pauses for natural flow.
- Response – The final WAV is base64‑encoded and returned as
generated_podcast_base64
, ready for playback.
Core Development Steps
1. Build the complete Pipeline
Objective: Create the functions that ingests a PDF, summarizes it with Qwen 3-32B, converts that summary into a two-host script, renders speech using Kokoro-82 M, and returns a Base-64 string.
Action:
- Load the reasoning model. Pull the open-weight, Qwen 3-32B (32768-token context).
- Extract document text. Use PyPDF2’s
extract_text()
to extract every page of the user-supplied PDF. - Generate a deep summary. Feed that raw text to Qwen3 with the SUMMARIZATION_PROMPT to obtain the analysis (core ideas, background, tricky concepts, “wow” facts, open questions).
- Convert to dialogue. Invoke the PODCAST_CONVERSION_PROMPT to turn the summary into a conversation between Alex and Romen, each turn tagged for TTS.
- Synthesize speech. Run the script through Kokoro-82M, a TTS model with alternating “am_adam” and “af_heart” and inserting 0.5s pauses for natural pacing.
Setting up the Environment
Here’s how to set up all the build-time and run-time dependencies for your application:
Install the following libraries:
Deploying Your Model with Inferless CLI
Inferless allows you to deploy your model using Inferless-CLI. Follow the steps to deploy using Inferless CLI.
Clone the repository of the model
Let’s begin by cloning the model repository:
Deploy the Model
To deploy the model using Inferless CLI, execute the following command:
Explanation of the Command:
--gpu A100
: Specifies the GPU type for deployment. Available options includeA10
,A100
, andT4
.--runtime inferless-runtime-config.yaml
: Defines the runtime configuration file. If not specified, the default Inferless runtime is used.
Demo of the Book Audio Summary Generator.
Alternative Deployment Method
Inferless also supports a user-friendly UI for model deployment, catering to users at all skill levels. Refer to Inferless’s documentation for guidance on UI-based deployment.
Choosing Inferless for Deployment
Deploying your Open-NotebookLM application with Inferless offers compelling advantages, making your development journey smoother and more cost-effective. Here’s why Inferless is the go-to choice:
- Ease of Use: Forget the complexities of infrastructure management. With Inferless, you simply bring your model, and within minutes, you have a working endpoint. Deployment is hassle-free, without the need for in-depth knowledge of scaling or infrastructure maintenance.
- Cold-start Times: Inferless’s unique load balancing ensures faster cold-starts.
- Cost Efficiency: Inferless optimizes resource utilization, translating to lower operational costs. Here’s a simplified cost comparison:
Scenario
You are looking to deploy a Open-NotebookLM application for processing 100 queries.
Parameters:
- Total number of queries: 50 daily.
- Inference Time: All models are hypothetically deployed on A100 80GB, taking 347.91 seconds to process a request and a cold start overhead of 20.17 seconds.
- Scale Down Timeout: Uniformly 60 seconds across all platforms, except Hugging Face, which requires a minimum of 15 minutes. This is assumed to happen 50 times a day.
Key Computations:
- Inference Duration:
Processing 50 queries and each takes 347.91 seconds
Total: 50 x 347.91 = 17395.5 seconds (or approximately 4.83 hours) - Idle Timeout Duration:
Post-processing idle time before scaling down: (360 seconds - 347.91 seconds) x 50 = 604 seconds (or 0.16 hours approximately) - Cold Start Overhead:
Total: 50 x 20.17 = 1008.5 seconds (or 0.28 hours approximately)
Total Billable Hours with Inferless: 4.83 (inference duration) + 0.16 (idle time) + 0.28 (cold start overhead) = 5.27 hours
Total Billable Hours with Inferless: 5.27 hours
Scenario | On-Demand Cost | Serverless Cost |
---|---|---|
50 requests/day | $28.8 (24 hours billed at $1.22/hour) | $6.43 (5.27 hours billed at $1.22/hour) |
By opting for Inferless, you can achieve up to 77.67% cost savings.
Please note that we have utilized the A100(80 GB) GPU for model benchmarking purposes, while for pricing comparison, we referenced the A10G GPU price from both platforms. This is due to the unavailability of the A100 GPU in SageMaker.
Also, the above analysis is based on a smaller-scale scenario for demonstration purposes. Should the scale increase tenfold, traditional cloud services might require maintaining 2-4 GPUs constantly active to manage peak loads efficiently. In contrast, Inferless, with its dynamic scaling capabilities, adeptly adjusts to fluctuating demand without the need for continuously running hardware.
Conclusion
With this guide, you’re ready to build and deploy a serverless Open-NotebookLM that turns any PDF into a two-host podcast, using state-of-the-art open source models and Inferless. You’ve seen how easy it is to connect PDF parsing, LLM model and high-fidelity speech in a cost-effective pipeline with no server management required. Adapt this blueprint for your own research, education, or content projects.