✨ Visual Editor

close

palette Canvas & Background

Gradient:arrow_forward
Text Color:
135°

style Card Style

40px
16px

text_fields Typography

16px
Avi Chawla
@_avichawla
Let's build a mini-ChatGPT that's powered by DeepSeek-R1 (100% local):
Avi Chawla
@_avichawla
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!
Video thumbnail
VIDEO
Avi Chawla
@_avichawla
We begin with the import statements and define the start_chat method.

It is invoked as soon as a new chat session starts.
Thread image
Avi Chawla
@_avichawla
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.
Thread image
Avi Chawla
@_avichawla
Finally, we define the main method and run the app as follows:
Thread image
Avi Chawla
@_avichawla
Done!

This launches our 100% locally running mini-ChatGPT that is powered by DeepSeek-R1.
Video thumbnail
VIDEO
Avi Chawla
@_avichawla
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.
Generated by Thread Navigator
100%
view_carousel Carousel Studio NEW
Press + S to quick-export