skip to content
lambda

Fighting LLMs using LLMs

Using LLMs to summarize LLM generated slop

Table of Contents

Problem

I like to read a lot of articles, blogs on variety of topics. But due to time constraints, I cannot read everything from bottom to top.

Often, the core ideas are scattered throughout the post, making it difficult to grasp the main points without reading the entire piece.

Plus, good information (signal) often gets buried under fluff (noise). With the rise of LLMs, I feel the signal-to-noise ratio has decreased even further.

ai used to write stuff and its used to summarize stuff

Solution

So I have started using LLMs to summarize stuff for me.

Initially I started by passing the link of post to chatgpt, this had few problems:

  • This flow was tied to ChatGPT
  • I couldn’t just paste the same prompt to claude since it didn’t have access to internet at that time
  • To use the best model available I had to change my workflow everytime

So now I use:

  • firecrawl to scrape content from the URL so it can be passed to an LLM to be summarized.
  • llm-cli to have a common way to interact with LLMs from CLI.
  • glow to render summary which is in markdown format.
  • orbstack to self host firecrawl for magic dns.
  • some shell scripts to glue everything together.

Firecrawl

I self-host firecrawl using orbstack on my machine. If you don’t care about self-hosting it consider using their hosted solution to support the team.

Orbstack

I use orbstack for hosting the firecrawl docker image because it has domain name for each container, so you dont have to manage IP addresses.

LLM CLI

It’s a convenient tool for interacting with various LLMs from the command line.

Gluing everything together

Currently, I’m using fish as my shell, so the examples below are fish shell functions. However, adapting them for other shells shouldn’t be difficult.

Once you have firecrawl set up, define a simple shell function that calls the firecrawl API and parses the Markdown content from the response.

Terminal window
function firecrawl
http api.firecrawl.orb.local/v1/scrape "url=$argv" | jq .data.markdown -r
end

Next, define another shell function. This one calls the previous function to get the post’s Markdown content and then uses llm to summarize it.

Terminal window
set -g user_prompt '
Here is the article that you need to summarize:
'
set -g system_prompt '
You are Summarizer, a large-context reader who produces the shortest possible summary that still captures every non-trivial idea, argument, data point, and conclusion. You need to summarize the provided article by following all the requirments provided by the user. Dont use fancy quotation marks.
Start with giving a single paragraph TL;DR and then summary of the whole post which cover most important points the author wanted to convey.
Output should be in markdown format.
'
function summarize_article
set -l temp_file (mktemp /tmp/article_summary.XXXXXX)
set -l article_link $argv
echo "Article: [$article_link]($article_linkn)" >> $temp_file
firecrawl $article_link | llm -m openai/o3 -s "$system_prompt" "$user_prompt" >> $temp_file
cat $temp_file | glow
echo "wrote to $temp_file"
end

In Action

Here is an example of summarizing this article itself: summarizing this article