Python Ecosystem Integration

Build AI Applications in Python with DEVUP AI

Connect standard Python AI libraries including OpenAI, Anthropic, LangChain, and AutoGen directly to DEVUP AI's high-performance inference endpoints. No proprietary DEVUP AI Python wrapper required.

Ecosystem Architecture

Standard Python Libraries, Zero Proprietary Wrapper

Step 1
Python Application

Custom services, data pipelines, web backends, or agent workflows.

Step 2
Standard Libraries

Official openai, anthropic, langchain-openai, or pyautogen packages.

Step 3
Compatible Endpoint

https://api.devupai.com/v1 or /anthropic.

Step 4
DEVUP AI Gateway

High-throughput GPU inference cluster with transparent Algerian Dinar (DZD) billing.

Installation

Install the Standard OpenAI Python Client

DEVUP AI exposes standard OpenAI REST endpoints. Install the official OpenAI Python package from PyPI:

bash
pip install openai
PROTOCOL
OpenAI v1 REST
PYPI PACKAGE
openai
WRAPPER OVERHEAD
0 Proprietary Deps
TOOLING
Standard PyPI

Quickstart

Client Initialization & First Chat Completion

Initialize the standard OpenAI client with your DEVUP AI credentials and custom base_url. The example below uses the documented deepseek-ai/DeepSeek-V4-Pro example model:

python
import os
from openai import OpenAI

# Initialize the standard OpenAI client configured for DEVUP AI
client = OpenAI(
    api_key=os.environ.get("DEVUP_API_KEY"),
    base_url="https://api.devupai.com/v1",
)

response = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",  # Example model
    messages=[
        {
            "role": "system",
            "content": "You are a concise technical assistant.",
        },
        {
            "role": "user",
            "content": "Explain artificial intelligence in one paragraph.",
        },
    ],
)

print(response.choices[0].message.content)

Streaming

Real-Time Token Streaming in Python

Enable token-by-token streaming by setting stream=True. The response returns an iterable generator yielding delta chunks in real time:

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("DEVUP_API_KEY"),
    base_url="https://api.devupai.com/v1",
)

stream = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4-Pro",  # Example model
    messages=[
        {"role": "user", "content": "Write a short poem about Algeria."}
    ],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content is not None:
        print(content, end="", flush=True)
print()

Embeddings

Vector Embeddings Generation

Generate dense vector representations for semantic search and retrieval systems using the documented Qwen/Qwen3-Embedding-8B example model. Both single strings and batch string arrays are supported:

python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ.get("DEVUP_API_KEY"),
    base_url="https://api.devupai.com/v1",
)

response = client.embeddings.create(
    model="Qwen/Qwen3-Embedding-8B",  # Example embedding model
    input="The food was delicious and the service was excellent.",
)

vector = response.data[0].embedding
print(f"Embedding dimensions: {len(vector)}")
Multi-Protocol Compatibility

Anthropic Messages API

Use the Official Anthropic Python Client

DEVUP AI also provides native protocol compatibility for the Anthropic Messages API. Point the official anthropic Python client to https://api.devupai.com/anthropic:

bash
pip install anthropic
python
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.devupai.com/anthropic",
    api_key=os.environ["DEVUP_API_KEY"],
)

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "What is the capital of Algeria?"}
    ],
)

print(message.content[0].text)
Need Claude Code CLI or advanced Anthropic format guidance?View Anthropic Messages Documentation

Frameworks & Agents

LangChain & Multi-Agent Systems

Standard Python orchestration frameworks connect directly to DEVUP AI by configuring the OpenAI-compatible base URL:

LangChain

langchain-openai

Use the ChatOpenAI class with openai_api_base to run LCEL prompt chains, .invoke(), and .stream().

bash
pip install langchain-openai
python
import os
from langchain_openai import ChatOpenAI

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",
)

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

pyautogen

Build multi-agent conversational pipelines by setting the agent config_listto DEVUP AI's endpoint.

bash
pip install pyautogen
python
import os
import autogen

config_list = [
    {
        "model": "deepseek-ai/DeepSeek-V4-Pro",
        "base_url": "https://api.devupai.com/v1",
        "api_key": os.environ["DEVUP_API_KEY"],
    }
]

assistant = autogen.AssistantAgent("assistant", llm_config={"config_list": config_list})
user_proxy = autogen.UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding"})
user_proxy.initiate_chat(assistant, message="What is machine learning?")

Capabilities

Python Ecosystem Capability Matrix

Verified features available when integrating through standard Python clients:

Chat Completions

Multi-turn dialogues via standard openai client.

Token Streaming

Synchronous generator chunk streaming with stream=True.

Vector Embeddings

Single and batch embeddings via client.embeddings.create.

Tool Calling

JSON Schema tool definitions and tool_choice="auto".

Structured JSON

Structured JSON responses via response_format.

Anthropic Messages

Messages API compatibility via official anthropic client.

LangChain Chains

Prompt templates and LCEL pipelines with ChatOpenAI.

Multi-Agent Systems

Autonomous multi-agent orchestration via pyautogen.

Authentication & Security

Credentials & Endpoint Configuration

OpenAI-Compatible Authentication

  • Base URL: https://api.devupai.com/v1
  • Header: Authorization: Bearer <API_KEY>
  • Environment Variable: DEVUP_API_KEY is a developer convention. Pass it explicitly to api_key=os.environ.get("DEVUP_API_KEY").

Anthropic Authentication

  • Base URL: https://api.devupai.com/anthropic
  • Header: x-api-key: <API_KEY>
  • Client Setup: Pass your key explicitly to anthropic.Anthropic(api_key=..., base_url=...).

Security Guidance

Store your DEVUP AI API key exclusively in secure server-side environment variables or secret managers. Never hardcode API keys into public repositories or client-distributed applications.

Tip: Load credentials securely in Python using standard environment variable mechanisms such as os.environ or python-dotenv during local development.
Protocol vs Language Ecosystem

Looking for Cross-Language Protocol Details?

While this page covers the broader Python developer ecosystem (including Anthropic, LangChain, and AutoGen), the OpenAI SDK integration page focuses on protocol drop-in compatibility across both Node.js and Python.

OpenAI SDK Guide

Other First-Party Ecosystems

Start Building with DEVUP AI in Python

Create an API key in the developer dashboard, point your favorite standard Python AI library to DEVUP AI, and run your first completion in seconds.