LangChain alternative

LangChain is powerful,but running it in production isn’t.

ModelRiver lets you build, test, and run reliable AI workflows without stitching tools together. Set up the models, backups and limits for each workflow in the console, then call it with one API, on its own or from LangChain.

Why teams look for a LangChain alternative

LangChain gives you building blocks. The production work around them is yours, and these are the parts teams most often end up building.

What ModelRiver does instead

Each workflow is set up once in the console. Your app, or LangChain, calls it by name.

app.py
from langchain_openai import ChatOpenAI

# Point LangChain at ModelRiver. model is your workflow’s name.
llm = ChatOpenAI(
    base_url="https://api.modelriver.com/v1",
    api_key="mr_live_...",
    model="support-reply",
)

llm.invoke("Where is my order #4521?")
  • Backups built in

    Each workflow has a primary model and up to 2 backups. Errors, timeouts and rate limits move the request to the next one.

  • Every request logged

    Provider, model, tokens, cost, duration and every attempt are in the request logs.

  • Answers in the shape you asked for

    Give a workflow a JSON schema and every response is checked against it. A mismatch goes to the next backup.

  • Limits on spending

    Cap spending per project and per model, so a loop in an agent can’t run up the bill.

LangChain vs ModelRiver

Two different kinds of tool. Here is what each one gives you.

TopicLangChainModelRiver
What it isAn open-source framework you run inside your appA hosted AI backend you call over an API
Where models are setIn your codeIn the console, per workflow
Provider backupsFallbacks you write in codeUp to 2 backups per workflow
Request logsAdd a tracing tool such as LangSmithBuilt in, with every attempt
Structured outputOutput parsers in your codeJSON Schema checked on every response
Response cacheSet up in your codeExact-match cache per workflow
Spending limitsNot includedPer project and per model
Chains, agents and retrievalA large set of building blocksNot a framework for these; use it with LangChain

Which one fits

Use LangChain if

  • You need full control over every component.
  • You are building agents, chains or retrieval with many custom parts.
  • You want an open-source library you host yourself.

Use ModelRiver if

  • You want backups, logs and limits without building them.
  • You want to change models without a code change.
  • You want to keep LangChain and add these underneath it.

Many teams use both: LangChain for the logic, ModelRiver for the model calls.

Frequently asked questions

Is ModelRiver a full replacement for LangChain?

No. LangChain is a framework for building chains, agents and retrieval in code. ModelRiver runs the model calls, with backups, request logs, structured output and limits. Many teams use both.

Can I still use LangChain with ModelRiver?

Yes. Point ChatOpenAI at the ModelRiver API with your API key, and set model to a workflow name. Your chains and agents keep working.

Does streaming work through LangChain?

Yes. Streaming requests through the OpenAI-compatible API come back as server-sent events. Workflows with a structured output can’t be streamed.

What does ModelRiver cost?

There is a free plan with 25,000 requests a month. You use your own provider keys and pay your AI providers directly.

Docs and next reads

Keep LangChain. Run it on ModelRiver.

Start on the free plan, create a workflow, and point ChatOpenAI at it.