Skip to content

Conversation

@ahao-anyscale
Copy link
Contributor

Docs for the callback functionality introduced in #57257

Signed-off-by: ahao-anyscale <[email protected]>
@ahao-anyscale ahao-anyscale changed the title [serve][llm][docs] [serve][llm][docs] Callback Docs Nov 17, 2025
@kouroshHakha kouroshHakha added the go add ONLY when ready to merge, run all tests label Nov 17, 2025
@kouroshHakha kouroshHakha changed the title [serve][llm][docs] Callback Docs [serve][llm][docs] Add callback Docs Nov 17, 2025
@ahao-anyscale ahao-anyscale marked this pull request as ready for review November 17, 2025 23:27
@ahao-anyscale ahao-anyscale requested review from a team as code owners November 17, 2025 23:27
@kouroshHakha kouroshHakha enabled auto-merge (squash) November 17, 2025 23:28

We provide the ability to create custom node initialization behaviors with the API defined by [`CallbackBase`](https://github.com/ray-project/ray/blob/master/python/ray/llm/_internal/common/callbacks/base.py). Callback functions defined in the class are invoked at certain parts of the initialization process. An example is the above mentioned [`CloudDownloader`](https://github.com/ray-project/ray/blob/master/python/ray/llm/_internal/common/callbacks/cloud_downloader.py) which overrides the `on_before_download_model_files_distributed` function to distribute download tasks across nodes. To enable your custom callback, specify the classname inside `LLMConfig`.

```python
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: for changes like these i prefer adding them to a doc_code directory with e2e working example. Advantage is that if the API changes, the example would fail the docs test.

@kouroshHakha kouroshHakha merged commit ae94ff4 into ray-project:master Nov 17, 2025
8 checks passed
Aydin-ab pushed a commit to Aydin-ab/ray-aydin that referenced this pull request Nov 19, 2025
Signed-off-by: ahao-anyscale <[email protected]>
Signed-off-by: Aydin Abiar <[email protected]>
ykdojo pushed a commit to ykdojo/ray that referenced this pull request Nov 27, 2025
SheldonTsen pushed a commit to SheldonTsen/ray that referenced this pull request Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants