Skip to main content

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:

  1. Explain the acceleration or isolation reason.
  2. Run duanflow whoami.
  3. Estimate runtime and cost.
  4. Check balance or organization credit.
  5. Ask for explicit confirmation.
  6. Report job id, logs, cost, and artifacts after completion.

Documentation

Release files for duanflow 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for duanflow 0.1.0
File Size Uploaded
duanflow-0.1.0.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for duanflow 0.1.0
File Interpreter ABI Platform
duanflow-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / duanflow-0.1.0.tar.gz

Download URL duanflow-0.1.0.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fbd7dfa588a10602342cc59c1d762e626d1d29876c94531fd3a1ec908473df37
BLAKE2b-256 checksum
How to use checksums
bb1cc7f50908f07dfb67d183a3e8bd4fec25b129c7d55b02c4a1fbcb5b3149c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / duanflow-0.1.0-py3-none-any.whl

Download URL duanflow-0.1.0-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d957f1d77bf5b4a4cffd2393c4df92f7dda2d3b507af96bbaa9e5cf7e004043
BLAKE2b-256 checksum
How to use checksums
78917c821e57fb62cb24d4c6fc64919603243cc89f17a437dd582aad72659490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page