Skip to content

docs: Add code example for cross-endpoint dispatch#567

Open
promptless[bot] wants to merge 1 commit intomainfrom
promptless/flash-cross-endpoint-dispatch-example
Open

docs: Add code example for cross-endpoint dispatch#567
promptless[bot] wants to merge 1 commit intomainfrom
promptless/flash-cross-endpoint-dispatch-example

Conversation

@promptless
Copy link
Contributor

@promptless promptless bot commented Mar 23, 2026

Open this suggestion in Promptless to view citations and reasoning process

Adds a practical code example to the "Cross-endpoint communication" section showing how to call one endpoint from another using in-body imports. This documents the pattern that Flash's dependency resolver uses for cross-endpoint dispatch.

Trigger Events

runpod/flash PR #224: fix(stubs): resolve in-function @remote imports for cross-endpoint dispatch

Promptless Research (7 files, 1 GitHub PR)

  • Reviewed runpod/flash#224
  • Viewed .long_term_context/product_knowledge/product_overview.md
  • Viewed .long_term_context/doc_workflow/client_instructions.md
  • Viewed .long_term_context/style/client_style_guide.md
  • Viewed flash/create-endpoints.mdx
  • Viewed flash/execution-model.mdx
  • Viewed flash/apps/overview.mdx
  • Viewed flash/apps/deploy-apps.mdx

Agent Response

I've reviewed PR #224 and created a documentation suggestion.

Summary

PR #224 fixes a bug in Flash's dependency resolver where @Endpoint functions imported inside function bodies weren't being detected for cross-endpoint dispatch. Previously, this pattern caused ModuleNotFoundError on remote workers.

Documentation Update

I found that the existing "Cross-endpoint communication" section in the Flash deployment docs explains the mechanism conceptually but lacked any code examples showing users how to actually implement it.

Created suggestion: Add code example for cross-endpoint dispatch

Changes to flash/apps/deploy-apps.mdx:

  • Added a new subsection "Calling another endpoint from your code"
  • Included a practical two-file code example showing:
    • A GPU worker endpoint (gpu_inference)
    • A CPU pipeline endpoint that imports and calls the GPU endpoint from within its function body
  • Added a Note explaining that endpoint function imports must be inside the function body for Flash to detect and generate dispatch stubs

This documents the in-body import pattern that PR #224 enables, helping users understand how to build multi-endpoint pipelines in Flash.


Tip: Create additional Docs Collections to keep multiple repositories in sync 📚

```

## Troubleshooting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: This example documents the in-body import pattern that PR #224 fixes. The PR adds resolve_in_function_imports() and strip_remote_imports() to the dependency resolver, enabling the pattern shown in this code example where from gpu_worker import gpu_inference is used inside the function body for cross-endpoint dispatch.
View source

@mintlify
Copy link

mintlify bot commented Mar 23, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
runpod-docs 🟢 Ready View Preview Mar 23, 2026, 3:13 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants