Protocol Compatibility

LangChain with DEVUP AI

Build production-grade AI applications and autonomous agents with LangChain and DEVUP AI. Because DEVUP AI exposes a fully OpenAI-compatible REST API, you can use standard langchain-openai to access 200+ catalog models with LCEL chains, streaming, and tool calling without proprietary wrappers.

Under the hood: LangChain's ChatOpenAI class communicates directly with DEVUP AI's verified OpenAI-compatible endpoint at https://api.devupai.com/v1.
OpenAI Gateway Specs

Architecture Flow

How LangChain Integrates with DEVUP AI

Setting openai_api_base to https://api.devupai.com/v1directs all prompt executions, structured outputs, and streaming iterations to DEVUP AI's high-throughput inference cluster.

1. App Layer
LangChain LCEL
Prompts, Chains & Agents
2. Adapter
ChatOpenAI
langchain_openai client
3. Gateway
DEVUP AI /v1
https://api.devupai.com/v1
4. Execution
Target Model
DeepSeek-V4-Pro, Qwen, etc.

Installation

Install Packages

Install the standard langchain-openai package using pip:

bash
pip install langchain-openai

Configuration

Initialize ChatOpenAI Client

Configure ChatOpenAI with your DEVUP AI API key and point openai_api_base to the platform gateway:

python
import os
from langchain_openai import ChatOpenAI

# Initialize ChatOpenAI pointing to the DEVUP AI gateway
chat = ChatOpenAI(
    openai_api_key=os.environ["DEVUP_API_KEY"],
    openai_api_base="https://api.devupai.com/v1",
    model_name="deepseek-ai/DeepSeek-V4-Pro",
)
Tip: You can also set OPENAI_API_BASE="https://api.devupai.com/v1" and OPENAI_API_KEY directly in your environment to run standard LangChain code without specifying parameters.

Text Generation

One-Shot Generation with invoke

Execute standard chat completion calls using the unified invoke method:

python
from langchain_openai import ChatOpenAI

# Initialize the DEVUP AI endpoint
chat = ChatOpenAI(
    openai_api_key="your-devup-api-key",
    openai_api_base="https://api.devupai.com/v1",
    model_name="deepseek-ai/DeepSeek-V4-Pro",
)

response = chat.invoke("Hello, DEVUP AI!")
print(response.content)

Real-Time Streaming

Token Streaming with stream

Stream response tokens in real-time by setting streaming=True and iterating over response chunks:

python
from langchain_openai import ChatOpenAI

chat = ChatOpenAI(
    openai_api_key="your-devup-api-key",
    openai_api_base="https://api.devupai.com/v1",
    model_name="deepseek-ai/DeepSeek-V4-Pro",
    streaming=True,
)

for chunk in chat.stream("Explain quantum computing in 3 sentences."):
    print(chunk.content, end="", flush=True)

LCEL Composition

Building Pipelines with LCEL

Compose prompts, models, and parsers into production pipelines using the pipe (|) operator:

python
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate

chat = ChatOpenAI(
    openai_api_key="your-devup-api-key",
    openai_api_base="https://api.devupai.com/v1",
    model_name="deepseek-ai/DeepSeek-V4-Pro",
)

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are a senior {language} developer."),
    ("human", "{question}"),
])

chain = prompt | chat

response = chain.invoke({
    "language": "Python",
    "question": "What is the best way to handle async in Python 3.12?",
})

print(response.content)

Capabilities Matrix

Verified LangChain Features

ChatOpenAI & Invocation

Full compatibility with LangChain's standard OpenAI chat model integration.

  • Compatible with chat.invoke() and batching
  • Token-by-token streaming via chat.stream()
  • Async execution with ainvoke() and astream()

LCEL & Advanced Workflows

Composable pipeline orchestration with output parsing and tool calling.

  • Compatible with LangChain Expression Language (| operator)
  • Structured outputs with Pydantic via with_structured_output
  • Tool and function binding via bind_tools

Configuration Parameters

ParameterTypeDefaultDescription
openai_api_basestr"https://api.devupai.com/v1"DEVUP AI OpenAI-compatible endpoint URL
openai_api_keystros.environ["DEVUP_API_KEY"]Your DEVUP AI API key from dashboard
model_namestr"deepseek-ai/DeepSeek-V4-Pro"Any active model identifier from the DEVUP AI catalog
temperaturefloat0.7Sampling temperature between 0.0 and 2.0
streamingboolFalseEnable real-time token streaming

Build AI Applications with LangChain Today

Get your API key, configure ChatOpenAI with our base URL, and build production chains with Algerian Dinar billing.