Skip to content

Shehjad2019/langchain-ollama-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Local LLM Chat App (Ollama + Llama 3 + LangChain)

A simple, fast, and clean AI chatbot built using:

Ollama (local LLM runner)

Llama 3 model

LangChain LCEL

Streamlit UI

This project shows how to run a real offline LLM chatbot with a modern, chat-style interface.

πŸš€ Features

🧠 Runs Llama 3 locally using Ollama

πŸ’¬ Clean chat UI using Streamlit

πŸ”— Modern LangChain LCEL pipeline (prompt | llm | parser)

πŸ’Ύ Session-based chat history

🎚 Sidebar with model selection

⚑ Instant, smooth responses

πŸ”’ Safe environment variable handling using .env

πŸ“‚ Project Structure local-llm-chat-app/ β”‚ β”œβ”€β”€ app.py β”œβ”€β”€ README.md β”œβ”€β”€ requirements.txt β”œβ”€β”€ .env.example β”œβ”€β”€ .gitignore

πŸ›  Installation 1️⃣ Create virtual environment (optional but recommended) python -m venv venv source venv/bin/activate # Mac/Linux venv\Scripts\activate # Windows

2️⃣ Install dependencies pip install -r requirements.txt

πŸ”§ Environment Variables

Duplicate .env.example and rename it to:

.env

Add your keys:

LANGCHAIN_API_KEY=your_langchain_api_key_here LANGCHAIN_PROJECT=your_project_name_here

(These are optional β€” the app works even without LangSmith.)

πŸ¦™ Install & Run Ollama

Install Ollama from: https://ollama.com

Pull the llama3 model:

ollama pull llama3

Or use:

ollama pull gemma:2b

▢️ Running the App

Start Streamlit:

streamlit run app.py

Your LLM chatbot will open in the browser πŸŽ‰

🧠 Technologies Used

Python

LangChain

LangChain Ollama integration

Streamlit

Llama 3 (via Ollama)

dotenv (environment management)

πŸ‘¨β€πŸ’» Author

Shehjad Patel AI Engineer | LangChain | LLMs | Streamlit | Ollama

About

A LangChain-based chat application running Llama 3 locally via Ollama, featuring a modern Streamlit chat UI and LCEL pipeline.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages