A visual graph can make three parallel model calls look like one operation. For a Gradio workflow that sends text requests through CometAPI, I would put the concurrency boundary around the outgoing calls—not around each node independently.
The Gradio workflow guide describes fan-out: one input feeds multiple operators that generate in parallel. It also allows an operator to be a custom Python function. Its demonstrated fan-out uses image models through Hugging Face Inference Providers, not CometAPI. The text-only design below is a proposed application of that pattern, not a tested connector or a claim about CometAPI image endpoints.
One shared gate for the CometAPI operators
Suppose a graph turns one brief into three text outputs: a summary, a critique, and a list of questions. Each operator can have its own prompt and model adapter, but all three should acquire a permit from the same application-side semaphore before sending a CometAPI request.
A separate semaphore inside each node would bound that node, not the combined fan-out. Likewise, a gate recreated for every graph run would leave concurrent runs with separate budgets. Share the gate across the calls that consume the same application budget.
This follows CometAPI’s routing guidance, which recommends limiting concurrency before requests leave the application, exponential backoff with jitter for 429, and an output-token ceiling. The practical request path would be:
- Validate the node’s model adapter. For OpenAI-compatible text routes, the official article specifies
https://api.cometapi.com/v1and changing themodelvalue. It also warns that a shared Chat Completions surface does not make every parameter identical. Check the chosen model ID, required endpoint, and supported output-limit parameter before wiring that adapter into the graph. - Set a supported output ceiling. Give each text operator an explicit limit appropriate to its task. Do not assume an identical parameter or value works across every model.
- Acquire the shared permit for each outgoing attempt. Release it when that attempt finishes. If a retry is allowed, wait with backoff and jitter outside the permit, then reacquire the same gate. Retries must not take an unlimited side path around admission control.
- Return a node result or a bounded failure. Set an attempt budget rather than letting a node retry until it succeeds.
Neither source establishes a semaphore capacity or token ceiling for your account. A semaphore limits in-flight calls; it does not enforce requests per minute or token throughput. Those need separate budgets. A process-local semaphore also cannot coordinate multiple worker processes consuming the same budget; that deployment needs a shared admission mechanism.
Retry the failed branch, not everything that already worked
If the critique node fails while the summary and questions succeed, my default would be to retain the successful outputs and expose the critique failure. Do not automatically replay the whole graph just to recover one branch. This is proposed application behavior, not a verified Gradio guarantee.
Keep fallback narrow too. CometAPI’s article distinguishes recoverable routing cases from malformed input and authentication failures. Treat the latter as stop-and-fix conditions, not invitations to try another model. Any permitted fallback attempt should consume the same node attempt budget and shared request gate.
Before deployment, test overlapping graph runs and an injected 429: does the combined in-flight count stay bounded, and can one failed branch finish without replaying its successful siblings? That verifies the application behavior the diagram alone cannot establish.
Where does your graph’s request budget live today: inside individual operators, or at the shared outbound boundary?