Frameworks
In request path

Bloom Factory for LangChain

Bloom Factory attributes LLM cost to each LangChain chain, agent, customer and feature through a callback handler or a one-line base URL change, then applies budgets and optional routing and caching per workload. Every saving is measured per request against the model you asked for.

Last updated November 15, 2026

What you get with LangChain

Bloom Factory turns LangChain usage into spend by team, agent and customer, priced at your rates, with budgets and alerts that land before the invoice. Here is what shows up in your ledger once the connection is live.

  • Cost per chain, agent run, customer and feature
  • Budgets and hard caps per agent, with every block logged
  • Routing, caching and compaction per workload, measured per request

What access is needed

Bloom Factory asks for the least access that gives it usage and cost data. For LangChain that means the items below. You can revoke access at any time, and nothing here lets Bloom Factory send requests on your behalf.

  • The Bloom SDK or a base URL change in your LangChain model configuration
  • Optional: customer and feature headers for per-customer cost

How to connect LangChain

Setup takes a few minutes and one admin.

  1. 01

    Install the Bloom SDK

    Add the Bloom Factory package to your application and set your Bloom Factory API key.

  2. 02

    Point your model at Bloom Factory

    Set the base URL in your OpenAI-compatible model configuration, or add the Bloom Factory callback handler.

  3. 03

    Tag chains and agents

    Pass agent, customer and feature metadata so every call lands on the right line in the ledger.

  4. 04

    Set budgets and choose optimizations

    Start in watch mode, then enable caps, routing and caching per workload.

Data collected, and not collected

Bloom Factory reads what it needs to price and attribute spend, and nothing more. On read-only connections, prompt and response content is not collected. The lists below are specific to this integration.

Collected

  • Request metadata: model, tokens, latency, cost, agent, customer and feature tags
  • Prompt and completion content only when routing or caching is enabled for that workload, and only as long as needed to serve the request

Not collected

  • Content for workloads in watch mode
  • Your application data outside the model call

LangChain questions

Questions buyers ask before connecting LangChain. Short answers here; your AI Scan call covers the rest.

Is LangChain support read-only?

No. Per-chain attribution needs the SDK or a base URL change in the request path. Provider-level spend still imports read-only through the provider integrations.

Does routing change my prompts?

No. Routing changes the model a request goes to, within the tiers you approve. System prompts are never changed; compaction only trims tool outputs and history.

Can we turn it off per chain?

Yes. Routing, caching and compaction are per workload and can be disabled at any time.

Start with one read-only key.

A free 30-day AI Scan shows every tool, agent and key, who owns it, what it costs, and where the savings are.

Get your free AI Scan