LangChain Widget
Run a LangChain agent in Jupyter notebooks.
An anywidget + React chat UI for LangChain tool-calling chat models, built for notebooks and designed to compose with other Jupyter widgets.
- Works in JupyterLab / Notebook (and VS Code notebooks)
- Tool calling out of the box (your tools, your model)
- Easy to embed alongside plots, tables, and domain widgets
Installation
pip install langchain-widget
Quick start
In a notebook, create a LangChainWidget with your chat model and tools:
from langchain_widget import LangChainWidget
from langchain_openai import ChatOpenAI
from langchain_core.tools import tool
chat_model = ChatOpenAI(model="gpt-4o-mini")
@tool
def add(a: int, b: int) -> int:
"Add two integers."
return a + b
w = LangChainWidget(
chat_model=chat_model,
tools=[add],
system_prompt="You are a helpful scientific assistant.",
)
w
Here is how it looks in a Jupyter notebook:
Documentation
Full documentation at: https://langchain-widget.readthedocs.io/
Development
See langchain-widget/docs/source/development.rst.
Contact
- Xing Wang xingwang1991@gmail.com
License
Metadata
Release files for langchain-widget 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_widget-0.0.1.tar.gz | 72.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_widget-0.0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 148.7 kB
Release files / langchain_widget-0.0.1.tar.gz
| Download URL | langchain_widget-0.0.1.tar.gz |
|---|---|
| Size | 72.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1917dd99f9b912886a874d0ffb08ea0ef80017d9934fcbc3d0da4e380d14c8d1
|
|
BLAKE2b-256 checksum How to use checksums |
c1cf4b22df831a236673b934a528e08fff6dc0dae37e12e7cb9370d8d0e98139
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 17, 2025.
Transparency logRelease files / langchain_widget-0.0.1-py2.py3-none-any.whl
| Download URL | langchain_widget-0.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 75.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4b7ff1280898cfb31d541d71a77bd2482e025870c7413288f0a59ba3906daa60
|
|
BLAKE2b-256 checksum How to use checksums |
e5ad0e1ff5ad8ee95e24706f55a09fb0993c6d0c90c007dbc8d5948a35f5291c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 17, 2025.
Transparency log