Skip to content
LangChain

WhichModel for LangChain

io.github.which-model/whichmodel

Cost-optimized LLM model routing recommendations for autonomous AI agents

client:LangChain transport:streamable-http

Install WhichModel in LangChain

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
        "whichmodel": {
            "transport": "streamable_http",
            "url": "https://whichmodel.dev/mcp",
        }
})

tools = await client.get_tools()

get_tools() returns the server's tools as LangChain tools, ready for an agent. LangChain docs

WhichModel in other clients