LangChain
How to route LangChain workloads through Aramm.
LangChain can talk to Aramm through the same OpenAI-compatible endpoint used by the SDK pages. Keep the setup minimal: one base URL, one API key, one model.
What you need
- An Aramm API key
langchain-openaiinstalled- A model id such as
openai/gpt-4o
Quick setup
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="openai/gpt-4o",
api_key=os.environ["ARAMM_API_KEY"],
base_url="https://router.aramm.ai/v1",
)
print(llm.invoke("Say hi").content)Model naming
Use provider/model ids in the model field.
Verify it works
Invoke one chat call and confirm the result is returned normally.
Troubleshooting
401usually means the API key is missing or invalid.model not foundusually means the model id does not exist in Aramm.- If the client cannot connect, confirm the base URL includes
/v1.