Avi Chawla Profile picture
Jan 19 9 tweets 3 min read Read on X
Let's build a multi-agent internet research assistant with OpenAI Swarm & Llama 3.2 (100% local):
Before we begin, here's what we're building!

The app takes a user query, searches the web for it, and turns it into a well-crafted article.

Tool stack:
- @ollama for running LLMs locally.
- @OpenAI Swarm for multi-agent orchestration.
- @Streamlit for the UI.
The architecture diagram below illustrates the key components (agents/tools) & how they interact with each other!

Let's implement it now!
Agent 1: Web search and tool use

The web-search agent takes a user query and then uses the DuckDuckGo search tool to fetch results from the internet. Image
Agent 2: Research Analyst

The role of this agent is to analyze and curate the raw search results and make them ready to use for the content writer agent. Image
Agent 3: Technical Writer

The role of a technical writer is to use the curated results and turn them into a polished, publication-ready article. Image
Create a workflow

Now that we have all our agents and tools ready, it's time to put them together and create a workflow.

Here's how we do it: Image
The Chat interface

Finally we create a Streamlit UI to provide a chat interface for our application.

Done! Image
That's a wrap!

If you enjoyed this tutorial:

Find me → @_avichawla

Every day, I share tutorials and insights on DS, ML, LLMs, and RAGs.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Avi Chawla

Avi Chawla Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @_avichawla

May 12
6 Machine Learning cheat sheets from Stanford's CS 229:
1️⃣ Supervised Machine Learning

Covers:
- Notations & general concepts
- Linear regression
- Generalised linear models
- Gaussian discriminant analysis
- Tree-based & ensemble methods

Check this👇 Image
2️⃣ Unsupervised Machine Learning

Covers:
- PCA
- K-means clustering
- Hierarchical clustering
- Expectation maximization
- Clustering evaluation metrics

Check this👇 Image
Read 9 tweets
May 7
5 Agentic AI design patterns, clearly explained (with visuals):
Agentic behaviors allow LLMs to refine their output by incorporating self-evaluation, planning, and collaboration!

The visual depicts the 5 most popular design patterns for building AI Agents.

Let's understand them below!
1️⃣ Reflection pattern

The AI reviews its own work to spot mistakes and iterate until it produces the final response.

Check this workflow 👇
Read 9 tweets
May 6
Let's generate our own LLM fine-tuning dataset (100% local):
Before we begin, here's what we're doing today!

We'll cover:
- What is instruction fine-tuning?
- Why is it important for LLMs?

Finally, we'll create our own instruction fine-tuning dataset.

Let's dive in!
Once an LLM has been pre-trained, it simply continues the sentence as if it is one long text in a book or an article.

For instance, check this to understand how a pre-trained LLM behaves when prompted 👇 Image
Read 12 tweets
May 4
Let's fine-tune Qwen 3 (100% locally):
Before we begin, here's what we'll be doing.

We'll fine-tune our private and locally running Qwen 3.

To do this, we'll use:
- @UnslothAI for efficient fine-tuning.
- @huggingface transformers to run it locally.

Let's begin!
1️⃣ Load the model

We start by loading the Qwen 3 (14B variant) model and its tokenizer using Unsloth.

Check this code👇 Image
Read 11 tweets
May 2
Tool calling in LLMs, clearly explained (with code):
When generating text, the LLM may need to invoke external tools or APIs to perform tasks beyond its built-in capabilities.

This is known as tool calling, and it turns the AI into more of a coordinator.

Let's dive in!
The process is:

- Recognize when a task requires external assistance.
- Invoke the appropriate tool or API for that task.
- Process the tool's output and integrate it into its response.

Next, let's implement tool calling.
Read 10 tweets
May 1
Let's compare Qwen 3 and DeepSeek-R1 on RAG (100% local):
Today, we're building a Streamlit app to compare Alibaba's latest Qwen 3 against DeepSeek-R1 using RAG.

Here's our tool stack:
- @Llama_Index workflows for orchestration.
- @Cometml Opik for evaluation.
- @ollama to serve both LLMs locally.

Let's begin!
The architecture below illustrates the key components of our RAG app & how they interact with each other!

Let's dive into the implementation below!
Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(