A collection of chatbot applications built with LangChain, exploring different LLM providers and architectures.
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-dotenvAdd to .env:
GROQ_API_KEY=your_groq_api_key
Run:
streamlit run chatbot_using_groq/app.pyA 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.2Run:
ollama serve
streamlit run chatbot_using_ollama/app.pyA 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.2Add 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.pyInstall all dependencies:
pip install -r requirement.txt| 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 |