How campusx-official/langchain-models works
This repository is a set of standalone LangChain examples, not a combined application. The examples demonstrate a text-completion call, chat-model calls across providers, embedding generation, and embedding-based document similarity. Each script owns its own model invocation and prints the result; there is no shared runtime or orchestration layer. The graph shows provider calls visible in the excerpts. The README is empty, so user-facing workflow and any unexcerpted behavior are not documented.
Main entry points: 4_document_similarity.py Similarity example embeddings · 1_llm_demo.py OpenAI completion demo · 1_chatmodel_openai.py OpenAI chat demo · 2_chatmodel_anthropic.py Anthropic chat demo
Components 19
Text completion
- OpenAI completion demo
1.LLMs/1_llm_demo.py
Chat models
- OpenAI chat demo
2.ChatModels/1_chatmodel_openai.py - Anthropic chat demo
2.ChatModels/2_chatmodel_anthropic.py - Google chat demo
2.ChatModels/3_chatmodel_google.py - Hugging Face API demo
2.ChatModels/4_chatmodel_hf_api.py - Hugging Face local demo
2.ChatModels/5_chatmodel_hf_local.py
Embeddings
- OpenAI query embedding
3.EmbeddingModels/1_embedding_openai_query.py - OpenAI document embeddings
3.EmbeddingModels/2_embedding_openai_docs.py - Local document embeddings
3.EmbeddingModels/3_embedding_hf_local.py - Similarity example embeddings
3.EmbeddingModels/4_document_similarity.py - Cosine similarity ranking
3.EmbeddingModels/4_document_similarity.py
Other components
- OpenAI completion API
- OpenAI chat API
- Anthropic API
- Google generative API
- Hugging Face endpoint
- Local Hugging Face model
- OpenAI embeddings API
- Local embedding model
Connections 11
- OpenAI completion demo → OpenAI completion API: invokes
1.LLMs/1_llm_demo.py - OpenAI chat demo → OpenAI chat API: invokes
2.ChatModels/1_chatmodel_openai.py - Anthropic chat demo → Anthropic API: invokes
2.ChatModels/2_chatmodel_anthropic.py - Google chat demo → Google generative API: invokes
2.ChatModels/3_chatmodel_google.py - Hugging Face API demo → Hugging Face endpoint: invokes
2.ChatModels/4_chatmodel_hf_api.py - Hugging Face local demo → Local Hugging Face model: loads and invokes
2.ChatModels/5_chatmodel_hf_local.py - OpenAI query embedding → OpenAI embeddings API: embeds query
3.EmbeddingModels/1_embedding_openai_query.py - OpenAI document embeddings → OpenAI embeddings API: embeds documents
3.EmbeddingModels/2_embedding_openai_docs.py - Local document embeddings → Local embedding model: embeds documents
3.EmbeddingModels/3_embedding_hf_local.py - Similarity example embeddings → OpenAI embeddings API: embeds query and documents
3.EmbeddingModels/4_document_similarity.py - Similarity example embeddings → Cosine similarity ranking: scores vectors
3.EmbeddingModels/4_document_similarity.py