DuanFlow Python SDK and CLI for cloud GPU/NPU tasks
Project description
DuanFlow
DuanFlow is a Python SDK and CLI for submitting Python functions and existing repository commands to DuanFlow cloud GPU/NPU compute.
It is designed for developers and coding agents that need GPU/NPU acceleration, isolated execution, long-running jobs, structured logs, and artifacts.
Install
pip install duanflow
Login
Use browser/link login. Do not paste passwords, API keys, or tokens into an agent chat.
duanflow auth login --api-base https://duanflow.zeabur.app
duanflow whoami
Run a Cloud Function
import subprocess
import duanflow as df
app = df.App("repo-eval")
@app.function(gpu="L40S", timeout=3600, artifacts=["reports/"])
def run_eval():
subprocess.run(
"pytest evals/ --json-report --json-report-file reports/eval.json",
shell=True,
check=True,
)
return {"report": "reports/eval.json"}
print(run_eval.remote(_duanflow_wait=True, _duanflow_stream_logs=True))
Agent Usage
Agents should first decide whether a task can benefit from GPU/NPU or cloud execution. Good fits include model training, inference, evals, embeddings, reranking, image/audio/video processing, simulations, tensor-heavy workloads, and large data processing that can use CuPy, cuDF, RAPIDS, PyTorch, JAX, TensorFlow, torch-npu, or vendor NPU runtimes.
Before submitting a billable cloud job, agents should:
- Explain the acceleration or isolation reason.
- Run
duanflow whoami. - Estimate runtime and cost.
- Check balance or organization credit.
- Ask for explicit confirmation.
- Report job id, logs, cost, and artifacts after completion.
Documentation
- Docs: https://duanflow.zeabur.app/docs.html
- Examples: https://duanflow.zeabur.app/examples.html
- Hosted agent skill: https://duanflow.zeabur.app/skills/duanflow-cloud-exec/SKILL.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duanflow-0.1.0.tar.gz.
File metadata
- Download URL: duanflow-0.1.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbd7dfa588a10602342cc59c1d762e626d1d29876c94531fd3a1ec908473df37
|
|
| MD5 |
6c61a3c1465cb262352ad28cf07b00dd
|
|
| BLAKE2b-256 |
bb1cc7f50908f07dfb67d183a3e8bd4fec25b129c7d55b02c4a1fbcb5b3149c4
|
File details
Details for the file duanflow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: duanflow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d957f1d77bf5b4a4cffd2393c4df92f7dda2d3b507af96bbaa9e5cf7e004043
|
|
| MD5 |
379634e0032ec940257c6b1555d6405d
|
|
| BLAKE2b-256 |
78917c821e57fb62cb24d4c6fc64919603243cc89f17a437dd582aad72659490
|