This repository contains a collection of demos, utilities, and experiments for working with Large Language Models (LLMs), chat models, embeddings, prompt engineering, and structured output parsing using LangChain, OpenAI, and related tools. It is organized for learning, research, and rapid prototyping.
requirements.txt
langchain_models/
test.py
1. LLMs/
1_llm_demo.py
2. ChatModels/
1_chatmodel_openai.py
2_chatmodel_anthropic.py
3_chatmodel_gemini.py
4_chatmodel_hf.py
3. EmbeddingModel/
1_embedding_openai_query.py
2_embedding_openai_mul.py
3_embedding_hf.py
4_document_similarity.py
langchain_output_parsers/
nodes.md
json_schema.json
Outputs.txt
pydantic_demo.py
tempCodeRunnerFile.py
typeddict_demo.py
with_structured_output_json.py
with_structured_output_pydantic.py
with_structured_output_typeddict.py
langchain_prompts/
chat_history.txt
chat_prompt_template.py
chatbot.py
message_placeholder.py
messages.py
notes.md
prompt_generator.py
prompt_ui.py
template.json
langchain_structured_output/
json_schema.json
notes.md
Outputs.txt
pydantic_demo.py
tempCodeRunnerFile.py
typeddict_demo.py
with_structured_output_json.py
with_structured_output_pydantic.py
with_structured_output_typeddict.py
- LLMs/: Demos for using various LLMs (e.g., OpenAI GPT, Anthropic, Gemini, HuggingFace).
- ChatModels/: Examples of chat-based model usage.
- EmbeddingModel/: Scripts for generating and comparing embeddings, including document similarity.
- Prompt engineering utilities, templates, and UI for research paper summarization and explanation.
- Includes Streamlit-based UI (
prompt_ui.py) for interactive demos.
- Demos for structured output parsing using Pydantic, TypedDict, and JSON schema.
- Example scripts for extracting structured data from LLM outputs.
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Create a
.envfile with your API keys (OpenAI, Anthropic, etc.) as needed.
- Create a
-
Run Streamlit UI:
streamlit run langchain_prompts/prompt_ui.py
-
Run individual scripts:
python path/to/script.py
prompt_ui.py: Streamlit app for research paper summarization/explanation.chatbot.py: Basic chatbot implementation.with_structured_output_*.py: Structured output parsing demos.test.py: General test script for quick experiments.
- Python 3.8+
- See
requirements.txtfor all dependencies.
This project is for educational and research purposes.