Mimi's Work in Progress logo

Mimi's Work in Progress

Subscribe
Archives
November 14, 2024

Resourceful - Putting an LLM into Chrome

Monday 11th November, 16:07pm

View this post on my website →

The inspiration for this project came from discovering the Gemini UI in Google Workspace tools. It's a great example of AI integrating well into your existing behaviours and supporting work you're already doing. I found myself wanting to take that side panel with me when I went to other webpages...

This GIF is owned and made by Google. Original Google blog post here.

I want:
- To ask an LLM about the webpage I'm on without copy-pasting the full text into ChatGPT/Claude/Gemini.
- To find the key parts of a long blog post my boss sent me.
- An LLM there in Chrome where I need it.

Google, I don't understand why you haven't done this already? Please make my project obsolete, thanks :).

I'm not a big fan of Javascript, but, after passing the documentation for Chrome Side Panels into Claude, I was able to put together exactly what I imagined.

How does it work?
1. Pulls the text (document.body.innerText) from the webpage you're on
2. Passes the first 3000 characters to the LLM (${pageContent.substring(0, 3000)})
3. Shows "..." while OpenAI generates a response
4. Displays AI response and supports follow up conversation

Ta-da!

Next steps
Things I would like to add to this:
1. Figure out the best number of characters to use to prevent maxing out context window
2. Support markdown for more readable answers
3. Add support for Ollama model
4. Add "New conversation" button

---

View this project on GitHub →

Don't miss what's next. Subscribe to Mimi's Work in Progress:
This email brought to you by Buttondown, the easiest way to start and grow your newsletter.