Skip to main content

langchain-valta

Hard spending limits for LangChain agents. Enforces budget policies before any paid operation fires.

Install

pip install langchain-valta

Quickstart

from langchain_valta import ValtaBudgetTool
from langchain_openai import ChatOpenAI
from langchain.agents import initialize_agent, AgentType

guard = ValtaBudgetTool(
    api_key="vk_live_...",   # from valta.co/dashboard/api-keys
    agent_id="my-agent",
)

agent = initialize_agent(
    tools=[guard, ...your_other_tools],
    llm=ChatOpenAI(model="gpt-4o"),
    agent=AgentType.OPENAI_FUNCTIONS,
    agent_kwargs={
        "system_message": (
            "Before any paid operation, call check_spend with the estimated cost. "
            "Only proceed if the result is 'approved'."
        )
    },
)

How it works

The agent calls check_spend before any paid operation. Valta evaluates the request against the user's policy and returns approved or denied: <reason> before the charge fires.

Response Meaning
approved Spend is within policy — proceed
denied: daily_limit_exceeded Would exceed daily budget
denied: insufficient_balance Wallet balance too low
denied: requires human approval Above approval threshold — check dashboard

Policy management

Set limits at valta.co/dashboard/policies. Changes take effect immediately — no redeploy needed.

Metadata

Release files for langchain-valta 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-valta 0.1.1
File Size Uploaded
langchain_valta-0.1.1.tar.gz 4.5 kB Details

Built distribution (wheel)

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

Total release size: 9.4 kB

Release files / langchain_valta-0.1.1.tar.gz

Download URL langchain_valta-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4c15b23a1a07c3fba1cdf58a787de5ae8a3abf63b125020af99bf674b00d3ab3
BLAKE2b-256 checksum
How to use checksums
0ee1b8d083d9e154621c1b63e03e9c7bcabc1c98b9c5aaa6d214b36e93b249b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

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

Download URL langchain_valta-0.1.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f1178ce65e7108c6f7d05b0132dfe3c8b00ad1d4adf47202a59fd899734de09
BLAKE2b-256 checksum
How to use checksums
38ca0aef0aaa66c58c52d65370ce8a24f128bc188cf6c2efd4f2b895f0b600b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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