Skip to main content

A practical utility library for LangChain and LangGraph development

Project description

🦜️🧰 langchain-dev-utils

🚀 High-efficiency toolkit designed for LangChain and LangGraph developers

📚 English中文

GitHub Repo PyPI Python Version License: MIT Last Commit Documentation

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
  • 📊 Convenient State Graph Construction - Provides pre-built functions to easily create sequential or parallel state graphs

⚡ Quick Start

This library is primarily used to connect to models that expose an OpenAI-Compatible API. The example below uses a qwen2.5-7b model served by vLLM.

1. Install langchain-dev-utils

pip install -U "langchain-dev-utils[standard]"

Note: This feature requires installing 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:qwen2.5-7b")
response = model.invoke("Hello")
print(response)

# Create agent
agent = create_agent("vllm:qwen2.5-7b", 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

langchain_dev_utils-1.4.5.tar.gz (277.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_dev_utils-1.4.5-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_dev_utils-1.4.5.tar.gz.

File metadata

  • Download URL: langchain_dev_utils-1.4.5.tar.gz
  • Upload date:
  • Size: 277.2 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

Hashes for langchain_dev_utils-1.4.5.tar.gz
Algorithm Hash digest
SHA256 62f7d98e45fbe16b9821142b5c41b79d6dc2df86baeb16567b874d4cc3726e1f
MD5 e89376d5f4db288fd2b5f1b632974aab
BLAKE2b-256 faea3c9f2d445fe4cf179d6f4b82419c902b97c921c1c56ca73007aaefd4f6c9

See more details on using hashes here.

File details

Details for the file langchain_dev_utils-1.4.5-py3-none-any.whl.

File metadata

  • Download URL: langchain_dev_utils-1.4.5-py3-none-any.whl
  • Upload date:
  • Size: 58.1 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

Hashes for langchain_dev_utils-1.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7da141270d175ba3b8c2cdab48f498d1e90db72f038c38bf2b74f7ad878c3b06
MD5 9a6f2c713bc81dd5b2fdd89da1f04d95
BLAKE2b-256 be80122cdf6f56c443a50419eb4a88aeb337898784161836b9216381745fe1fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page