A clean and modular collection of LangChain chat model integrations using multiple LLM providers including OpenAI, Google Gemini, Anthropic Claude, and Hugging Face.
- Python
- LangChain
- OpenAI API
- Google Gemini API
- Anthropic API
- Hugging Face
- Transformers
- python-dotenv
langchain-chat-models/
│
├── models/
│ ├── openai_chat_model.py
│ ├── gemini_chat_model.py
│ ├── anthropic_chat_model.py
│ ├── huggingface_endpoint.py
│ └── huggingface_pipeline.py
│
├── screenshots/
├── .env.example
├── .gitignore
├── requirements.txt
└── README.md- Multi-provider LLM integration
- API-based and local model execution
- LangChain chat model abstraction
- Environment variable management
- Clean and beginner-friendly implementation
git clone https://github.com/your-username/langchain-chat-models.gitcd langchain-chat-modelspip install -r requirements.txtCreate a .env file and add the following keys:
OPENAI_API_KEY=your_openai_api_key
GOOGLE_API_KEY=your_google_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
HUGGINGFACEHUB_API_TOKEN=your_huggingface_api_tokenExample:
python models/openai_chat_model.pySimilarly, you can run:
gemini_chat_model.pyanthropic_chat_model.pyhuggingface_endpoint.pyhuggingface_pipeline.py
- LangChain chat model integrations
- Prompt invocation using
.invoke() - Working with multiple LLM providers
- Hugging Face endpoints and pipelines
- API key and environment management
Vrundali Rahangdale