Skip to main content

langchain-verda

Use Verda-hosted Kimi K3.1 Pro, DeepSeek V4.1 Flash, and GLM 5.4 models from Python with LangChain's ChatVerda interface. You can call the model directly, stream an answer, or give a Deep Agent tools to use during a conversation.

Install

The package requires Python 3.11 or newer.

uv add langchain-verda

Or, with pip:

pip install langchain-verda

Set up credentials

First, enable a model. In the Verda console, open Inference > Models and click Enable on the model you want. The Quickstart window opens with a new API key for your project. Copy it somewhere safe; it's only shown once.

Set the key in your environment:

export VERDA_INFERENCE_API_KEY="<your-verda-inference-api-key>"

Call a model

from langchain_verda import ChatVerda

chat = ChatVerda(model="kimi-k3-1-pro")
print(chat.invoke("What is prefix caching?").content)

The adapter sends calls to https://inference.verda.com/v1/chat/completions. Use ainvoke for async calls and stream or astream for incremental output. Reasoning text is available in message.additional_kwargs.get("reasoning_content").

Supported models

Model Value for ChatVerda(model=...)
Kimi K3.1 Pro kimi-k3-1-pro
DeepSeek V4.1 Flash 1017 deepseek-4-1-flash-1017
GLM 5.4 glm-5-4

Each model has been tested with tool calling through LangChain's Deep Agents harness, sync and async streaming, async invocation, and token usage reporting in streamed responses.

Stream an answer

from langchain_verda import ChatVerda

chat = ChatVerda(model="deepseek-4-1-flash-1017")
for chunk in chat.stream("What's the best viewpoint in Helsinki?"):
    print(chunk.text, end="", flush=True)
print()

For async applications, use await chat.ainvoke(...) or iterate over chat.astream(...) with async for.

Deep Agents

Install the optional dependency with uv add 'langchain-verda[agents]' or pip install 'langchain-verda[agents]'. The following example invokes the live model and incurs inference charges.

from deepagents import create_deep_agent
from langchain_verda import ChatVerda

def stock_count() -> int:
    """Return the current number of items in stock."""
    return 42

agent = create_deep_agent(model=ChatVerda(model="glm-5-4"), tools=[stock_count])
result = agent.invoke({"messages": [{"role": "user", "content": "Use stock_count to check inventory."}]})
print(result["messages"][-1].content)

Saving model configuration

To restore a chat model, save its model ID and settings and create a new ChatVerda instance. Supply credentials through the environment. LangChain constructor serialization (dumpd / load) is not supported in this alpha.

Development

Development uses uv. From the repository root, run the offline suite and the linter:

make test
make lint

uv run creates .venv and installs the locked dependencies from uv.lock on first use.

The unit tests in tests/unit_tests run with network access blocked. They cover tool-call round trips, streamed tool arguments, usage metadata, reasoning history, and LangChain's standard chat model unit tests. Run make check_versions to repeat them against the declared minimum and newest compatible 1.x version of langchain-openai.

Integration tests

The integration tests in tests/integration_tests call Verda endpoints and are billable. They need all three models enabled and VERDA_INFERENCE_API_KEY set. This runs the smoke tests, then LangChain's standard integration suite against each model:

make integration_test

To test a single model, run make integration_test MODELS=glm-5-4.

License

MIT. See LICENSE.

Metadata

Release files for langchain-verda 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-verda 0.1.1
File Size Uploaded Provenance Actions
langchain_verda-0.1.1.tar.gz 5.9 kB Without provenance Details for langchain_verda-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-verda 0.1.1
File Interpreter ABI Platform Actions
langchain_verda-0.1.1-py3-none-any.whl Python 3 none any Details for langchain_verda-0.1.1-py3-none-any.whl

Total release size: 12.1 kB

Release files / langchain_verda-0.1.1.tar.gz

Download URL langchain_verda-0.1.1.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
76f65aa171e6f6aa3e829e2a4e3fdd0d2ab3484d6eac75448a950f17c03d4365
BLAKE2b-256 checksum
How to use checksums
7fbdeb78b61979d2d571d11c1082166db477aa7864b789f8766519ecc99e5b8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / langchain_verda-0.1.1-py3-none-any.whl

Download URL langchain_verda-0.1.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8dcf5da0f35dc0d07cf9b736134a35a79ea7bc29d204ee932df556a32fd827ba
BLAKE2b-256 checksum
How to use checksums
0277de76fed18b681d81132bbb17bdb16fab6f64af4ae80bb68015252097e57d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for langchain-verda 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page