Avi Chawla Profile picture
Jan 25 7 tweets 2 min read Read on X
Let's build a mini-ChatGPT that's powered by DeepSeek-R1 (100% local):
Here's a mini-ChatGPT app that runs locally on your computer. You can chat with it just like you would chat with ChatGPT.

We use:
- @DeepSeek_AI R1 as the LLM
- @Ollama to locally serve R1
- @chainlit_io for the UI

Let's build it!
We begin with the import statements and define the start_chat method.

It is invoked as soon as a new chat session starts. Image
Next, we define another method which will be invoked to generate a response from the LLM:

• The user inputs a prompt.
• We add it to the interaction history.
• We generate a response from the LLM.
• We store the LLM response in the interaction history. Image
Finally, we define the main method and run the app as follows: Image
Done!

This launches our 100% locally running mini-ChatGPT that is powered by DeepSeek-R1.
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

Jul 3
uv in Python, clearly explained (with code):
uv is incredibly fast.

- Creating virtual envs. using uv is ~80x faster than python -m venv.
- Package installation is 4–12x faster without caching, and ~100x with caching

Today, let's understand how to use uv for Python package management.

Let's dive in! Image
uv is a Rust-based Python package manager built to be fast and reliable.

It replaces not just pip but also pip-tools, virtualenv, pipx, poetry, and pyenv, all with a single standalone binary.

Here's a uv cheatsheet for Python devs👇

Let's look at the code next!
Read 10 tweets
Jun 29
MCP & A2A (Agent2Agent) protocol, clearly explained (with visuals):
Agentic applications require both A2A and MCP.

- MCP provides agents with access to tools.
- A2A allows agents to connect with other agents and collaborate in teams.

Today, let's clearly understand what A2A is and how it can work with MCP.
What is A2A?

A2A (Agent2Agent) enables multiple AI agents to work together on tasks without directly sharing their internal memory, thoughts, or tools.

Instead, they communicate by exchanging context, task updates, instructions, and data.
Read 8 tweets
Jun 26
10 GitHub repos that will set you up for a career in AI engineering (100% free):
1️⃣ ML for Beginners by Microsoft

A 12-week project-based curriculum that teaches classical ML using real-world datasets using Scikit-learn.

Includes quizzes, R/Python lessons, and hands-on projects. Some of the lessons are available as short-form videos.

Check this👇 Image
2️⃣ AI for Beginners by Microsoft

This repo covers neural networks, NLP, CV, transformers, ethics & more. There are hands-on labs in PyTorch & TensorFlow using jupyter notebooks.

Beginner-friendly, project-based, and full of real-world applications.

Check this 👇 Image
Read 13 tweets
Jun 25
How Agents test Agents, clearly explained (with code):
Today, we'll learn Agent Testing by building a pipeline to test Agents with other Agents using Scenario.

Our open-source tech stack:
- @crewAIInc for Agent orchestration.
- @LangWatchAI Scenario to build the eval pipeline.
- @pytestdotorg as the runner.

Let's begin!
Here's what the process looks like:

1) Define three Agents:
- The Agent you want to test.
- A User Simulator Agent that acts like a real user.
- A Judge Agent for evaluation.

2) Let your Agent and User Agent interact.

3) Evaluate the exchange using Judge Agent.
Read 9 tweets
Jun 24
Let's fine-tune DeepSeek-R1 (distilled Llama) 100% locally:
Before we begin, here's what we'll be doing.

We'll fine-tune our locally running DeepSeek-R1 (distilled Llama variant).

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

Let's begin!
1) Load the model

We start by loading the Distilled Llama-8B model and the tokenizer of DeepSeek-R1 using Unsloth: Image
Read 10 tweets
Jun 22
Let's build an MCP server (100% locally):
Before diving in, here's what we'll be doing today:

- Understand MCP with a simple analogy.
- Build a local MCP server and interact with it via @cursor_ai.
- Integrate @Stagehanddev MCP and interact with it via Claude Desktop (shown in the video).

Let's dive in!
First, let's understand MCP using a translation analogy.

Imagine you only know English. To get info from a person who only knows:

- French, you must learn French.
- German, you must learn German.
- and so on.

Learning even 5 languages will be a nightmare for you!
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!

:(