Skip to content

RaajveerX/Chaptly

Repository files navigation

Chaptly

Your AI sidekick for content that clicks. Get AI-powered title suggestions and automated topic chapters for your YouTube videos hassle-free.

Why Chaptly

  1. YouTube videos and content in general has to capture a user's attention in mere seconds. A title is the first thing (or second after the thumbnail) that the user reads.
  2. YouTube videos with topic chapters improve retention. When users see chapters, they can quickly jump to the sections that interest them, keeping them engaged.
  3. I wanted to fine-tune an LLM, and mess around with it.

How Chaptly works

  1. Title Generation
  • Current AI models can generate titles for you, but it's obvious they are AI-generated. To fix that, I fine-tuned Gemini Flash using this dataset https://github.com/chris-lovejoy/youtube-titles-and-transcripts, making it smarter and more natural at crafting titles that click.
  • Upon fine-tuning, here's the result I got.
  • Total loss
  • The titles generated by this fine-tuned AI model were way better than the native Gemini model.
  • The generated titles got even better after prompt engineering.
  1. Chapter Generation
  • Just like with title generation, I wanted a model that’s better at topic segmentation and chapter creation.
  • To achieve this, I fine-tuned another model using YouTube transcript data.
  • I scraped YouTube using the YouTube Data v3 API, feeding the model text transcripts as inputs and segmented paragraphs as outputs.
  • Unfortunately, the model didn't perform well and converged at a loss of 10.0.
  • The results were clear, Gemini is better at topic segmentation natively, so with a bit of prompt engineering, I started seeing good results

Tech Stack

  • Database: GCS for storing models, training datasets, and validation datasets
  • APIs: Youtube Data v2, SupaData (For extracting transcripts)
  • Backend: Next.js API Routes, GCP Vertex AI (Where I deployed the two models, one fine-tuned and one native)
  • Frontend: Next.js, React, Tailwind CSS, ShadCN UI

System Design

chaptly drawio

Challenges

Getting transcripts in production was a challenge.

  • youtube-transcript (npm) worked locally but failed in production due to Google blocking cloud IPs.
  • Tried a Google Cloud Run function with a Python package—blocked.
  • Set up a proxy server on DigitalOcean—also blocked.
  • Solution: Used Supadata, which allows 100 free transcript requests per month.

Training and deploying models for free was another challenge.

  • AWS Sagemaker? Realized it’s not free.
  • Hugging Face + T4 GPU (super cheap per hour cost) worked for training, but deployment was difficult.
  • Solution: Used Google Cloud Platform for training and deployment with free credits.

What's Next

  • Enhancing the accuracy of timestamps.
  • Allowing users to upload audio/video (another challenge cost-wise).
  • Deploying the third feature, that lets users upload their video and generate shorts from it.

Live Link

https://chaptly.vercel.app/

App Preview

Chaptly.Commercial.mov

About

Your AI sidekick for content that clicks. Get AI-powered title suggestions and automated topic chapters for your YouTube videos hassle-free.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors