Skip to content

[serve.llm] delete dead code from prompt format days - #53621

Merged
kouroshHakha merged 11 commits into
ray-project:masterfrom
nrghosh:delete_abstraction
Jun 10, 2025
Merged

kouroshHakha merged 11 commits into
ray-project:masterfrom
nrghosh:delete_abstraction

Conversation

@nrghosh

@nrghosh nrghosh commented Jun 6, 2025 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Cleanup - quick todo

Related issue number

https://anyscale1.atlassian.net/browse/LLM-1705

Checks

@nrghosh
nrghosh requested a review from a team as a code owner June 6, 2025 19:46
@nrghosh
nrghosh force-pushed the delete_abstraction branch 4 times, most recently from 07a9a52 to 0ca98dd Compare June 6, 2025 22:57
@nrghosh
nrghosh force-pushed the delete_abstraction branch 2 times, most recently from c600add to f415836 Compare June 6, 2025 23:28
@nrghosh nrghosh changed the title quick todo - delete abstraction for prompt formats [serve] delete abstraction for prompt formats Jun 6, 2025
- Merge branch 'master' into delete_abstraction
@nrghosh
nrghosh force-pushed the delete_abstraction branch from f415836 to d8d36ec Compare June 6, 2025 23:46
@kouroshHakha

Copy link
Copy Markdown
Contributor

@nrghosh you can add go label when you think this PR is ready to get tested against pre-merge ci.

@kouroshHakha kouroshHakha added the go add ONLY when ready to merge, run all tests label Jun 7, 2025
@kouroshHakha kouroshHakha changed the title [serve] delete abstraction for prompt formats [serve.llm] delete dead code from prompt format days Jun 7, 2025

@kouroshHakha kouroshHakha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

more stuff can be deleted in this pr.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The huggingfacePromptFormat should also be deleted and absorbed? There is basically no need for this abstraction anymore?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you search for generate_prompt I don't think there is any place that uses it. We need to do a holistic clean up here. Most of items in this file are dead code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, generate_prompt isn't used in other places but the class is just used as a format specifier - mostly in tests. If we get rid of all instances there won't be the same pydantic type safety / standardization (if that becomes something that needs to be tested / guaranteed later).

But for now, yes can get rid of most of this code - but will need to get rid of some tests as well (like in test_prompt_formats and format specifiers in server_models.py (part of LLMConfig) (which could break some tests but is fixable).

Will review and see what else could be cleaned up.

@kouroshHakha kouroshHakha Jun 7, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes all of those can be deleted. the tests also need clean up.

@nrghosh
nrghosh force-pushed the delete_abstraction branch from 8178cc0 to 060161c Compare June 9, 2025 23:39

@kouroshHakha kouroshHakha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

great. just some nits:


from ray.llm._internal.utils import try_import

if TYPE_CHECKING:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

delete TYPE_CHECKING?

)
except OSError:
pass
# Note (Nikhil): prompt_format functionality has been removed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: no need to keep this note as it won't make sense anymore.

@nrghosh
nrghosh requested a review from kouroshHakha June 10, 2025 07:33
@kouroshHakha
kouroshHakha merged commit 6c3dfaf into ray-project:master Jun 10, 2025
@nrghosh
nrghosh deleted the delete_abstraction branch June 10, 2025 18:05
elliot-barn pushed a commit that referenced this pull request Jun 18, 2025
elliot-barn pushed a commit that referenced this pull request Jul 2, 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.

2 participants