langchain-claude-code / rules
Cursor rule1 starsChanged 12 months agoMITView on GitHub
LangChain custom chat model integration project conventions
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/claude-sdk/agents.mdcCursor rule
- .cursor/rules/claude-sdk/client.mdcCursor rule
- .cursor/rules/claude-sdk/hooks.mdcCursor rule
- .cursor/rules/claude-sdk/index.mdcCursor rule
- .cursor/rules/claude-sdk/permissions.mdcCursor rule
- .cursor/rules/claude-sdk/query.mdcCursor rule
- .cursor/rules/claude-sdk/tools.mdcCursor rule
- .cursor/rules/claude-sdk/types.mdcCursor rule
- .cursor/rules/langchain/callbacks.mdcCursor rule
- .cursor/rules/langchain-claude-code.mdcCursor rule
- .cursor/rules/langchain/custom-chat-model.mdcCursor rule
- .cursor/rules/langchain/langgraph-integration.mdcCursor rule
- .cursor/rules/langchain/streaming.mdcCursor rule
- .cursor/rules/langchain/tool-calling.mdcCursor rule
The file
Files
--- description: LangChain custom chat model integration project conventions alwaysApply: true --- # LangChain Custom Chat Model Integration ## Overview This project creates custom LangChain chat model integrations that wrap proprietary or private LLM APIs while maintaining full compatibility with LangChain and LangGraph ecosystems. ## Core Architecture ✓ Inherit from `BaseChatModel` for full LangChain compatibility ✓ Use Pydantic for configuration and validation ✓ Implement async-first with sync fallbacks ✓ Support callbacks for observability and tracing ### Required Imports ```python from langchain_core.language_models import BaseChatModel from langchain_core.messages import AIMessage, BaseMessage, HumanMessage, SystemMessage, ToolMessage from langchain_core.outputs import ChatGeneration, ChatResult from langchain_core.callbacks import CallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun ``` ## Implementation Checklist ✓ Implement `_generate()` method (required) ✓ Define `_llm_type` property (required) ✓ Implement `_agenerate()` for native async ✓ Implement `_stream()` for streaming support ✓ Implement `bind_tools()` for tool calling ## See Also - [Custom Chat Model](mdc:langchain/custom-chat-model.mdc) - [Tool Calling](mdc:langchain/tool-calling.mdc) - [Streaming](mdc:langchain/streaming.mdc)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

