Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LangChain Chatbot Projects

A collection of chatbot applications built with LangChain, exploring different LLM providers and architectures.

Projects

1. Chatbot with Groq (chatbot_using_groq/)

A simple chatbot using Groq's free API with the LLaMA 3.1 model.

Stack: LangChain, Groq, Streamlit

Setup:

pip install langchain-groq streamlit python-dotenv

Add to .env:

GROQ_API_KEY=your_groq_api_key

Run:

streamlit run chatbot_using_groq/app.py

2. Chatbot with Ollama (chatbot_using_ollama/)

A chatbot running entirely locally using Ollama with the LLaMA 3.2 model. No API key required.

Stack: LangChain, Ollama, Streamlit

Setup:

pip install langchain-ollama streamlit python-dotenv
ollama pull llama3.2

Run:

ollama serve
streamlit run chatbot_using_ollama/app.py

3. API Chatbot (api/)

A production-style client-server architecture with a FastAPI backend exposing multiple LLM endpoints and a Streamlit frontend.

Stack: LangChain, FastAPI, LangServe, Groq, Ollama, Streamlit

Endpoints:

  • POST /essay/invoke - Generate an essay using Groq (LLaMA 3.1)
  • POST /poem/invoke - Generate a poem using Ollama (LLaMA 3.2)
  • POST /groq/invoke - Direct Groq LLM endpoint

Setup:

pip install langchain-groq langchain-ollama fastapi langserve uvicorn sse-starlette streamlit python-dotenv
ollama pull llama3.2

Add to .env:

GROQ_API_KEY=your_groq_api_key
LANGCHAIN_API_KEY=your_langsmith_api_key
LANGCHAIN_PROJECT=your_project_name

Run:

# Terminal 1 - start backend
python api/app.py

# Terminal 2 - start frontend
streamlit run api/client.py

Requirements

Install all dependencies:

pip install -r requirement.txt

Environment Variables

Variable Required For Description
GROQ_API_KEY Groq chatbot, API chatbot Free API key from console.groq.com
LANGCHAIN_API_KEY All (optional) LangSmith tracing key
LANGCHAIN_PROJECT All (optional) LangSmith project name

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages