A well-organized collection of LangChain examples with proper deployment configuration.
langchain-tutorial/
├── 📚 docs/ # Documentation
│ ├── README.md # Detailed project documentation
│ └── DEPLOYMENT.md # Firebase deployment guide
│
├── 🐍 src/ # Source code
│ ├── chat_model_basic.py # Basic LangChain example
│ └── chat_mode_conversation.py # Streamlit chatbot
│
├── 🚀 deployment/ # Deployment configuration
│ ├── Dockerfile # Container configuration
│ ├── .dockerignore # Docker ignore rules
│ ├── firebase.json # Firebase hosting config
│ └── requirements.txt # Python dependencies
│
├── 📜 scripts/ # Automation scripts
│ └── deploy.sh # Automated deployment script
│
├── 🌐 public/ # Static web assets
│ └── index.html # Loading page
│
├── ⚙️ config/ # Configuration files
│ └── .env.example # Environment variables template
│
└── .env # Environment variables (create this)
# Copy environment template
cp config/.env.example .env
# Edit .env with your API keys
nano .env# Activate conda environment
conda activate your-env-name
# Install packages
pip install -r deployment/requirements.txt# Basic example
python src/chat_model_basic.py
# Streamlit chatbot
streamlit run src/chat_mode_conversation.py# Run automated deployment
./scripts/deploy.sh- Project Documentation - Detailed setup and usage guide
- Deployment Guide - Firebase deployment instructions
Basic Chat Model:
cd src/
python chat_model_basic.pyInteractive Chatbot:
streamlit run src/chat_mode_conversation.pyDocker Build:
docker build -f deployment/Dockerfile -t langchain-chatbot .
docker run -p 8080:8080 --env-file .env langchain-chatbotFirebase Emulator:
firebase emulators:start --only hostingCreate a .env file in the project root:
# Required
OPENAI_API_KEY=your_openai_api_key_here
# Optional (for LangSmith tracing)
LANGCHAIN_API_KEY=your_langchain_api_key_here
LANGCHAIN_TRACING_V2=trueYour Firebase project: chatbotbasic-b9085
- 🔗 Basic LangChain Integration - Simple OpenAI API usage
- 💬 Interactive Streamlit Chatbot - Full conversation interface
- 🧠 Memory Management - Conversation context preservation
- ⚙️ Configurable Models - Multiple GPT model support
- 🐳 Docker Containerization - Production-ready containers
- ☁️ Google Cloud Run - Scalable serverless deployment
- 🌐 Firebase Hosting - Global CDN and SSL
- 🔐 Secure Configuration - Environment variable management
- 📁 Organized Structure - Clean separation of concerns
- 📚 Comprehensive Docs - Step-by-step guides
- 🤖 Automated Scripts - One-command deployment
- 🔧 Local Development - Easy testing and debugging
After deployment, your chatbot will be available at:
- Production:
https://chatbotbasic-b9085.firebaseapp.com
- Fork the repository
- Create a feature branch
- Add your example with proper documentation
- Update the README if needed
- Submit a pull request
This project is for educational purposes. Please ensure you comply with OpenAI's usage policies.
Built with ❤️ using LangChain, OpenAI, and Streamlit
🚀 Happy coding!