- AVOID inline comments
pip install -e .[dev] # Install dev dependencies
pytest # Run tests
ruff check --fix --select I && ruff format # Lint and formatDAG-based workflow library connecting Gradio Spaces, ML models, and Python functions.
graph.py:Graphclass - holds nodes, edges, launches servernode.py:GradioNode,FnNode,InferenceNode,InteractionNodeport.py:Port,ScatteredPort,GatheredPortfor parallel executionedge.py:Edgeclass for node connectionsexecutor.py: Executes workflow nodesserver.py: FastAPI server with WebSocket for real-time UI updatesstate.py: Session state persistence with SQLitefrontend/: Svelte frontend for workflow visualization
Nodes use inputs and outputs dicts:
node = GradioNode(
space_or_url="owner/space",
api_name="/endpoint",
inputs={
"param": gr.Textbox(label="Label"), # UI input
"other": other_node.output_port, # Port connection
"fixed": "constant_value", # Fixed value
},
outputs={
"result": gr.Audio(label="Result"),
"hidden": gr.Text(visible=False), # Hidden output
},
)- Port access:
node.port_namereturns aPortfor connections - Graph creation:
Graph(nodes=[...])auto-wires from port connections in inputs - Internal attrs: Use
_prefix (_name,_fn) to avoid port name conflicts
- Create branch:
git checkout -b fix-issue-NUMBER - Implement fix
- Run:
pytest && ruff check --fix --select I && ruff format - Do not commit - leave for user