Logo

dev-resources.site

for different kinds of informations.

Langchain Chat Assistant using Chainlit App

Published at
8/21/2024
Categories
langchain
openai
ollama
chainlit
Author
jivaniyash
Categories
4 categories in total
langchain
open
openai
open
ollama
open
chainlit
open
Author
10 person written this
jivaniyash
open
Langchain Chat Assistant using Chainlit App

Hey there! If you're excited about building your own AI assistant using Langchain and Chainlit, you're in the right place. In this post, I'll walk you through the steps to set up a simple yet powerful AI assistant. Let’s dive in!

Demo

This is Video Demo recording.

Steps to Configure

Follow these steps to configure the app on your machine!

1. Clone Git Repo

git clone https://github.com/jivaniyash/langchain-chat-assistant.git
cd ./langchain-chat-assistant
Enter fullscreen mode Exit fullscreen mode

2. Create & Activate Virtual Env

sudo apt install python3.11-venv
python3 -m venv .venv
source ./.venv/bin/activate
python3 -m pip install --upgrade pip
Enter fullscreen mode Exit fullscreen mode

3. Install Packages

pip install chainlit langchain_openai langchain
Enter fullscreen mode Exit fullscreen mode

4. Run the script

chainlit run ./app/main_openai.py -w
Enter fullscreen mode Exit fullscreen mode

-w flag to enable auto-reloading

This will open a web browser automatically. If not, please copy this link - localhost:8000 into the web browser.


Customize

  • Now, you can customize your app to specific use cases by changing System Prompt from ./utils/systemPrompt.md.

  • Add New Functions to tailor your use-cases from ./utils/functions.py. Also, if you need to connect using local database, csv, or Excel or any other data files; add those files under ./assests/ directory. fetchFromLocalDB function explains how to configure adding new data sources.

Run Local LLM using OLLAMA APIs

If you want to run your assistant using local LLM running in OLLAMA, please follow these steps.

And there you have it! You can now build and run your own AI assistant using OpenAI or OLLAMA. Enjoy exploring the possibilities!

Please look at my GitHub Repo to get a glance over the files.

ollama Article's
30 articles in total
Favicon
What is ollama? Is it also a LLM?
Favicon
Semantic Kernel: Crea un API para GeneraciΓ³n de Texto con Ollama y Aspire
Favicon
Local AI apps with C#, Semantic Kernel and Ollama
Favicon
Running Out of Space? Move Your Ollama Models to a Different Drive πŸš€
Favicon
Working with LLMs in .NET using Microsoft.Extensions.AI
Favicon
Building an Ollama-Powered GitHub Copilot Extension
Favicon
Step-by-Step Guide: Write Your First AI Storyteller with Ollama (llama3.2) and Semantic Kernel in C#
Favicon
Run LLMs Locally with Ollama & Semantic Kernel in .NET: A Quick Start
Favicon
How to Set Up a Local Ubuntu Server to Host Ollama Models with a WebUI
Favicon
Ollama 0.5 Is Here: Generate Structured Outputs
Favicon
Building AI-Powered Apps with SvelteKit: Managing HTTP Streams from Ollama Server
Favicon
Run Llama 3 Locally
Favicon
Building 5 AI Agents with phidata and Ollama
Favicon
Run Ollama on Intel Arc GPU (IPEX)
Favicon
Quick tip: Running OpenAI's Swarm locally using Ollama
Favicon
Langchain4J musings
Favicon
How to deploy SmolLM2 1.7B on a Virtual Machine in the Cloud with Ollama?
Favicon
Ollama - Custom Model - llama3.2
Favicon
Coding Assistants and Artificial Intelligence for the Rest of Us
Favicon
Using a Locally-Installed LLM to Fill in Client Requirement Gaps
Favicon
Create Your Own Local AI Chatbot with Ollama and LangChain
Favicon
Consuming HTTP Streams in PHP with Symfony HTTP Client and Ollama API
Favicon
Llama 3.2 Running Locally in VSCode: How to Set It Up with CodeGPT and Ollama
Favicon
Ollama Unveiled: Run LLMs Locally
Favicon
No Bullshit Guide to Youtube shorts automation in NodeJS, OpenAI, Ollama, ElevanLabs & ffmpeg
Favicon
Unloading a model from Ollama
Favicon
OLLAMA + LLAMA3 + RAG + Vector Database (Local, Open Source, Free)
Favicon
The 6 Best LLM Tools To Run Models Locally
Favicon
Demystifying AI of Your Own
Favicon
Langchain Chat Assistant using Chainlit App

Featured ones: