Skip to main content

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:

  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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duanflow-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duanflow-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

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

Hashes for duanflow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbd7dfa588a10602342cc59c1d762e626d1d29876c94531fd3a1ec908473df37
MD5 6c61a3c1465cb262352ad28cf07b00dd
BLAKE2b-256 bb1cc7f50908f07dfb67d183a3e8bd4fec25b129c7d55b02c4a1fbcb5b3149c4

See more details on using hashes here.

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

Hashes for duanflow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d957f1d77bf5b4a4cffd2393c4df92f7dda2d3b507af96bbaa9e5cf7e004043
MD5 379634e0032ec940257c6b1555d6405d
BLAKE2b-256 78917c821e57fb62cb24d4c6fc64919603243cc89f17a437dd582aad72659490

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page