LangChain Integration: Build AI Chains with 400+ Models
Use Vincony as your LLM provider in LangChain — access 400+ models through a single API key with automatic failover and cost tracking.
Why Use Vincony with LangChain?
LangChain is the most popular framework for building LLM applications. By using Vincony as your LLM provider, you get access to 400+ models from every major provider through a single API key — with automatic failover, cost tracking, and model comparison built in.
Quick Setup
from langchain_openai import ChatOpenAI
from langchain.chains import LLMChain
from langchain.prompts import ChatPromptTemplate
# Point LangChain at Vincony's OpenAI-compatible endpoint
llm = ChatOpenAI(
model="gpt-4.1",
api_key="YOUR_VINCONY_API_KEY",
base_url="https://api.vincony.com/v1"
)
# Now use any LangChain feature — chains, agents, tools
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful coding assistant."),
("human", "{question}")
])
chain = prompt | llm
response = chain.invoke({"question": "Explain async/await in Python"})
print(response.content)Multi-Model Chains
The real power is using different models for different stages. Use a fast model for classification, a powerful model for reasoning, and a cheap model for formatting — all through the same Vincony API.
from langchain.chains import SequentialChain
# Stage 1: Fast classification with Gemini Flash
classifier = ChatOpenAI(
model="gemini-2.5-flash",
api_key="YOUR_VINCONY_API_KEY",
base_url="https://api.vincony.com/v1"
)
# Stage 2: Deep reasoning with Claude
reasoner = ChatOpenAI(
model="claude-sonnet-4",
api_key="YOUR_VINCONY_API_KEY",
base_url="https://api.vincony.com/v1"
)
# Stage 3: Formatting with a fast model
formatter = ChatOpenAI(
model="gpt-4.1-mini",
api_key="YOUR_VINCONY_API_KEY",
base_url="https://api.vincony.com/v1"
)
# Chain them together — Vincony tracks cost across all models
classify_chain = classify_prompt | classifier
reason_chain = reason_prompt | reasoner
format_chain = format_prompt | formatterLangChain Agents with Vincony
Build ReAct agents that use tools like web search, code execution, and database queries. Vincony's function-calling support works seamlessly with LangChain's agent framework.
Callbacks & Observability
Vincony's callback handler integrates with LangChain's callback system to provide token-level cost tracking, latency metrics, and full trace visualization for every chain execution.
Pricing
LangChain integration uses standard Vincony credit pricing. No additional charges. All 400+ models are accessible through the OpenAI-compatible endpoint.
Try It Free — 100 API Credits
Start using these tools today with Vincony's free Developer plan.
Get Free API Key