A practical utility library for LangChain and LangGraph development
Project description
🦜️🧰 langchain-dev-utils
🚀 High-efficiency toolkit designed for LangChain and LangGraph developers
This is the English version. For the Chinese version, please visit 中文版本
✨ Why choose langchain-dev-utils?
Tired of writing repetitive code in LangChain development? langchain-dev-utils is the solution you need! This lightweight yet powerful toolkit is designed to enhance the development experience of LangChain and LangGraph, helping you:
- ⚡ Boost development efficiency - Reduce boilerplate code, allowing you to focus on core functionality
- 🧩 Simplify complex workflows - Easily manage multi-model, multi-tool, and multi-agent applications
- 🔧 Enhance code quality - Improve consistency and readability, reducing maintenance costs
- 🎯 Accelerate prototype development - Quickly implement ideas, iterate and validate faster
🎯 Core Features
- 🔌 Unified model management - Specify model providers through strings, easily switch and combine different models
- 💬 Flexible message handling - Support for chain-of-thought concatenation, streaming processing, and message formatting
- 🛠️ Powerful tool calling - Built-in tool call detection, parameter parsing, and human review functionality
- 🤖 Efficient Agent development - Simplify agent creation process, expand more common middleware
- 📊 Flexible state graph composition - Support for serial and parallel composition of multiple StateGraphs
⚡ Quick Start
1. Install langchain-dev-utils
pip install -U "langchain-dev-utils[standard]"
2. Start using
from langchain.tools import tool
from langchain_core.messages import HumanMessage
from langchain_dev_utils.chat_models import register_model_provider, load_chat_model
from langchain_dev_utils.agents import create_agent
# Register model provider
register_model_provider("vllm", "openai-compatible", base_url="http://localhost:8000/v1")
@tool
def get_current_weather(location: str) -> str:
"""Get the current weather for the specified location"""
return f"25 degrees, {location}"
# Dynamically load model using string
model = load_chat_model("vllm:qwen3-4b")
response = model.invoke("Hello")
print(response)
# Create agent
agent = create_agent("vllm:qwen3-4b", tools=[get_current_weather])
response = agent.invoke({"messages": [HumanMessage(content="What's the weather like in New York today?")]})
print(response)
For more features of this library, please visit the full documentation
🛠️ GitHub Repository
Visit the GitHub repository to view the source code and report issues.
Developed with ❤️ and ☕
If this project helps you, please give us a ⭐️
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_dev_utils-1.2.15.tar.gz.
File metadata
- Download URL: langchain_dev_utils-1.2.15.tar.gz
- Upload date:
- Size: 221.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e37c26998fda1411fe3d24ea98571369fd25d08c002b608a0d75c3385c7769c
|
|
| MD5 |
138dd8d183792c9beb4200e73fec063c
|
|
| BLAKE2b-256 |
9918e79871cb24f8351d6972754a1ae4c792d30f4f557a792eee4bafcdc3d06e
|
File details
Details for the file langchain_dev_utils-1.2.15-py3-none-any.whl.
File metadata
- Download URL: langchain_dev_utils-1.2.15-py3-none-any.whl
- Upload date:
- Size: 49.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
908e3c0fec77d1cf84d6a8b5c92c7dbf848cf0cf9ff0c9ab66d38f73bce5e9d7
|
|
| MD5 |
c26573770642b5a72cafaf0e96fd4352
|
|
| BLAKE2b-256 |
c269d07071f64a30ec1ef27d43682585b7f0e98113ec618259c7e4a90d7f052a
|