Integrations
LiteLLM
LiteLLM gives Python one interface for chat, embeddings and structured output, and a proxy server that serves models to a whole team. Point it at DEVUP AI with three settings, and every call runs on DEVUP AI models.
Requirements
- Python 3.10 to 3.14.
- a DEVUP AI API key from https://devupai.com/dashboard/api-keys. Create a dedicated key for LiteLLM so you can revoke it on its own.
Install LiteLLM
pip install litellmSet your API key
The examples read the key from DEVUP_API_KEY. Set it in the terminal where you run them:
PowerShell
$env:DEVUP_API_KEY = "YOUR_DEVUP_API_KEY"Bash
export DEVUP_API_KEY="YOUR_DEVUP_API_KEY"Connect LiteLLM to DEVUP AI
Every call passes three settings:
Settings
| Setting | Value | What it does |
|---|---|---|
| api_base | https://api.devupai.com/v1 | Sends the call to DEVUP AI. |
| api_key | DEVUP_API_KEY | Your DEVUP AI key, read from the environment. |
| model | openai/ + a catalog ID | openai/ tells LiteLLM to use the OpenAI-compatible API, followed by the catalog ID exactly as listed, such as openai/deepseek-ai/DeepSeek-V4-Pro. |
Send your first request
basic.py
import os
import litellm
response = litellm.completion(
model="openai/deepseek-ai/DeepSeek-V4-Pro",
api_base="https://api.devupai.com/v1",
api_key=os.environ["DEVUP_API_KEY"],
messages=[{"role": "user", "content": "Reply with exactly: Salam DEVUP"}],
)
print(response.choices[0].message.content)python basic.pyIt prints Salam DEVUP.
Stream tokens
Pass stream=True and print each chunk's delta as it arrives:
streaming.py
import os
import litellm
stream = litellm.completion(
model="openai/deepseek-ai/DeepSeek-V4-Pro",
api_base="https://api.devupai.com/v1",
api_key=os.environ["DEVUP_API_KEY"],
messages=[{"role": "user", "content": "Count from 1 to 5, separated by commas and spaces. Reply with the numbers only."}],
stream=True,
)
for chunk in stream:
if chunk.choices:
print(chunk.choices[0].delta.content or "", end="", flush=True)
print()It prints 1, 2, 3, 4, 5.
Call tools
Pass your tools, run the function the model asks for, and send the result back:
tools.py
import json
import os
import litellm
MODEL = "openai/deepseek-ai/DeepSeek-V4-Pro"
DEVUP = {"api_base": "https://api.devupai.com/v1", "api_key": os.environ["DEVUP_API_KEY"]}
tools = [{
"type": "function",
"function": {
"name": "get_order_status",
"description": "Look up the tracking number of an order.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
},
}]
def get_order_status(order_id):
return {"order_id": order_id, "status": "shipped", "tracking_number": "DZ-4471"}
messages = [{"role": "user", "content": "What is the tracking number of order A-1001? Use the get_order_status tool."}]
response = litellm.completion(model=MODEL, messages=messages, tools=tools, **DEVUP)
message = response.choices[0].message
messages.append(message.model_dump())
for call in message.tool_calls or []:
args = json.loads(call.function.arguments)
messages.append({
"role": "tool",
"tool_call_id": call.id,
"content": json.dumps(get_order_status(args["order_id"])),
})
final = litellm.completion(model=MODEL, messages=messages, tools=tools, **DEVUP)
print(final.choices[0].message.content)The model calls get_order_status and answers with the tracking number DZ-4471.
Create embeddings
litellm.embedding works the same way, with openai/BAAI/bge-m3:
embeddings.py
import os
import litellm
response = litellm.embedding(
model="openai/BAAI/bge-m3",
api_base="https://api.devupai.com/v1",
api_key=os.environ["DEVUP_API_KEY"],
input=["Salam DEVUP", "Order A-1001 ships today."],
)
print(len(response.data), len(response.data[0]["embedding"]))It prints 2 1024: two vectors of 1024 dimensions.
Get structured output
Pass a JSON schema in response_format, and the answer comes back as JSON that matches it:
structured_output.py
import json
import os
import litellm
schema = {
"type": "object",
"properties": {
"order_id": {"type": "string"},
"tracking_number": {"type": "string"},
},
"required": ["order_id", "tracking_number"],
"additionalProperties": False,
}
response = litellm.completion(
model="openai/deepseek-ai/DeepSeek-V4-Pro",
api_base="https://api.devupai.com/v1",
api_key=os.environ["DEVUP_API_KEY"],
messages=[{"role": "user", "content": "Order A-1001 has tracking number DZ-4471. Return it as JSON."}],
response_format={
"type": "json_schema",
"json_schema": {"name": "order", "schema": schema, "strict": True},
},
)
print(json.loads(response.choices[0].message.content))It prints {'order_id': 'A-1001', 'tracking_number': 'DZ-4471'}.
Use any catalog model
Put openai/ in front of any catalog ID. LiteLLM removes only that first prefix, so a catalog ID that starts with openai/ is written openai/openai/gpt-5.4-mini:
model_switch.py
import os
import litellm
response = litellm.completion(
model="openai/openai/gpt-5.4-mini",
api_base="https://api.devupai.com/v1",
api_key=os.environ["DEVUP_API_KEY"],
messages=[{"role": "user", "content": "Reply with exactly: Salam DEVUP"}],
)
print(response.choices[0].message.content)Run the LiteLLM Proxy
The LiteLLM Proxy serves DEVUP AI models to any OpenAI-compatible client, under short names you choose. Install it:
pip install "litellm[proxy]"List your models in config.yaml. Each entry maps a model_name to a DEVUP AI model, and the proxy reads both keys from the environment:
config.yaml
model_list:
- model_name: deepseek-v4-pro
litellm_params:
model: openai/deepseek-ai/DeepSeek-V4-Pro
api_base: https://api.devupai.com/v1
api_key: os.environ/DEVUP_API_KEY
- model_name: gpt-5.4-mini
litellm_params:
model: openai/openai/gpt-5.4-mini
api_base: https://api.devupai.com/v1
api_key: os.environ/DEVUP_API_KEY
- model_name: bge-m3
litellm_params:
model: openai/BAAI/bge-m3
api_base: https://api.devupai.com/v1
api_key: os.environ/DEVUP_API_KEY
model_info:
mode: embedding
general_settings:
master_key: os.environ/LITELLM_MASTER_KEYSet the key that clients must send to the proxy. Replace sk-change-me with a long random value that keeps the sk- prefix:
PowerShell
$env:LITELLM_MASTER_KEY = "sk-change-me"Bash
export LITELLM_MASTER_KEY="sk-change-me"Start the proxy in the folder that holds config.yaml:
litellm --config config.yaml --port 4000Clients send the master key and a model_name from config.yaml, for example with the OpenAI SDK:
proxy_client.py
import os
from openai import OpenAI
client = OpenAI(base_url="http://localhost:4000", api_key=os.environ["LITELLM_MASTER_KEY"])
response = client.chat.completions.create(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Reply with exactly: Salam DEVUP"}],
)
print(response.choices[0].message.content)It prints Salam DEVUP. Requests without the master key are refused.
Troubleshooting
- KeyError: 'DEVUP_API_KEY'The examples read the key from the environment. Set DEVUP_API_KEY in the same terminal that runs python.
- The proxy stops at startup with UnicodeEncodeError on WindowsSet PYTHONUTF8 in the same terminal, then start the proxy again:powershell
$env:PYTHONUTF8 = "1" - The proxy refuses a requestSend the master key as the API key, and a model_name from config.yaml as the model.
FAQ
Does LiteLLM work with DEVUP AI?
Yes. Pass api_base https://api.devupai.com/v1, your DEVUP AI key, and the catalog ID with openai/ in front. Chat, streaming, tool calls, embeddings and structured output then run on DEVUP AI models.
How do I write the model name?
Put openai/ in front of the catalog ID, exactly as listed: openai/deepseek-ai/DeepSeek-V4-Pro. LiteLLM removes only that first prefix, so a catalog ID that starts with openai/ is written openai/openai/gpt-5.4-mini.
Can I run LiteLLM as a proxy for my team?
Yes. List DEVUP AI models in config.yaml, start litellm --config config.yaml, and point any OpenAI-compatible client at the proxy with its master key and a model_name from the file.
Can LiteLLM create embeddings with DEVUP AI?
Yes. litellm.embedding with openai/BAAI/bge-m3 returns 1024-dimension vectors.
Does structured output work?
Yes. Pass response_format with a JSON schema; the answer comes back as JSON that matches the schema.
Where does LiteLLM read my DEVUP AI key?
The examples read DEVUP_API_KEY from the environment, and config.yaml reads it with os.environ/DEVUP_API_KEY, so the key never appears in your code or config file.
Related integrations
- LangGraph: Build stateful LangGraph agents with tool loops, streaming and memory on DEVUP AI models.
- CrewAI: Run CrewAI multi-agent crews on DEVUP AI with CrewAI's built-in OpenAI client.
- Pydantic AI: Connect Pydantic AI agents to DEVUP AI with OpenAIChatModel and OpenAIProvider.
- Python Ecosystem: Use the openai and anthropic packages, LangChain, and AutoGen from Python.